Skip to main content
Most errors return a JSON body with an error message and a machine-readable error_code:
Errors relayed from the transcription service use a different shape, with status, title, and detail fields. Read both when surfacing an error:

Status codes

An invalid API key returns 404, not 401. Treat any 404 from this endpoint as an auth failure rather than a missing route.

A failed rewrite is not a failed request

The transcript rewrite is best-effort and is never allowed to fail the call. If the rewrite fails, the response is still 200, text still holds the verbatim transcript, llm_response is null, and llm_error says what went wrong: Fall back to text when llm_response is null. Never treat a non-null llm_error as a failed request. In the Python SDK, result.final_text already does this: it returns the rewrite when there is one and the transcript otherwise.

Errors in the Python SDK

A failed request raises DictationError, which carries the pieces you need to decide what to do next:
retry_after is None when the response carried no Retry-After header, so fall back to your own backoff rather than assuming a value is present.

Retry guidance

  • 429, 502, 503, and 504 are transient. Back off and retry.
  • 400, 413, and 415 mean the request itself is wrong. Fix the audio or the config before retrying. See Audio requirements for the constraints.
  • 401 and 404 are credential problems. Retrying will not help.
A chunked upload cannot be replayed, so keep the audio in memory if you want to retry a failed request. Set the HTTP client timeout to 90 seconds; typical short clips respond in under a second.

Need help?

If you get stuck, contact our support team at support@assemblyai.com or create a support ticket. Include the session_id from the response, or the failing request’s timestamp and endpoint if no response was returned, to help us look up your request.