Error Codes

Error formats and codes returned by the API.

Error Format

Errors follow the format of the API you're using. OpenAI endpoints return OpenAI-format errors, and Anthropic endpoints return Anthropic-format errors.

OpenAI Format

OpenAI Error
{
  "error": {
    "message": "Invalid API key provided.",
    "type": "authentication_error",
    "code": "authentication_error"
  }
}

Anthropic Format

Anthropic Error
{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "Invalid API key provided. Please check your x-api-key header."
  }
}

OpenAI Error Codes

StatusTypeDescription
400invalid_request_errorThe request was malformed or contained invalid parameters.
401authentication_errorInvalid or missing API key.
403authentication_errorAccount suspended, expired, or model access denied.
404not_foundThe requested endpoint or model does not exist.
429rate_limit_errorRate limit exceeded. Check your plan limits and slow down.
500service_errorAn internal error occurred. Try again later.
503service_errorThe service is temporarily unavailable.

Anthropic Error Codes

StatusTypeDescription
400invalid_request_errorThe request was malformed or contained invalid parameters.
401authentication_errorInvalid or missing API key.
403permission_errorAccount suspended, expired, or model access denied.
404not_found_errorThe requested endpoint or model does not exist.
429rate_limit_errorRate limit exceeded. Slow down and retry.
500api_errorAn internal error occurred. Try again later.
529overloaded_errorThe API is temporarily overloaded. Try again later.
Tip
When you receive a 429 error, check the Retry-After header for the recommended wait time. Rate limits reset on a sliding window basis.