AI API budget ran out: which error? Claude 400 and 429, Sume 402
Claude returns 429 enforced_spend_limit_reached at the tier cap and 400 for a limit you set. Sume returns 402 at create and a failed run at the cap.

On Claude, hitting the monthly tier cap returns 429 with error_code enforced_spend_limit_reached and no retry-after, while hitting a limit you set yourself returns 400. On Sume, an empty wallet is a 402 at create, and a run that reaches its cap ends failed. Do not retry any of these in a loop, because waiting does not change the budget.
What does Claude return?
The rate limits page separates the cases.
| Situation | Response |
|---|---|
| Monthly tier cap reached | 429 rate_limit_error, error_code enforced_spend_limit_reached, no retry-after |
| Self-set limit reached | 400 invalid_request_error, You have reached your specified API usage limits |
| Workspace limit reached | The workspace variant of the 400 |
| Default workspace | Spend and rate limits cannot be set on it |
What does Sume return?
Sume splits the cases by when the money matters.
- 402 insufficient_credits or organization_wallet_not_provisioned at create: nothing ran and nothing is billed.
- 429 for rate limits, which is a separate case from budget. Check the code before you retry.
- A run that hits its generation_spend_cap_usd ends failed. The failure shows on the receipt, and the finished generation is billed.
- A 400 for a bad cap: 0 or a value above 500.
How should my client branch?
Branch on the code, never on the status alone. A 429 from Claude with no retry-after is a budget problem, so backing off for a second will not clear it. Page a person, or switch to a fallback path.
On Sume, a 402 is also a person problem. A failed run at its cap is different: the work started, so read the receipt before you start another, and raise the cap only if you meant to.
- Retry network errors and 5xx with a backoff.
- Never retry a spend error without a new decision.
- Log the code and the budget field you read.
Where to read next
The credits and spend errors and the spend caps section list the exact Sume codes.
Sources
Related posts
More in Developers
- AI image API 429s: queue_full vs rate_limited, and how to retry each
Sume returns 429 for two different reasons. rate_limited means back off; queue_full means wait for jobs to finish. A Python retry that treats them differently.
- Is there an asset library API for AI images and videos?
Sume has no folders or tags. Your library is completed jobs plus durable media.sume.com artifacts, which you list, label by Idempotency-Key, and download.
- AI image model fallback in Python: try the next model on a 502
Image models launch and fail on different days. A Python loop that tries the next Sume model id on 502 or 503, stops on 400, and keeps the 202 job path intact.
- Claude Cost Report API: daily buckets by workspace vs Sume /v1/usage
Anthropic's cost_report endpoint returns USD cost in 1d buckets, groupable by workspace or description. Sume's /v1/usage sums one thread, run or job instead.
Written by Sume