Error codes
Errors use the OpenAI shape, plus the gateway's request id:
{
"error": {
"message": "RPM limit exceeded for key (limit 60/min)",
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"request_id": "req_6f1c0d9a2b7e4c3f8a5d1e0b"
}
}
type mapping: 401 → authentication_error, 403 → permission_error, 429 → rate_limit_error, ≥ 500 → api_error, else invalid_request_error.
| Code | HTTP | When |
|---|---|---|
missing_api_key | 401 | No / empty bearer token |
invalid_api_key | 401 | Unknown key hash |
key_revoked | 401 | Revoked |
key_expired | 401 | Expired |
key_inactive | 401 | Non-active status |
key_blocked | 403 | Blocked key |
model_access_denied | 403 | Model not in the key allowlist |
scope_blocked | 403 | User, team, org or app is blocked |
customer_blocked | 403 | Customer is blocked |
guardrail_blocked | 403 | Pre or post guardrail block |
budget_exceeded | 429 | Key, scope, tag, customer or first-class (Budgets page) budget exhausted |
budget_approval_required | 429 | A first-class budget reached a require-approval threshold or limit |
rate_limit_exceeded | 429 | RPM or TPM window exhausted |
invalid_request | 400 | Bad JSON or missing model |
model_not_found | 404 | The model (and its fallbacks) has no deployments configured |
upstream_unavailable | 502 | Every deployment attempt failed, or every deployment of the model and its fallbacks is disabled |
internal_error | 500 | Key context / DB failure |
unhealthy | 503 | Health / readiness probe failure |
Rate-limit messages include the scope: RPM limit exceeded for key (limit N/min), TPM limit exceeded for team (limit N tokens/min). Scopes: key, team, application, customer (chat only).
Budget messages include the entity and spend vs max, for example Budget has been exceeded! Key=<alias> Current cost: X, Max budget: Y.