← All docs

Error Format & Rate Limits

OpenAI-compatible error envelope, status code table, rate limit headers.

All errors are returned in an OpenAI-compatible envelope.

{
  "error": {
    "message": "Incorrect API key provided. ...",
    "type": "authentication_error",
    "param": null,
    "code": "invalid_api_key"
  }
}
Statustype / codeMeaning
400invalid_request_errorInvalid parameter / context length exceeded (do not retry)
401authentication_error / invalid_api_keyKey missing, wrong, or expired
402insufficient_quota_error / insufficient_quotaInsufficient credit or spend limit reached
403permission_error / model_not_allowed · insufficient_scopeRestricted by the key's allowed models or scopes
404invalid_request_error / model_not_found · job_not_foundModel or job does not exist
413invalid_request_errorRequest body too large (5MB for image edits)
429rate_limit_error / rate_limit_exceededRate limit — retry after the Retry-After header
502api_error / backend_unavailableUpstream 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.