Errors and rate limits

What each status means, and what actually fixes it.

Errors come back in the OpenAI error envelope, so SDK error handling works unchanged. The message field carries the specific reason; the status tells you whether retrying is worth anything.

Error shape
{
  "error": {
    "message": "insufficient user quota",
    "type": "new_api_error",
    "code": "insufficient_user_quota"
  }
}

Status codes

StatusMeaningWhat to do
401Key missing, malformed, revoked or expiredCheck the Authorization header, then reissue the key
403Key is valid but not allowed this model, or quota is exhaustedCheck the key's model allowlist and the account balance
404No channel serves the requested modelCall GET /v1/models for names this instance actually serves
429A configured rate limit was exceededBack off and retry with jitter
5xxUpstream provider failed or timed outRetry; failover to another channel is automatic where one exists

Retrying

Retry 429 and 5xx with exponential backoff and jitter. Do not retry 401 or 403 — they are decisions about your key, not transient conditions, and hammering them will not change the answer.