Skip to content

Errors

Every application-level error — bad requests, auth failures, missing resources, rate limits, upstream failures — is returned as JSON with a non-2xx status code, in one consistent envelope:

{
"error": {
"type": "not_found",
"code": "no_such_avatar",
"message": "Avatar not found or not ready.",
"request_id": "req_5f3a1c9e2b7d"
}
}
FieldDescription
typeBroad error category. Stable, safe to branch on in code.
codeSpecific machine-readable reason within that category. Stable.
messageHuman-readable explanation. Don’t parse this; it can change wording without notice.
request_idUnique ID for this request, also returned as the x-request-id response header. Include it when contacting support.

Branch on the HTTP status code and error.type (and error.code where you need finer granularity), never on the exact text of message.

HTTPerror.typeerror.codeMeaning
401authenticationmissing_keyNo Authorization: Bearer sk_... header was sent.
401authenticationinvalid_keyThe key is unknown or has been revoked.
404not_foundno_such_sessionThe session doesn’t exist, or isn’t yours.
404not_foundno_such_avatarNo such avatar id for your key, or the owner has not exposed it to the API.
404not_foundlivekit_not_enabled_for_avatarThe avatar exists but is not ready on LiveKit, so it can’t be minted.
404not_foundlivekit_profile_not_allowedThe avatar’s LiveKit profile is not allowed for your key.
409conflictsession_endedThe session has already ended. Create a new one.
403permissionverbatim_not_enabledYou asked for "verbatim": true, and this avatar is not enabled for verbatim speech for your account. See Bring your own brain.
409invalid_requestnot_available_on_livekitThe endpoint does not work on LiveKit sessions: /speak, /audio, /interrupt, /token, /waiting_state. The avatar’s own brain and voice reply to turns on lk.chat; to make it say your exact words, create the session with "verbatim": true and send lines on lk.say.
410invalid_requesttransport_retiredYou asked for "transport": "mse-ws". That transport is retired; omit transport or send "livekit".
422invalid_requestinvalid_bodyThe request body is missing or not valid JSON.
422invalid_requestunknown_transporttransport is not a value the gateway knows. Omit it or send "livekit".
422invalid_requestmode_not_availableThe requested mode isn’t available for this avatar.
422invalid_requestinvalid_verbatimverbatim is not true or false, or it was sent with a transport other than livekit.
429rate_limitconcurrency_capYou’re at your key’s concurrent-session limit.
429rate_limitplatform_busyThe platform as a whole is at capacity. Retry shortly.
429rate_limitedlivekit_rate_limitedThe LiveKit session broker is rate limiting. The broker’s Retry-After is passed through (60 seconds if the broker sent none).
500serverinternal_errorSomething went wrong on our end. Safe to retry with backoff.
501invalid_requestvoice_cloning_unavailablePOST /v1/voices is not available. Avatars speak in the voice set in 2wai Studio.
502serverlivekit_broker_unreachable / livekit_broker_error / livekit_broker_invalid_responseThe LiveKit session broker was unreachable, failed, or answered with something unusable. Retry with backoff.
502serverupstream_unavailableAn upstream service the gateway depends on was unavailable. Retry with backoff.
502upstreamgen_unreachable / gen_server_error / gen_unexpected_statusCatalog hydrate (GET /v1/avatars/{owner}/{name}) could not get a usable answer from the avatar catalog. Retry with backoff.
503serverlivekit_not_configuredLiveKit is not configured on the gateway. Retry later; contact support if it persists.
503serververbatim_unavailableThe session service could not grant verbatim speech right now. Retry, or create the session without verbatim.
504upstreamgen_timeoutCatalog hydrate timed out waiting for the avatar catalog. Retry with backoff.

Codes from endpoints not available on LiveKit

Section titled “Codes from endpoints not available on LiveKit”

These belong to endpoints that answer 409 not_available_on_livekit or 501 voice_cloning_unavailable on the current gateway. You should not see them in a LiveKit integration; they are listed so an older log line still makes sense.

HTTPerror.typeerror.codeMeaning
404not_foundno_such_voiceNo such voice id.
404not_foundno_such_fileNo such file id.
404not_foundno_such_waiting_stateThe named waiting state isn’t configured for this avatar.
409conflictstream_not_connectedRetired transport only: no client was attached to the session’s stream yet.
422invalid_requestempty_texttext was empty.
422invalid_requestempty_audioThe audio chunk contained no samples.
422invalid_requestchunk_too_largeThe audio chunk exceeded the per-chunk limit.
422invalid_requestfile_too_largeThe uploaded file exceeded the size limit.
422invalid_requestmissing_nameA required name was not supplied.
422invalid_requestmissing_sourceNeither a file_id nor a url was supplied.
422invalid_requestvoice_too_quietThe reference audio’s level was too low to clone from.
422invalid_requestvoice_unprocessableThe reference audio couldn’t be decoded or processed.
502servermuse_error / muse_unreachableThe rendering stack failed or was unreachable.
503servervoices_degraded / files_degradedThat subsystem is temporarily unconfigured or unavailable.

Every 429 carries a Retry-After header (10 seconds for concurrency_cap and platform_busy; for livekit_rate_limited it is whatever the LiveKit broker sent, or 60). Honour it rather than retrying immediately: retrying in a tight loop will keep you capped.

  • concurrency_cap: you’re at your own limit. End a session you no longer need, or wait for one to finish.
  • platform_busy: the platform as a whole is saturated. Back off and retry.
  • livekit_rate_limited: the LiveKit broker is throttling session creation. Back off for Retry-After.

500, 502 and 504 are safe to retry with exponential backoff. 503 means a subsystem is degraded; retry, but expect it to persist until the subsystem is restored. 4xx responses other than 429 will not succeed on retry: fix the request.