X-Request-Id header, and returns only the information you need to
debug your request.
OpenAI — /v1/chat/completions (and image/video endpoints)
Anthropic — /v1/messages
Gemini — /v1beta/models/{model}:generateContent
Status mapping
The errortype / status is derived from the HTTP status:
| HTTP | OpenAI type | Anthropic type | Gemini status |
|---|---|---|---|
| 400 | invalid_request_error | invalid_request_error | INVALID_ARGUMENT |
| 401 | authentication_error | authentication_error | UNAUTHENTICATED |
| 403 | permission_error | permission_error | PERMISSION_DENIED |
| 404 | not_found_error | not_found_error | NOT_FOUND |
| 402 | insufficient_quota | invalid_request_error | RESOURCE_EXHAUSTED |
| 429 | rate_limit_error | rate_limit_error | RESOURCE_EXHAUSTED |
| 5xx | api_error | api_error / overloaded_error | INTERNAL / UNAVAILABLE |