All errors are returned in an OpenAI-compatible envelope.
{
"error": {
"message": "Incorrect API key provided. ...",
"type": "authentication_error",
"param": null,
"code": "invalid_api_key"
}
}| Status | type / code | Meaning |
|---|---|---|
| 400 | invalid_request_error | Invalid parameter / context length exceeded (do not retry) |
| 401 | authentication_error / invalid_api_key | Key missing, wrong, or expired |
| 402 | insufficient_quota_error / insufficient_quota | Insufficient credit or spend limit reached |
| 403 | permission_error / model_not_allowed · insufficient_scope | Restricted by the key's allowed models or scopes |
| 404 | invalid_request_error / model_not_found · job_not_found | Model or job does not exist |
| 413 | invalid_request_error | Request body too large (5MB for image edits) |
| 429 | rate_limit_error / rate_limit_exceeded | Rate limit — retry after the Retry-After header |
| 502 | api_error / backend_unavailable | Upstream provider failure (retryable) |
Rate limits
The default rate limit is 100 req/min per key, and you can adjust it when you create or edit the key.
Check your remaining quota with the X-RateLimit-Limit / X-RateLimit-Remaining / X-RateLimit-Reset response headers.
Auth endpoints (login, signup, and so on) have a separate, lower limit.