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": "No avatar with id 'avt_doesnotexist' was found.",
"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.
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.
409conflictsession_endedThe session has already ended. Create a new one.
409conflictstream_not_connectedNo browser is attached to this session’s WebSocket yet. Wait for session.ready.
422invalid_requestinvalid_bodyThe request body is missing or not valid JSON.
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_requestmode_not_availableThe requested mode isn’t available for this avatar.
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.
429rate_limitconcurrency_capYou’re at your key’s concurrent-session limit.
429rate_limitplatform_busyThe platform is at global capacity. Retry shortly.
500serverinternal_errorSomething went wrong on our end. Safe to retry with backoff.
502servermuse_error / muse_unreachableThe rendering stack failed or was unreachable.
502serverqwen_bad_responseThe speech backend returned an unusable response.
503servervoices_degraded / files_degradedThat subsystem is temporarily unconfigured or unavailable; the rest of the API still works.

Both 429 responses carry a Retry-After: 10 header. 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.

500 and 502 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.