Skip to Content
Assistant Core

Developer API errors and limits

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

Error shape

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

{
  "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

CodeHTTPRetryCauseFix
INVALID_API_KEY401NoKey missing, mistyped, truncated, or deleted.Send Authorization: Bearer <key> with the full key.
API_KEY_EXPIRED401NoThe key's expiry or rotation grace period has passed.Use the replacement key.
API_KEY_REVOKED401NoThe key was revoked.Create a new key.
INSUFFICIENT_SCOPE403NoThe key lacks the endpoint's scope (details.required_scope).Create or rotate to a key with that scope.
IP_NOT_ALLOWED403NoThe caller's IP is not in the key's allowlist.Call from an allowed IP or edit the allowlist.
ASSISTANT_INACTIVE403NoThe assistant is deactivated or deleted.Reactivate the assistant.
FEATURE_NOT_AVAILABLE403NoThe owner's plan has the Developer API turned off. Every standard plan has it on, Free included.Contact support.
FILE_UPLOAD_DISABLED403NoFile upload is off for the assistant.The owner turns on File Upload in Behavior → Features in the Admin Panel; otherwise send text only.
VOICE_DISABLED403NoVoice is off for the assistant.Turn on voice; see Enable voice.
ACTOR_CONFLICT409NoThe external_user_id maps to an account that is not an API end user.Use a different external_user_id.
IDEMPOTENCY_CONFLICT409NoThe Idempotency-Key was used with a different body.Use a new key, or resend the original body.
REQUEST_IN_PROGRESS409YesThe same key and body are still running.Wait, then retry with the same key and body.
CONVERSATION_BUSY409YesA background response is still being written in this conversation.Wait for it to end (follow or poll it), then retry.
INSUFFICIENT_CREDITS402NoThe assistant owner is out of credits.The owner adds credits; see Credits.
RATE_LIMITED429YesA rate-limit bucket is full (details.bucket).Wait Retry-After seconds.
CONVERSATION_NOT_FOUND404NoThe conversation does not exist or belongs to another end user or assistant.Check the ID and external_user_id.
MESSAGE_NOT_FOUND404NoThe message is not this end user's.Check the ID and external_user_id.
FILE_NOT_FOUND404NoA file_ids entry was not uploaded by this end user (details.file_id).Upload the file for the same end user.
RESPONSE_NOT_FOUND404NoUnknown 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_CURSOR400Noafter is not a message of this conversation.Pass last_id from the previous page.
MODEL_NOT_FOUND400Nomodel is not an active chat model (details.model).Fix the code or omit model.
CONTEXT_TOO_LARGE400NoThe conversation is too long for the model.Start a new conversation.
INVALID_AUDIO_FORMAT400NoReserved. An unsupported audio format in a session request currently returns 422 VALIDATION_ERROR.Use a format from the Voice API.
VALIDATION_ERROR422NoA field is missing, unknown, or out of range (details.errors).Fix the listed fields.
UNSUPPORTED_FILE_TYPE415NoThe extension is not supported, or the content does not match it.Upload a supported type.
FILE_TOO_LARGE413NoOver 10 MiB (images), 25 MiB (documents), or 200 MiB unpacked (details.max_bytes).Upload a smaller file.
UPSTREAM_UNAVAILABLE503YesA model provider failed, or no voice model is configured.Retry with backoff; check the voice models if it persists.
RATE_LIMIT_UNAVAILABLE503YesThe rate limiter is unreachable; the API refuses instead of allowing unlimited calls.Retry with backoff.
DEPENDENCY_UNAVAILABLE503YesAn internal service (such as the cache) is temporarily unreachable.Retry with backoff.
INTERNAL_SERVER_ERROR500YesUnexpected server error.Retry with backoff; report the request_id if it persists.

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).
  • 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

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.

BucketCountsFree planPro planEnterprise plan
requestsEvery /v1 call20 per minute120 per minute600 per minute
chat_responsesPOST /v1/responses5 per minute30 per minute120 per minute
voice_sessionsPOST /v1/voice/sessions2 per minute20 per minute60 per minute
background_responsesBackground responses running at once11040

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:

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
HeaderMeaning
RateLimit-PolicyEach bucket's limit: q calls per w seconds.
RateLimitEach bucket now: r calls left, t seconds until it is full again.
Retry-AfterSeconds 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.

Voice WebSocket errors

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

{
  "type": "error",
  "sequence": 8,
  "error": {
    "code": "INVALID_EVENT_ORDER",
    "message": "Audio frames require input_audio.start",
    "retryable": false
  }
}
CodeClosesCause and fix
INVALID_SESSION_TOKEN1008Token missing, expired, or already used. Create a new session.
API_KEY_REVOKED1008The key that created the session is no longer active.
ASSISTANT_INACTIVE1008The assistant was deactivated or deleted after the session was created.
VOICE_DISABLED1008Voice was turned off for the assistant after the session was created.
CONVERSATION_NOT_FOUND1008session.start named a conversation_id that does not exist or belongs to another end user or assistant.
RATE_LIMITED1008Too many open connections. Retryable: close an idle connection, then reconnect.
INVALID_EVENT_ORDEROnly if firstsession.start was not the first message, audio arrived before input_audio.start, or input_audio.commit was sent with server_vad.
INVALID_EVENTNoInvalid 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_FOUNDNoA 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_AVAILABLENofile_ids or input_file.add in a realtime session.
INVALID_AUDIO_FORMATNoAn audio frame could not be decoded in the session's input format.
RESPONSE_IN_PROGRESSNoNew input while a response is active. Send response.cancel first.
NO_SPEECHNoA turn's audio held no recognizable speech. Its response ends with status: "failed"; keep listening.
EVENT_TOO_LARGE1009A JSON event over 16 KiB.
FRAME_TOO_LARGE1009A binary frame over 256 KiB.
EVENT_RATE_EXCEEDED1008More than 50 events per second.
BYTES_RATE_EXCEEDED1008More than 10 MiB of audio per minute.
INPUT_AUDIO_LIMIT_EXCEEDED1008More than 15 minutes of input audio.
IDLE_TIMEOUT1008Nothing happened for 2 minutes: no client event other than ping, no detected speech, and no response in progress.
SESSION_DURATION_EXCEEDED1008The session reached its maximum length.
INSUFFICIENT_CREDITSRealtime 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_UNAVAILABLESometimes (1011)A speech or model provider failed. Retryable.
CONTEXT_TOO_LARGENoThe conversation is too long for the model. The response ends with status: "failed"; start a new conversation.
INTERNAL_SERVER_ERRORSometimes (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:

CodeMeaning
1000Normal closure by your client, or by the server after the assistant ended the conversation (for example, the user said goodbye).
1008Authentication, 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.
1009A JSON event or binary frame was too large.
1011A 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

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.

Last updated on