Skip to main content

HTTP Status Codes

Status CodeDescription
200Request successful
400Invalid request parameters
401Authentication failed - API Key is invalid or missing
403Insufficient permissions - Token does not have access to this model
429Rate limit exceeded
500Internal server error
502Upstream service unavailable
503Service temporarily unavailable

Error Response Format

{
  "error": {
    "message": "Error description",
    "type": "error_type",
    "code": "error_code"
  }
}

Common Errors

401 - Authentication Failed

{
  "error": {
    "message": "Invalid API key",
    "type": "authentication_error",
    "code": "invalid_api_key"
  }
}
Solution: Verify that your API Key is correct and starts with sk-.

429 - Rate Limited

{
  "error": {
    "message": "Rate limit exceeded",
    "type": "rate_limit_error",
    "code": "rate_limit_exceeded"
  }
}
Solution: Reduce your request frequency, or contact support to increase your limit.

403 - Insufficient Balance

{
  "error": {
    "message": "Insufficient quota",
    "type": "insufficient_quota",
    "code": "insufficient_quota"
  }
}
Solution: Visit the top-up page to add funds.

Retry Recommendations

  • For 429 errors, use exponential backoff retry
  • For 500/502/503 errors, wait a few seconds before retrying
  • For 400/401/403 errors, check your request parameters and authentication credentials