error message and a machine-readable
error_code:
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 still200, 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 raisesDictationError, 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.
Need help?
If you get stuck, contact our support team at support@assemblyai.com or create a support ticket. Include thesession_id from the response, or the failing request’s timestamp and endpoint
if no response was returned, to help us look up your request.