Errors and troubleshooting
Failed requests return an HTTP error status with a JSON body describing the problem.
| Problem | Typical cause | Retry? |
|---|---|---|
| Authentication (401) | Missing, malformed or revoked API key. See Authentication. | No. Fix the key first. |
| Billing | Insufficient credit balance. Check Billing. | No. Add credits, then retry. |
| Invalid input (400) | Unknown model identifier, malformed JSON, or a request larger than the model's context window. | No. Correct the request. |
| Rate limit (429) | Too many requests in a short period. | Yes, after a delay with backoff. |
| Service or provider error (5xx) | A temporary failure on our side or the model's provider. | Yes, a few times with exponential backoff. |
Still stuck?
Contact support and include the time of the failed request, the model identifier and the error message. Never include your API key.