organization_spend_quota_exhausted means your organization’s spend limit for the current period has too little room left to start another run. Read this page when runs fail with a 429 and the code names spend.
What happened
Route:POST /v1/runs.
An organization can have a spend limit per quota period. The period is the current UTC calendar month. Before each run, OpenType compares the run’s per-request spend ceiling, at most 20,000 micro-USD ($0.02), with the spend left in the period. If the ceiling is larger than what is left, the run is refused.
The check uses the ceiling, not the actual cost. A decision run that would cost 19 micros is still refused when fewer than 20,000 micros remain.
What is left counts runs in flight: it is the limit minus the larger of settled spend and held spend. Each run holds its full ceiling until it settles, so many concurrent runs can use up the room for a short time.
The run was refused before it existed. Nothing was stored and nothing was charged. A replay of an Idempotency-Key that already owns a run is never refused with 429.
The message gives both numbers:
A 429 from OpenType always means a period quota refused the run. The response does not say when to retry, so choose your own backoff.
How to fix
- Read the quota with
GET /v1/quota(needsusage_read). Compareremaining_spend_microswithlimits.request_spend_ceiling_micros. - If runs in flight are holding the room, back off and retry. Holds are released as runs settle.
- If the period is used up, wait for the next period, which starts at 00:00:00Z on the first day of the next month.
- Retry with the same
Idempotency-Key. The refused request never created a run.
Example
Related
- Spend limits and quotas - period limits, the per-request ceiling and
GET /v1/quota. - organization_token_quota_exhausted - the token side of the same period quota.
- Error handling - a backoff policy for 429 and 5xx.
- Problem codes - every code, its status, and whether a retry can help.