Docs / Reference
Errors
Every error code Cent AI returns, its HTTP status and where to read more.
Last updated
Shape of an error
Errors use the format of the endpoint you called.
{"error": {"message": "Invalid API key.", "type": "authentication_error", "param": null, "code": "invalid_api_key"}}
In the OpenAI format the code field names the error. In the Anthropic format the error type follows the HTTP status and the message says what happened. Every response, including errors, has an x-request-id header; the same ID is on the Requests page of the dashboard.
Order of checks
Before a request reaches a model, Cent AI checks, in this order: the request body, the key, whether the key's project is archived, whether the endpoint is available, the key's IP and model allowlists, the model name, the rate limit, the key's spending limits, the project budget and the balance. The first check that fails decides the error. Nothing is charged for a request rejected here.
All codes
| Code | HTTP | Meaning |
|---|---|---|
invalid_request | 400 | The request body is not valid |
invalid_api_key | 401 | The key is wrong, revoked, or belongs to a blocked account |
insufficient_balance | 402 | No balance available for this model |
ip_not_allowed | 403 | The request comes from an IP outside the key's allowlist |
model_not_allowed | 403 | The model is outside the key's model allowlist |
project_archived | 403 | The key belongs to an archived project |
model_not_found | 404 | The model does not exist or is not available |
request_too_large | 413 | The body is larger than 32 MiB |
rate_limited | 429 | Over the key's requests per minute |
key_limit_exceeded | 429 | The key reached its daily or monthly limit |
project_budget_exceeded | 429 | The project reached its daily or monthly budget |
not_available_yet | 501 | The endpoint is not open yet |
internal_error | 500 or 503 | An error inside Cent AI |
upstream_unavailable | 503 | The model is temporarily unavailable on every route |
upstream_rate_limited | 503 | The model is rate limited on every route |
upstream_timeout | 503 | The model did not start answering in time, or a stream reached its maximum duration |
upstream_error | The model's status | The model rejected the request, for example an unsupported parameter |
Cent AI never returns HTTP 502 or 504; failures of the model come back as 503 with one of the codes above.
By status
- 4xx errors: problems with the request, the key, the limits or the balance
- 5xx errors: problems with the model or with Cent AI
- Stream timeout: streams that stop or never start
Endpoints that are not open yet
Video, speech, transcription and embeddings endpoints return 501 and are not charged. The image endpoints are open; see Images.
{"error": {"message": "This endpoint is not available yet.", "type": "invalid_request_error", "code": "not_available_yet"}}