> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cerasai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](https://console.cerasai.cloud/logs) or share with support.

## Error format

### OpenAI-compatible endpoints (`/v1/chat/completions`, `/v1/models`)

```json OpenAI error format theme={"system"}
{
  "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`)

```json Anthropic error format theme={"system"}
{
  "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 Keys](https://console.cerasai.cloud/keys) and confirm `Authorization: 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](https://console.cerasai.cloud/billing) / [Limits](https://console.cerasai.cloud/limits). |
| `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](https://console.cerasai.cloud/settings), or contact support if suspended. |
| `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](https://docs.cerasai.com/models/catalog.md) 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](https://console.cerasai.cloud/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`, and `503` using exponential backoff (for example `1s`, `2s`, `4s`) with random jitter; honor `Retry-After` when present.
* **Do not retry** `400`, `401`, `402`, `403`, or `404` without fixing the request, API key, balance/spend limit, IP allowlist, or model ID first.
* Always record the `x-request-id` response header in application logs when debugging failed calls.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.