Getting Started
Errors
HTTP status codes, error response schemas, and retry guidance for the CerasAI API.
CerasAI returns standard HTTP status codes alongside a structured JSON error payload. Every response includes an x-request-id UUID v4 header that you can match in Logs
Error format
OpenAI-compatible endpoints (/v1/chat/completions, /v1/models)
OpenAI error format
{
"error" : {
"message" : "Model 'invalid-model' is not available in the active catalog." ,
"type" : "invalid_request_error" ,
"code" : "model_not_found"
}
}
{
"error": {
"message": "Model 'invalid-model' is not available in the active catalog.",
"type": "invalid_request_error",
"code": "model_not_found"
}
}Anthropic-compatible endpoint (/v1/messages)
Anthropic error format
{
"type" : "error" ,
"error" : {
"type" : "not_found_error" ,
"message" : "Model 'invalid-model' is not available in the active catalog."
},
"request_id" : "550e8400-e29b-41d4-a716-446655440000"
}
{
"type": "error",
"error": {
"type": "not_found_error",
"message": "Model 'invalid-model' is not available in the active catalog."
},
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}Status codes
| Status | OpenAI type / code | Cause | Recommended action |
|---|---|---|---|
400 | invalid_request_error or provider error | Malformed JSON, missing model, invalid parameters, or a feature the model’s route does not support. | Inspect error.message and fix the request payload before retrying. |
401 | authentication_error (missing_api_key, invalid_api_key, expired_api_key) | Missing, revoked, expired, or invalid CERASAI_API_KEY. | Verify your key in API KeysAuthorization: Bearer <key> or x-api-key: <key>. |
402 | billing_error (insufficient_balance, monthly_limit_exceeded) | Workspace credit balance is $0.00 or below, or monthly spend limit has been reached. | Add credits or raise your monthly spend limit on Billing |
403 | invalid_request_error (ip_not_allowed, relayed_model_disabled, account_suspended) (Anthropic: permission_error) | Caller IP is not in the workspace IP allowlist, relayed models are disabled in workspace privacy settings, or the workspace owner’s account is suspended. | Update your IP allowlist or data settings in Settings |
404 | invalid_request_error (model_not_found, workspace_not_found) (Anthropic: not_found_error) | Requested model ID is not in the active catalog. | Check exact case-sensitive Model IDs on Model Catalog or GET /v1/models. |
429 | rate_limit_error (rate_limit_exceeded) | Per-minute RPM, ITPM, or OTPM budget reached. Includes a Retry-After header (seconds). | Wait at least Retry-After seconds, retry with exponential backoff and jitter, and review quotas on Limits |
499 | invalid_request_error (client_canceled) | Client disconnected or aborted the stream before completion. | Expected when cancelling a request; partial output tokens generated before disconnect are settled. |
502 / 503 | invalid_request_error (upstream_error, upstream_unreachable, provider_not_configured, backend_unreachable) (Anthropic: api_error) | Temporary upstream interruption, unconfigured route, or gateway connectivity error. | Retry 502/503 transient errors with exponential backoff. |
Retry strategy
- Retry on
429,502, and503using exponential backoff (for example1s,2s,4s) with random jitter; honorRetry-Afterwhen present. - Do not retry
400,401,402,403, or404without fixing the request, API key, balance/spend limit, IP allowlist, or model ID first. - Always record the
x-request-idresponse header in application logs when debugging failed calls.

