Skip to main content

Documentation Index

Fetch the complete documentation index at: https://assemblyai.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

After you’ve submitted a file for transcription, your transcript has one of the following statuses:
StatusDescription
processingThe audio file is being processed.
queuedThe audio file is waiting to be processed. This status is only returned when a job is actually queued, such as when you’ve exceeded your concurrency limit. Otherwise, transcripts go directly to processing.
completedThe transcription has completed successfully.
errorAn error occurred while processing the audio file.

Handling errors

If the transcription fails, the status of the transcript is error, and the transcript includes an error property explaining what went wrong.
import assemblyai as aai

aai.settings.api_key = "<YOUR_API_KEY>"

# audio_file = "./local_file.mp3"
audio_file = "https://assembly.ai/wildfires.mp3"

config = aai.TranscriptionConfig(
  speech_models=["universal-3-pro", "universal-2"],
  language_detection=True
)

transcript = aai.Transcriber().transcribe(audio_file, config)

if transcript.status == aai.TranscriptStatus.error:
    print(f"Transcription failed: {transcript.error}")
    exit(1)

print(transcript.text)
A transcription may fail for various reasons:
  • Unsupported file format
  • Missing audio in file
  • Unreachable audio URL
If a transcription fails due to a server error, we recommend that you resubmit the file for transcription to allow another server to process the audio.
A “400 Bad Request” error typically indicates that there’s a problem with the formatting or content of the API request. Double-check the syntax of your request and ensure that all required parameters are included as described in the API reference. If the issue persists, contact our support team for assistance.