LLM API Error Codes: 400 to 529 Across 5 Providers (2026)
What each status code means at OpenAI, Anthropic, Google, DeepSeek and OpenRouter, which are safe to retry, and why an empty balance is a 402 at three.
TL;DR: The status code tells you less than you think. Running out of money is a 402 at Anthropic, DeepSeek and OpenRouter, and a 429 at OpenAI. Server overload is a 503 almost everywhere and a 529 at Anthropic, which is not a standard HTTP code and falls through most error handlers. This page is the cross-provider reference: every documented code at five providers, which ones are safe to retry, and links to the specific failures we have reproduced and fixed.
Last updated 2026-08-31. Every code below was read from the named provider’s own error documentation on that date.
Which status codes does each provider document?
Blank cells mean the provider does not document that code, not that it never returns it.
| Code | OpenAI | Anthropic | Google Gemini | DeepSeek | OpenRouter |
|---|---|---|---|---|---|
| 400 | invalid service_tier | invalid_request_error | invalid_request, failed_precondition, parameter_unknown | Invalid Format | Bad Request, invalid params, CORS |
| 401 | invalid auth, wrong key, no org, IP not allowed | authentication_error | authentication | Authentication Fails | invalid credentials, expired OAuth |
| 402 | billing_error | Insufficient Balance | insufficient credits | ||
| 403 | country or region not supported | permission_error | permission_denied | permissions, guardrail, moderation | |
| 404 | not_found_error | not_found, model_not_found | |||
| 408 | your request timed out | ||||
| 409 | conflict_error | already_exists, aborted | |||
| 413 | request_too_large | ||||
| 416 | out_of_range | ||||
| 422 | Invalid Parameters | ||||
| 429 | 5 distinct causes, see below | rate_limit_error | rate_limit_exceeded, quota_exceeded, too_many_requests | Rate Limit Reached | you are being rate limited |
| 499 | cancelled | ||||
| 500 | server error | api_error | api_error | Server Error | |
| 501 | unimplemented | ||||
| 502 | model is down or returned an invalid response | ||||
| 503 | engine overloaded, Slow Down | service_unavailable | Server Overloaded | no provider meets your routing requirements | |
| 504 | timeout_error | deadline_exceeded | |||
| 529 | overloaded_error |
Four rows in that table are where production incidents actually come from.
Why does 429 mean five different things?
429 is the most overloaded code in the industry. At OpenAI it covers five separate conditions with five separate fixes: rate limit reached for requests, credit balance exhausted, organization spend limit reached, project spend limit reached, and organization usage limit reached. Only the first is a rate limit. The other four are money, and backoff will not clear them.
Google at least splits the meanings into distinct codes at the same status: rate_limit_exceeded for per-minute limits, quota_exceeded for the daily quota, too_many_requests for burst.
Anthropic has the sharpest tell. Its docs state that a usage-tier spend-cap 429 arrives with no retry-after header and keeps failing until access resumes. So the presence of the header is itself the diagnostic: header means wait, no header means fix your account. Anthropic also returns a 400 rather than a 429 when you hit a spend limit you configured yourself, except on the Claude Code workspace, which can return 429 instead.
We wrote the decision procedure separately in 429 Too Many Requests: what it means and when to retry. For Claude Code specifically, where a rate-limit 429 and a quota 429 look identical in the UI, Rate Limit Reached in Claude Code separates them. If you want the per-vendor limits themselves rather than the errors, five vendors, five rulebooks has the comparison, and OpenRouter Kimi K3 429s is the aggregator case where failover is faster than waiting.
Why does 529 break error handlers?
529 is not a registered HTTP status code. Anthropic’s own reference gives it one line:
529 -
overloaded_error: The API is temporarily overloaded.
Every other provider here expresses that condition as 503. Anthropic’s error reference does not list 503 at all.
This matters because a lot of retry code is written as if 500 <= status <= 504. That range does not contain 529, so Anthropic overload errors escape the retry path and surface to the user as a hard failure. Anthropic’s own SDKs retry transient failures twice by default and honor retry-after when present, so the bug shows up mostly in hand-rolled HTTP clients.
Anthropic’s docs also carry a warning worth reading twice: if your organization ramps traffic sharply you may see 429 rather than 529, because of acceleration limits. Same symptom, opposite cause, different fix.
The full reproduction and eight fixes are in Claude API error 529 overloaded_error, which is the most-read troubleshooting page we have. For the architectural answer rather than the retry answer, Claude Code fallbackModel sets up three-tier failover, and Opus outages and 529s covers migration when one model is persistently overloaded.
Why does the same missing model return 404 at one provider and 400 at another?
A model name that does not resolve produces 404 not_found at Google (it has a dedicated model_not_found code), 404 at OpenAI, and 400 at some gateways that validate the model field before routing. The user-visible message is usually some variant of “the model does not exist or you do not have access to it”, and access is the operative half: on OpenAI the same string appears for a model that exists but is not enabled for your organization.
Both cases are covered in OpenAI 404 model does not exist. The newer-model variant, where the model is real and released but your account cannot see it yet, is in GPT-5.6 model not available.
Why does 402 exist at three providers and not at OpenAI?
Anthropic, DeepSeek and OpenRouter all return 402 when the account is out of money. OpenAI files the same event under 429.
The practical consequence is that a naive handler which treats 4xx as fatal and 429 as retryable behaves correctly at Anthropic and incorrectly at OpenAI: it will sit in a backoff loop against an empty balance. Branch on the message body, not the code.
DeepSeek’s 402 Insufficient Balance has a second wrinkle since the August 2026 move to peak and off-peak billing, because the same workload drains a balance at different rates depending on the hour. DeepSeek API price increase has the windows and the multipliers.
Which codes should you retry?
| Retry | Do not retry |
|---|---|
| 408 timeout | 400 malformed request |
| 409 aborted or conflict | 401 authentication |
| 429 with a Retry-After header | 402 billing |
| 500, 502, 503, 504 | 403 permission, region, moderation |
| 529 Anthropic overload | 404 model or resource not found |
| 413 request too large | |
| 422 invalid parameters | |
| 429 without a Retry-After header |
Two operational notes on top of that table.
Retry-After is not universal. OpenRouter documents it on 429 and 503. Anthropic’s SDKs honor it when present, retrying transient failures “twice by default, honoring the retry-after header when present”. OpenAI’s guidance on a rate-limit 429 is to pace requests and respect Retry-After headers. Nothing guarantees the header exists, so your backoff needs a default.
Google documents 408 on its troubleshooting page as a transient error worth retrying, but its error-code reference carries no 408 row, which is why the matrix above leaves that cell blank.
A 413 is a size problem, not a context problem. Anthropic publishes hard request-size limits: 32 MB for Messages and Token Counting, 256 MB for the Batch API, 500 MB for the Files API. On the direct API those are enforced by Cloudflare before the request reaches Anthropic, so the error body may not look like an Anthropic error at all.
Which failures never reach a status code?
Some failures return 200 and break anyway.
Mid-stream errors. When you stream over server-sent events, an error can arrive after the API has already returned 200. Anthropic documents this explicitly: standard error handling does not apply, and you have to handle error events inside the stream.
TLS failures. These never reach the API. Claude Code SSL certificate errors covers corporate CA interception, which looks like an outage and is not one.
Import and SDK errors. A rename in the SDK surfaces as a Python traceback rather than an HTTP code. claude-code-sdk import errors after the June 2026 rename has the mapping.
Timeouts on image generation. Long-running image calls fail differently from chat calls. GPT-Image-2 slow and 504 errors has five root causes.
What should you read next?
One more layer worth knowing if you route through an aggregator: OpenRouter tags provider errors with a canonical error_type string and tells you to prefer it over the status, because it is “stable across all three API skins even when the native protocol code is lossy”. That is the same lesson as this whole page, enforced at the gateway.
For the code patterns rather than the code meanings, AI API error handling has exponential backoff with jitter, multi-model fallback, and a circuit breaker you can paste. For one specific tool’s error surface rather than a provider’s, the Codex error index maps 15 symptoms to fixes.
References
Frequently Asked Questions
- Is a 529 error the same as a 503?
- Functionally yes, but only Anthropic returns 529. It is a non-standard status meaning
overloaded_error, and Anthropic's docs do not list 503 at all. OpenAI, Google, DeepSeek and OpenRouter all express the same condition as 503. If your error handler only catches 500 through 504, Anthropic overload errors fall straight through it. - Why does OpenAI return 429 when my credit balance is empty?
- Because OpenAI files billing exhaustion under rate limiting. Its error reference lists 'credit balance exhausted', 'organization spend limit reached', 'project spend limit reached' and 'organization usage limit reached' all as 429s. Anthropic, DeepSeek and OpenRouter return 402 for the same condition. Retrying a billing 429 with backoff will never succeed, which is why you have to read the message body rather than branch on the status alone.
- Which error codes are safe to retry automatically?
- 408, 409 conflict, 429 with a Retry-After header, and the 5xx family including 502, 503, 504 and Anthropic's 529. Do not retry 400, 401, 402, 403, 404, 413 or 422; those need a change to the request, the key, or the account. The dangerous middle case is a 429 that carries no Retry-After header, which at Anthropic signals a spend cap rather than a rate limit and will keep failing until the window resets.
- What does Anthropic's 402 billing_error mean?
- There is a problem with your billing or payment information, not with your rate limit or your key. Anthropic documents 402 as
billing_errorand points you at payment details in the Console, or AWS Marketplace if you are on Claude Platform on AWS. It is separate from the 400 that Anthropic returns when you hit a spend limit you set yourself. - Do all providers send a Retry-After header?
- No, and the exceptions matter. OpenRouter documents Retry-After on both 429 and 503. Anthropic's SDKs honor it when present, retrying transient failures twice by default, but a usage-tier spend-cap 429 arrives with no Retry-After at all. Treat a missing header as a signal that the condition is not time-based.


