Select the speech model with Best and Nano

We use a combination of models to produce your results. You can select the class of models to use in order to make cost-performance tradeoffs best suited for your application. You can visit our pricing page for more information on our model tiers.

| Name | SDK Parameter | Description | | --- | --- | --- | | Best (default) | aai.SpeechModel.best | Use our most accurate and capable models with the best results, recommended for most use cases. | | Nano | aai.SpeechModel.nano | Use our less accurate, but much lower cost models to produce your results. |


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

1import assemblyai as aai
2
3aai.settings.api_key = "<YOUR_API_KEY>"
4
5# audio_file = "./local_file.mp3"
6audio_file = "https://assembly.ai/wildfires.mp3"
7
8
9config = aai.TranscriptionConfig(speech_model=aai.SpeechModel.nano)
10
11transcript = aai.Transcriber(config=config).transcribe(audio_file)
12
13if transcript.status == "error":
14 raise RuntimeError(f"Transcription failed: {transcript.error}")
15
16print(transcript.text)

For a list of the supported languages for each model, see Supported languages.