Errors
What each status means and what to do about it. Nothing is charged for a request that ends in one of these before a model answers.
The shape
OpenAI and Responses formats
{"error": {"message": "...", "type": "...", "code": "...", "param": null}}Anthropic format
{"type": "error", "error": {"type": "...", "message": "..."}}By status
| Status | Code | Meaning | What to do |
|---|---|---|---|
| 400 | model_not_found | The model id is not on this API. The message lists the ids that are. The Anthropic format answers 404 for this. | Use an id from Models |
| 400 | context_length_exceeded | The conversation is longer than the model's context | Shorten it or compact the session |
| 400 | tool_choice_unsupported | The model only takes tool_choice: "auto" | Send auto, or use another model |
| 400 | images_unsupported, too_many_images | The model does not take images, or not that many | Use a model that lists images |
| 401 | The key is missing, wrong or turned off | Check the header and the key | |
| 402 | budget_exceeded | Not enough credit for this request. The message says what it needed and what you have. | Add credit |
| 402 | key_budget_exceeded | The key has reached its spend cap. Account credit is untouched. | Raise the cap or use another key |
| 413 | request_too_large | The request body is over 32 MB | Send less |
| 429 | rate_limited | More than 1,200 requests a minute from one account | Wait the seconds in retry-after |
| 429 | account_paused | Repeated requests with no credit paused the account | Add credit |
| 503 | temporarily_unavailable | The model is busy. The Anthropic format answers 529. | Try again in a minute |
In a stream
A failure after the stream has started arrives as an error chunk in the OpenAI format and as an error event in the Anthropic format, rather than as a status.
max_tokens is never an error
An output limit higher than the model or your credit allows is lowered to fit, silently. It does not fail the request.