AI error codes explained: 401, 403, 429, 500, 503 and 529
An error number on its own does not tell you whether the provider is down. Some mean something is wrong with your request or account. Others point at the service. This guide uses what the providers themselves document.
The rule of thumb
In general, codes in the 400s mean the request was refused because of something on your side, such as a bad key, no credit or too many requests. Codes in the 500s mean a problem on the provider’s side. The providers’ own advice follows that split: do not retry most 400s, because the same request will fail again, and retry 500s after a wait.
The codes that are about you
- 401. Authentication failed. OpenAI lists a wrong or outdated key, not belonging to an organisation, and a request from an address that is not on your allowlist. Anthropic describes a malformed, revoked or expired key. xAI and DeepSeek describe a missing or wrong key.
- 402. A billing problem. Anthropic documents a payment problem. DeepSeek documents it as insufficient balance, meaning your account has run out of funds.
- 403. Permission refused. OpenAI uses it when a country, region or territory is not supported. Anthropic and xAI use it when a key lacks permission for the resource.
- 400 and 422. The request itself is wrong or failed validation. Fix the request, then try again.
429 is not one thing
A 429 means “too many”, but the reason varies. OpenAI documents several different 429 errors: a rate limit reached, credit used up, an organisation or project spend limit reached, a usage quota, and a separate “slow down” signal after traffic grew too fast. Anthropic documents a rate limit or a monthly spend cap, and says a spend-cap 429 carries no retry delay and keeps failing until access resumes. Google calls its version RESOURCE_EXHAUSTED and links it to rate limits or quotas. In every case the documented causes are limits on your account or traffic, not a fault with the service.
The codes that point at the service
- 500. An unexpected problem on the provider’s side. OpenAI and Anthropic both suggest retrying after a wait. OpenAI adds that you should check its status page if the error persists.
- 502, 503 and 504. Mistral lists these as a bad response upstream, a service that is down or overloaded, and a timeout. All are worth retrying with a delay.
- 503 on its own. OpenAI describes the model as temporarily overloaded. DeepSeek describes the server as overloaded by demand. Google describes the service as temporarily unreachable or overloaded.
- 529. Anthropic’s code for an overloaded API. Anthropic says it can happen when traffic is high across all users.
- 504 and 408. A timeout. Anthropic suggests streaming responses for long requests.
What to do with this
If you see 401, 402, 403, 400 or 422, check your key, billing and request first. If you see a 429, look at your limits and slow down. If you see 500, 503, 504 or 529, check the provider’s status page and ours, and retry after a pause. The next guide, outage or rate limit?, takes you through telling the difference.
Sources
Read on 8 October 2026. Providers change their documentation, so check it for anything important.