Errors
Errors use an OpenAI-shaped envelope with a stable error code.
Shape
Terminal
{
"error": {
"message": "Incorrect API key provided or the key has been revoked.",
"type": "invalid_api_key",
"code": "invalid_api_key"
},
"request_id": "req_..."
}Every response also carries an x-request-id header -- include it when reporting an issue.
Codes
| Code | Status | Meaning |
|---|---|---|
| missing_api_key | 401 | No Authorization header was sent. |
| invalid_api_key | 401 | The key doesn't exist, or has been revoked. |
| forbidden | 403 | The key is valid but lacks a required scope, or a model is blocked by org policy. |
| company_suspended | 403 | The organization's access to inference has been suspended. |
| credit_limit_reached | 429 | The organization's monthly hosted credit quota is exhausted. |
| rate_limit_exceeded | 429 | Too many requests for this key in the current window. |
| concurrency_limit_exceeded | 429 | Too many concurrent hosted generations for the current plan. |
| model_capacity_reached | 429 | The model or a specific deployment is at its configured user or concurrency capacity. |
| model_not_found | 404 | The model slug doesn't exist, or is a draft not yet released. |
| model_not_available | 503 | The model exists but isn't currently serving traffic (deploying or administratively disabled). |
| model_retired | 410 | The model has been retired and no longer accepts generation requests. |
| model_not_allowed_for_plan | 403 | The model requires a higher plan than the organization is on. |
| provider_not_configured | 424 | The BYOK model's provider has no connected key for this org. |
| provider_invalid_credentials | 424 | The connected provider key was rejected -- reconnect it. |
| provider_rate_limit | 429 | The upstream provider itself rate-limited this request. |
| provider_error | 502 | The upstream provider or hosted worker returned an error. |
| invalid_request_error | 400 | The request body failed validation. |
| internal_error | 500 | Something went wrong on our side. |