Docs

Errors

Every error from /v1/* uses the same envelope as the OpenAI API, so existing error-handling code keeps working unchanged.

Error shape
{
  "error": {
    "message": "string, human-readable",
    "type": "invalid_request_error",
    "param": "model" // or null,
    "code": "model_not_found" // or null
  }
}

Error types

TypeHTTP statusMeaning
invalid_request_error400Malformed JSON, or a required parameter is missing (e.g. model, messages).
authentication_error401Missing, malformed, or invalid API key.
not_found_error404The model id doesn't exist, or the route itself doesn't exist.
rate_limit_error429A per-minute, per-day, or per-model limit was reached — see Rate Limits. Also used when the upstream provider itself is rate limiting us.
api_error502 / 503The model is temporarily unavailable, or the upstream provider returned an error or an empty response.

Common cases

Unknown model

404 Not Found
{
  "error": {
    "message": "The model 'gpt-4' does not exist or you do not have access to it.",
    "type": "not_found_error",
    "param": "model",
    "code": "model_not_found"
  }
}

Missing a required field

400 Bad Request
{
  "error": {
    "message": "you must provide a 'messages' parameter",
    "type": "invalid_request_error",
    "param": "messages",
    "code": null
  }
}

Retrying