Error codes
Every error has the same shape, compatible with the OpenAI SDKs. Always log the request_id; it’s also in the x-request-id header.
json
{
"error": {
"type": "invalid_request_error",
"code": "deployment_not_found",
"message": "No deployment named 'contract-reveiw' in this organization.",
"request_id": "req_01a1843c3ca17daf8cc7837ff89e46b3"
}
}Inference API codes
| Code | HTTP | Meaning | What to do |
|---|---|---|---|
invalid_api_key | 401 | The key is missing, malformed or unknown. | Check the Authorization header and the key value. |
key_revoked | 401 | The key was revoked. | Create a new key. |
key_expired | 401 | The key passed its expiry date. | Create a new key. |
deployment_not_found | 404 | No deployment with that alias in your organization. | Check the model value against your deployment aliases. |
deployment_paused | 409 | The deployment is paused. | Resume it in the console. |
deployment_not_allowed_for_key | 403 | The key is limited to other deployments or another client. | Use a key allowed for this deployment. |
unsupported_parameter | 400 | The request uses a field Basevex doesn’t support yet. | Remove the field; see the Inference API reference. |
context_length_exceeded | 400 | Input plus max_tokens exceeds the model’s context length. | Shorten the input or lower max_tokens. |
rate_limited | 429 | Too many requests for this deployment or organization. | Retry with exponential backoff. |
spend_cap_reached | 402 | The request could push spend over your monthly cap. | Raise the cap or wait for the next month. |
subscription_inactive | 402 | Your subscription isn’t active (for example, a failed payment). | Update your payment method in Billing. |
org_suspended | 403 | The organization is suspended. | Contact support. |
ip_not_allowed | 403 | The API key has an IP allowlist that doesn’t include your address. | Call from an allowed address or update the key’s allowlist. |
runtime_unavailable | 503 | Inference capacity is temporarily unavailable. | Retry with backoff. |
runtime_timeout | 504 | The model took too long to respond. | Retry, or lower max_tokens. |
internal_error | 500 | An unexpected error on our side. | Retry; contact support with the request_id if it persists. |
Retrying
Retry 429, 500, 503 and 504 with exponential backoff and jitter. Don’t retry 4xx errors other than 429 without changing the request.