Skip to main content
Each chat endpoint returns errors in the same shape as the API standard it is compatible with (OpenAI, Anthropic, or Gemini). Every error response also includes an X-Request-Id header, and returns only the information you need to debug your request.

OpenAI — /v1/chat/completions (and image/video endpoints)

{
  "error": {
    "message": "Insufficient credits",
    "type": "insufficient_quota",
    "code": "insufficient_credits",
    "param": null
  }
}

Anthropic — /v1/messages

{
  "type": "error",
  "error": {
    "type": "authentication_error",
    "message": "Invalid API key"
  }
}

Gemini — /v1beta/models/{model}:generateContent

{
  "error": {
    "code": 400,
    "message": "model is required",
    "status": "INVALID_ARGUMENT"
  }
}

Status mapping

The error type / status is derived from the HTTP status:
HTTPOpenAI typeAnthropic typeGemini status
400invalid_request_errorinvalid_request_errorINVALID_ARGUMENT
401authentication_errorauthentication_errorUNAUTHENTICATED
403permission_errorpermission_errorPERMISSION_DENIED
404not_found_errornot_found_errorNOT_FOUND
402insufficient_quotainvalid_request_errorRESOURCE_EXHAUSTED
429rate_limit_errorrate_limit_errorRESOURCE_EXHAUSTED
5xxapi_errorapi_error / overloaded_errorINTERNAL / UNAVAILABLE