Model selection

The speech_models parameter lets you specify which model to use for transcription. You can provide multiple models in priority order, and our system will automatically route to the best available model based on your request.

Model routing behavior: The system attempts to use the models in priority order falling back to the next model when needed. For example, with ["universal-3-pro", "universal-2"], the system will try to use universal-3-pro for languages it supports (English, Spanish, Portuguese, French, German, and Italian), and automatically fall back to Universal for all other languages. This ensures you get the best performing transcription where available while maintaining the widest language coverage.

Identifying the Model Used in Your Request

The API returns a field called speech_model_used that tells you which specific model was actually used to process your request.

NameParameterDescription
Universal-3-Prospeech_models=['universal-3-pro']Our highest accuracy model with fine-tuning support and customization via prompting.
Universal-2speech_models=['universal-2']Our highly accurate, fastest performing model with support across 99 languages.

You can change the model by setting speech_models in the transcription config:

1import assemblyai as aai
2
3aai.settings.api_key = "<YOUR_API_KEY>"
4# You can use a local filepath:
5# audio_file = "./local_file.mp3"
6
7# Or use a publicly-accessible URL:
8audio_file = "https://assembly.ai/wildfires.mp3"
9
10config = aai.TranscriptionConfig(
11 speech_models=["universal-3-pro", "universal-2"],
12 language_detection=True
13)
14transcript = aai.Transcriber(config=config).transcribe(audio_file)
15
16if transcript.status == "error":
17 raise RuntimeError(f"Transcription failed: {transcript.error}")
18
19print(transcript.text)