Select the Speech Model

We use a combination of models to produce your results. With the optional speech_models parameter, you can list multiple speech models in priority order, allowing our system to automatically route your audio to the best available option. You can visit our pricing page for more information on our model tiers.

Model routing behavior: The system uses the priority order to determine which model to use based on the request characteristics. For example, with ["slam-1", "universal"], the system will try to use Slam-1 first, but fall back to Universal for non-English audio since Slam-1 only supports English.

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 (default)speech_models=['universal]Use our fastest, most robust models with the broadest language support.
Slam-1 (beta)speech_models=['slam-1]Use our most customizable model for your transcription (English only).

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
10# Excluding the `speech_models` parameter defaults to the Universal model.
11transcript = aai.Transcriber().transcribe(audio_file)
12
13# To specify a different model or multiple models, comment out line 11 and uncomment the following two lines to set the `speech_models` parameter.
14#config = aai.TranscriptionConfig(speech_models=["slam-1", "universal"])
15#transcript = aai.Transcriber(config=config).transcribe(audio_file)
16
17if transcript.status == "error":
18 raise RuntimeError(f"Transcription failed: {transcript.error}")
19
20print(transcript.text)