# Developer API errors and limits

URL: https://docs.assistantcore.com/en/developers/errors-limits

Every Developer API error code with its cause and fix, retry rules, rate limits, and Voice WebSocket close codes.

## Error shape [#error-shape]

Every `/v1` error has the same JSON body, including authentication and validation errors. The SSE `error` event carries the same fields.

```json
{
  "code": "RATE_LIMITED",
  "message": "Rate limit exceeded",
  "details": { "bucket": "chat_responses" },
  "request_id": "3f9a1c0b7d2e",
  "retryable": true
}
```

Branch on `code`, not on `message`. Keep `request_id` (also in the `X-Request-ID` header) for support.

## REST and SSE error codes [#rest-and-sse-error-codes]

| Code | HTTP | Retry | Cause | Fix |
| :--- | :---: | :---: | :--- | :--- |
| `INVALID_API_KEY` | 401 | No | Key missing, mistyped, truncated, or deleted. | Send `Authorization: Bearer <key>` with the full key. |
| `API_KEY_EXPIRED` | 401 | No | The key's expiry or rotation grace period has passed. | Use the replacement key. |
| `API_KEY_REVOKED` | 401 | No | The key was revoked. | Create a new key. |
| `INSUFFICIENT_SCOPE` | 403 | No | The key lacks the endpoint's scope (`details.required_scope`). | Create or rotate to a key with that scope. |
| `IP_NOT_ALLOWED` | 403 | No | The caller's IP is not in the key's allowlist. | Call from an allowed IP or edit the allowlist. |
| `ASSISTANT_INACTIVE` | 403 | No | The assistant is deactivated or deleted. | Reactivate the assistant. |
| `FEATURE_NOT_AVAILABLE` | 403 | No | The owner's plan has the Developer API turned off. Every standard plan has it on, Free included. | Contact support. |
| `FILE_UPLOAD_DISABLED` | 403 | No | File upload is off for the assistant. | The owner turns on **File Upload** in **Behavior → Features** in the Admin Panel; otherwise send text only. |
| `VOICE_DISABLED` | 403 | No | Voice is off for the assistant. | Turn on voice; see [Enable voice](/en/voice/enable-voice). |
| `ACTOR_CONFLICT` | 409 | No | The `external_user_id` maps to an account that is not an API end user. | Use a different `external_user_id`. |
| `IDEMPOTENCY_CONFLICT` | 409 | No | The `Idempotency-Key` was used with a different body. | Use a new key, or resend the original body. |
| `REQUEST_IN_PROGRESS` | 409 | Yes | The same key and body are still running. | Wait, then retry with the same key and body. |
| `CONVERSATION_BUSY` | 409 | Yes | A background response is still being written in this conversation. | Wait for it to end (follow or poll it), then retry. |
| `INSUFFICIENT_CREDITS` | 402 | No | The assistant owner is out of credits. | The owner adds credits; see [Credits](/en/billing/credits). |
| `RATE_LIMITED` | 429 | Yes | A rate-limit bucket is full (`details.bucket`). | Wait `Retry-After` seconds. |
| `CONVERSATION_NOT_FOUND` | 404 | No | The conversation does not exist or belongs to another end user or assistant. | Check the ID and `external_user_id`. |
| `MESSAGE_NOT_FOUND` | 404 | No | The message is not this end user's. | Check the ID and `external_user_id`. |
| `FILE_NOT_FOUND` | 404 | No | A `file_ids` entry was not uploaded by this end user (`details.file_id`). | Upload the file for the same end user. |
| `RESPONSE_NOT_FOUND` | 404 | No | Unknown ID, another end user's response, or a non-background response that has not finished (also from cancel). | Check the ID; retry after the stream ends. |
| `INVALID_CURSOR` | 400 | No | `after` is not a message of this conversation. | Pass `last_id` from the previous page. |
| `MODEL_NOT_FOUND` | 400 | No | `model` is not an active chat model (`details.model`). | Fix the code or omit `model`. |
| `CONTEXT_TOO_LARGE` | 400 | No | The conversation is too long for the model. | Start a new conversation. |
| `INVALID_AUDIO_FORMAT` | 400 | No | Reserved. An unsupported audio format in a session request currently returns `422 VALIDATION_ERROR`. | Use a format from the [Voice API](/en/developers/voice-api). |
| `VALIDATION_ERROR` | 422 | No | A field is missing, unknown, or out of range (`details.errors`). | Fix the listed fields. |
| `UNSUPPORTED_FILE_TYPE` | 415 | No | The extension is not supported, or the content does not match it. | Upload a supported type. |
| `FILE_TOO_LARGE` | 413 | No | Over 10 MiB (images), 25 MiB (documents), or 200 MiB unpacked (`details.max_bytes`). | Upload a smaller file. |
| `UPSTREAM_UNAVAILABLE` | 503 | Yes | A model provider failed, or no voice model is configured. | Retry with backoff; check the voice models if it persists. |
| `RATE_LIMIT_UNAVAILABLE` | 503 | Yes | The rate limiter is unreachable; the API refuses instead of allowing unlimited calls. | Retry with backoff. |
| `DEPENDENCY_UNAVAILABLE` | 503 | Yes | An internal service (such as the cache) is temporarily unreachable. | Retry with backoff. |
| `INTERNAL_SERVER_ERROR` | 500 | Yes | Unexpected server error. | Retry with backoff; report the `request_id` if it persists. |

## Retries [#retries]

- Retry only when `retryable` is `true`. Use exponential backoff with jitter and a maximum number of attempts.
- For `POST /v1/responses`, reuse the same `Idempotency-Key` and body when you retry the same operation. A completed request, or a background request that has started, is then replayed instead of run twice (see [Chat API](/en/developers/chat-api)).
- `DELETE /v1/users/{external_user_id}` and `POST /v1/responses/{response_id}/cancel` are safe to repeat.
- Retries count against the rate limits.

## Rate limits [#rate-limits]

Limits apply per assistant and are shared by all its keys, so more keys do not add capacity. A full budget can be spent in a burst; after that, calls come back evenly through the minute (one every half second at 120 per minute), with no window boundary to wait for.

| Bucket | Counts | Free plan | Pro plan | Enterprise plan |
| :--- | :--- | :--- | :--- | :--- |
| `requests` | Every `/v1` call | 20 per minute | 120 per minute | 600 per minute |
| `chat_responses` | `POST /v1/responses` | 5 per minute | 30 per minute | 120 per minute |
| `voice_sessions` | `POST /v1/voice/sessions` | 2 per minute | 20 per minute | 60 per minute |
| `background_responses` | [Background responses](/en/developers/chat-api#background-responses) running at once | 1 | 10 | 40 |

A chat or voice-session call counts against both `requests` and its own bucket. `background_responses` counts responses still running, not calls: its `429` has no `Retry-After`, so retry when one of them ends.

Responses carry every bucket the call counted against, in the IETF `RateLimit-Policy` and `RateLimit` fields:

```http
RateLimit-Policy: "requests";q=120;w=60, "chat_responses";q=30;w=60
RateLimit: "requests";r=119;t=1, "chat_responses";r=29;t=2
```

| Header | Meaning |
| :--- | :--- |
| `RateLimit-Policy` | Each bucket's limit: `q` calls per `w` seconds. |
| `RateLimit` | Each bucket now: `r` calls left, `t` seconds until it is full again. |
| `Retry-After` | Seconds to wait, sent with `429 RATE_LIMITED`. A `429` carries only the full bucket, also named in `details.bucket`. |

Read the headers instead of hard-coding the numbers. Voice WebSocket limits are listed in [Voice API](/en/developers/voice-api#connection-limits).

## Voice WebSocket errors [#voice-websocket-errors]

The WebSocket sends errors as an event, then may close the connection:

```json
{
  "type": "error",
  "sequence": 8,
  "error": {
    "code": "INVALID_EVENT_ORDER",
    "message": "Audio frames require input_audio.start",
    "retryable": false
  }
}
```

| Code | Closes | Cause and fix |
| :--- | :---: | :--- |
| `INVALID_SESSION_TOKEN` | `1008` | Token missing, expired, or already used. Create a new session. |
| `API_KEY_REVOKED` | `1008` | The key that created the session is no longer active. |
| `ASSISTANT_INACTIVE` | `1008` | The assistant was deactivated or deleted after the session was created. |
| `VOICE_DISABLED` | `1008` | Voice was turned off for the assistant after the session was created. |
| `CONVERSATION_NOT_FOUND` | `1008` | `session.start` named a `conversation_id` that does not exist or belongs to another end user or assistant. |
| `RATE_LIMITED` | `1008` | Too many open connections. Retryable: close an idle connection, then reconnect. |
| `INVALID_EVENT_ORDER` | Only if first | `session.start` was not the first message, audio arrived before `input_audio.start`, or `input_audio.commit` was sent with `server_vad`. |
| `INVALID_EVENT` | No | Invalid JSON, missing `type`, unknown event type, empty text without `file_ids`, empty or malformed `file_ids`, more than 10 files for one turn (held and typed together), or empty audio. |
| `FILE_NOT_FOUND` | No | A `file_ids` entry of `input_text.create` or `input_file.add` was not uploaded by this end user. No response starts and nothing is held. A held file deleted before its turn fails that turn and is dropped. |
| `FEATURE_NOT_AVAILABLE` | No | `file_ids` or `input_file.add` in a `realtime` session. |
| `INVALID_AUDIO_FORMAT` | No | An audio frame could not be decoded in the session's input format. |
| `RESPONSE_IN_PROGRESS` | No | New input while a response is active. Send `response.cancel` first. |
| `NO_SPEECH` | No | A turn's audio held no recognizable speech. Its response ends with `status: "failed"`; keep listening. |
| `EVENT_TOO_LARGE` | `1009` | A JSON event over 16 KiB. |
| `FRAME_TOO_LARGE` | `1009` | A binary frame over 256 KiB. |
| `EVENT_RATE_EXCEEDED` | `1008` | More than 50 events per second. |
| `BYTES_RATE_EXCEEDED` | `1008` | More than 10 MiB of audio per minute. |
| `INPUT_AUDIO_LIMIT_EXCEEDED` | `1008` | More than 15 minutes of input audio. |
| `IDLE_TIMEOUT` | `1008` | Nothing happened for 2 minutes: no client event other than `ping`, no detected speech, and no response in progress. |
| `SESSION_DURATION_EXCEEDED` | `1008` | The session reached its maximum length. |
| `INSUFFICIENT_CREDITS` | Realtime only (`1008`) | A realtime session used up the owner's credits. In `standard`, a turn the credits do not cover fails (`response.completed` with `status: "failed"`) and the session stays open. |
| `UPSTREAM_UNAVAILABLE` | Sometimes (`1011`) | A speech or model provider failed. Retryable. |
| `CONTEXT_TOO_LARGE` | No | The conversation is too long for the model. The response ends with `status: "failed"`; start a new conversation. |
| `INTERNAL_SERVER_ERROR` | Sometimes (`1011`) | The assistant failed unexpectedly. The response ends with `status: "failed"`. Before the session starts it closes with `1011`: reconnect with backoff, and create a new session if the token is rejected. Retryable. |

Close codes:

| Code | Meaning |
| :---: | :--- |
| `1000` | Normal closure by your client, or by the server after the assistant ended the conversation (for example, the user said goodbye). |
| `1008` | Authentication, origin, event order, or limit problem. A `1008` close comes without an error event only when the first message cannot be read or the browser origin is not listed. |
| `1009` | A JSON event or binary frame was too large. |
| `1011` | A provider or server failure. |

A token works once: never reconnect with the same one. For retryable failures, ask your backend for a new session. For `1008`, fix the key, origin, event order, or limit first.

## Contact support [#contact-support]

Send the endpoint, time, HTTP status or close code, `request_id`, `session_id`, and the key's public prefix (the part after `ac_` up to the next `_`). Never send the full API key, a session token, raw audio, or personal data you do not need to share.