> ## 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.

# Model selection

The `speech_models` parameter lets you specify which model(s) to use for transcription. For new accounts created on or after November 17, 2026, leaving out `speech_models` defaults to `["assemblyai-stt-3-7"]`. For existing accounts, see the [assemblyai-stt-3-7 migration guide](https://assemblyai.com/docs/pre-recorded-audio/assemblyai-stt-3-7-migration-guide.md).

## Available models

> [tab] Python SDK
>
> | Name | Parameter | Description | Best for |
> | - | - | - | - |
> | **AssemblyAI-STT-3.7** Recommended | `speech_models=['assemblyai-stt-3-7']` | Our flagship pre-recorded STT model. 32 languages with native code-switching and contextual prompting. | Highest-accuracy transcription, post-call analytics, meeting notetakers, medical transcription, domain-specific accuracy via prompting |
> | **Universal-2** | `speech_models=['universal-2']` | A multilingual transcription model offering a good balance of speed and cost-effectiveness. | Cost-effective fallback model for language support outside of AssemblyAI-STT-3.7 |

> [tab] JavaScript SDK
>
> | Name | Parameter | Description | Best for |
> | - | - | - | - |
> | **AssemblyAI-STT-3.7** Recommended | `speech_models: ['assemblyai-stt-3-7']` | Our flagship pre-recorded STT model. 32 languages with native code-switching and contextual prompting. | Highest-accuracy transcription, post-call analytics, meeting notetakers, medical transcription, domain-specific accuracy via prompting |
> | **Universal-2** | `speech_models: ['universal-2']` | A multilingual transcription model offering a good balance of speed and cost-effectiveness. | Cost-effective fallback model for language support outside of AssemblyAI-STT-3.7 |

> [tab] API
>
> | Name | API Parameter | Description | Best for |
> | - | - | - | - |
> | **AssemblyAI-STT-3.7** Recommended | `"speech_models": ["assemblyai-stt-3-7"]` | Our flagship pre-recorded STT model. 32 languages with native code-switching and contextual prompting. | Highest-accuracy transcription, post-call analytics, meeting notetakers, medical transcription, domain-specific accuracy via prompting |
> | **Universal-2** | `"speech_models":["universal-2"]` | A multilingual transcription model offering a good balance of speed and cost-effectiveness. | Cost-effective fallback model for language support outside of AssemblyAI-STT-3.7 |

> [!WARNING]
>
> Universal-3.5 Pro (`universal-3-5-pro`) and Universal-3 Pro (`universal-3-pro`) are deprecated. The retirement date will be announced. After retirement, if no action is taken, your requests to these models will automatically route to `assemblyai-stt-3-7`. See [Model versions and deprecations](https://assemblyai.com/docs/getting-started/model-versions-and-deprecations.md).
>
> If you would like to migrate to the latest model now, see the [`assemblyai-stt-3-7` migration guide](https://assemblyai.com/docs/pre-recorded-audio/assemblyai-stt-3-7-migration-guide).

## Set the model

> [tab] Python
>
> You can change the model by setting the `speech_models` in the POST request body:
>
> ```python highlight={12}  expandable theme={null}
> import requests
> import time
>
> base_url = "https://api.assemblyai.com"
>
> headers = {
>     "authorization": "<YOUR_API_KEY>"
> }
>
> data = {
>     "audio_url": "https://assembly.ai/wildfires.mp3",
>     "speech_models": ["assemblyai-stt-3-7"],
>     "language_detection": True
> }
>
> url = base_url + "/v2/transcript"
> response = requests.post(url, json=data, headers=headers)
>
> transcript_id = response.json()['id']
> polling_endpoint = base_url + "/v2/transcript/" + transcript_id
>
> while True:
>   transcription_result = requests.get(polling_endpoint, headers=headers).json()
>
>   if transcription_result['status'] == 'completed':
>     print(transcription_result['text'])
>     break
>
>   elif transcription_result['status'] == 'error':
>     raise RuntimeError(f"Transcription failed: {transcription_result['error']}")
>
>   else:
>     time.sleep(3)
>
> ```

> [tab] Python SDK
>
> You can change the model by setting `speech_models` in the transcription config:
>
> ```python highlight={7}  theme={null}
> from assemblyai import TranscriptStatus
> from assemblyai.prerecorded.v2 import Transcriber, TranscriptionConfig
>
> audio_file = "https://assembly.ai/wildfires.mp3"
>
> config = TranscriptionConfig(
>     speech_models=["assemblyai-stt-3-7"],
>     language_detection=True
> )
> transcript = Transcriber(api_key="<YOUR_API_KEY>", config=config).transcribe(audio_file)
>
> if transcript.status == TranscriptStatus.error:
>   raise RuntimeError(f"Transcription failed: {transcript.error}")
>
> print(transcript.text)
> ```

> [tab] JavaScript
>
> You can change the model by setting the `speech_models` in the POST request body:
>
> ```javascript highlight={12}  expandable theme={null}
> const baseUrl = "https://api.assemblyai.com";
>
> const headers = {
>   authorization: "<YOUR_API_KEY>",
> };
>
> const data = {
>   audio_url: "https://assembly.ai/wildfires.mp3",
>   speech_models: ["assemblyai-stt-3-7"],
>   language_detection: true,
> };
>
> const url = `${baseUrl}/v2/transcript`;
> let res = await fetch(url, {
>   method: "POST",
>   headers: { ...headers, "Content-Type": "application/json" },
>   body: JSON.stringify(data),
> });
> if (!res.ok) throw new Error(`Error: ${res.status}`);
> const response = await res.json();
>
> const transcriptId = response.id;
> const pollingEndpoint = `${baseUrl}/v2/transcript/${transcriptId}`;
>
> while (true) {
>   res = await fetch(pollingEndpoint, { headers });
>   if (!res.ok) throw new Error(`Error: ${res.status}`);
>   const transcriptionResult = await res.json();
>
>   if (transcriptionResult.status === "completed") {
>     console.log(transcriptionResult.text);
>     break;
>   } else if (transcriptionResult.status === "error") {
>     throw new Error(`Transcription failed: ${transcriptionResult.error}`);
>   } else {
>     await new Promise((resolve) => setTimeout(resolve, 3000));
>   }
> }
> ```

> [tab] JavaScript SDK
>
> You can change the model by setting the `speech_models` in the transcript parameters:
>
> ```javascript highlight={12}  expandable theme={null}
> import { AssemblyAI } from "assemblyai";
>
> const client = new AssemblyAI({
>   apiKey: "<YOUR_API_KEY>",
> });
>
> const audioFile = "https://assembly.ai/wildfires.mp3";
>
> const params = {
>   audio: audioFile,
>   speech_models: ["assemblyai-stt-3-7"],
>   language_detection: true,
> };
>
> const run = async () => {
>   const transcript = await client.transcripts.transcribe(params);
>
>   if (transcript.status === "error") {
>     throw new Error(`Transcription failed: ${transcript.error}`);
>   }
>
>   console.log(transcript.text);
> };
>
> run();
> ```

## Transcribe all 99 languages by combining speech models

When you set `speech_models` to `["assemblyai-stt-3-7"]`, whether AssemblyAI falls back to another model depends on how you set the language:

* **`language_detection: true`**: AssemblyAI always transcribes with AssemblyAI-STT-3.7 and never falls back to another model. To fall back to Universal-2 for detected languages that AssemblyAI-STT-3.7 doesn't support, set `speech_models` to `["assemblyai-stt-3-7", "universal-2"]`.
* **`language_code`**: If you set a language code that AssemblyAI-STT-3.7 doesn't support, AssemblyAI falls back to Universal-2, even if `universal-2` isn't in the list.

### AssemblyAI-STT-3.7 takes priority in the list

If you list multiple models alongside `assemblyai-stt-3-7` via `speech_models`, AssemblyAI uses AssemblyAI-STT-3.7 for every language it supports, regardless of its position in the list. Other models in the list are used only for languages AssemblyAI-STT-3.7 doesn't support. This applies whether you set `language_code` or use `language_detection`.

If `speech_models` is set and doesn't include `assemblyai-stt-3-7`, AssemblyAI uses the first model in the list, from left to right, that supports the language. This behavior hasn't changed.

See [Supported languages](https://assemblyai.com/docs/pre-recorded-audio/supported-languages.md) for the languages each model supports.

## Identify the model used

After transcription completes, you can check which model was actually used to process your request by reading the `speech_model_used` field. This is useful because the model used may differ from the first model in your list. AssemblyAI-STT-3.7 takes priority when it's in the list, and the system may fall back to a different model depending on language support.

> [tab] Python
>
> ```python expandable theme={null}
> import requests
> import time
>
> base_url = "https://api.assemblyai.com"
>
> headers = {
>     "authorization": "<YOUR_API_KEY>"
> }
>
> data = {
>     "audio_url": "https://assembly.ai/wildfires.mp3",
>     "speech_models": ["assemblyai-stt-3-7"],
>     "language_detection": True
> }
>
> url = base_url + "/v2/transcript"
> response = requests.post(url, json=data, headers=headers)
>
> transcript_id = response.json()['id']
> polling_endpoint = base_url + "/v2/transcript/" + transcript_id
>
> while True:
>   transcription_result = requests.get(polling_endpoint, headers=headers).json()
>
>   if transcription_result['status'] == 'completed':
>     print(f"Model used: {transcription_result['speech_model_used']}")
>     print(transcription_result['text'])
>     break
>
>   elif transcription_result['status'] == 'error':
>     raise RuntimeError(f"Transcription failed: {transcription_result['error']}")
>
>   else:
>     time.sleep(3)
> ```

> [tab] Python SDK
>
> ```python theme={null}
> from assemblyai import TranscriptStatus
> from assemblyai.prerecorded.v2 import Transcriber, TranscriptionConfig
>
> audio_file = "https://assembly.ai/wildfires.mp3"
>
> config = TranscriptionConfig(
>     speech_models=["assemblyai-stt-3-7"],
>     language_detection=True
> )
> transcript = Transcriber(api_key="<YOUR_API_KEY>", config=config).transcribe(audio_file)
>
> if transcript.status == TranscriptStatus.error:
>     raise RuntimeError(f"Transcription failed: {transcript.error}")
>
> print(f"Model used: {transcript.json_response['speech_model_used']}")
> print(transcript.text)
> ```

> [tab] JavaScript
>
> ```javascript expandable theme={null}
> const baseUrl = "https://api.assemblyai.com";
>
> const headers = {
>   authorization: "<YOUR_API_KEY>",
> };
>
> const data = {
>   audio_url: "https://assembly.ai/wildfires.mp3",
>   speech_models: ["assemblyai-stt-3-7"],
>   language_detection: true,
> };
>
> const url = `${baseUrl}/v2/transcript`;
> let res = await fetch(url, {
>   method: "POST",
>   headers: { ...headers, "Content-Type": "application/json" },
>   body: JSON.stringify(data),
> });
> if (!res.ok) throw new Error(`Error: ${res.status}`);
> const response = await res.json();
>
> const transcriptId = response.id;
> const pollingEndpoint = `${baseUrl}/v2/transcript/${transcriptId}`;
>
> while (true) {
>   res = await fetch(pollingEndpoint, { headers });
>   if (!res.ok) throw new Error(`Error: ${res.status}`);
>   const transcriptionResult = await res.json();
>
>   if (transcriptionResult.status === "completed") {
>     console.log(`Model used: ${transcriptionResult.speech_model_used}`);
>     console.log(transcriptionResult.text);
>     break;
>   } else if (transcriptionResult.status === "error") {
>     throw new Error(`Transcription failed: ${transcriptionResult.error}`);
>   } else {
>     await new Promise((resolve) => setTimeout(resolve, 3000));
>   }
> }
> ```

> [tab] JavaScript SDK
>
> ```javascript expandable theme={null}
> import { AssemblyAI } from "assemblyai";
>
> const client = new AssemblyAI({
>   apiKey: "<YOUR_API_KEY>",
> });
>
> const audioFile = "https://assembly.ai/wildfires.mp3";
>
> const params = {
>   audio: audioFile,
>   speech_models: ["assemblyai-stt-3-7"],
>   language_detection: true,
> };
>
> const run = async () => {
>   const transcript = await client.transcripts.transcribe(params);
>
>   if (transcript.status === "error") {
>     throw new Error(`Transcription failed: ${transcript.error}`);
>   }
>
>   console.log(`Model used: ${transcript.speech_model_used}`);
>   console.log(transcript.text);
> };
>
> run();
> ```

## Complete example

Here is the full working code that demonstrates model selection with error handling:

> [tab] Python
>
> ```python expandable theme={null}
> import requests
> import time
>
> base_url = "https://api.assemblyai.com"
> headers = {"authorization": "<YOUR_API_KEY>"}
>
> data = {
>     "audio_url": "https://assembly.ai/wildfires.mp3",
>     "speech_models": ["assemblyai-stt-3-7"],
>     "language_detection": True
> }
>
> response = requests.post(base_url + "/v2/transcript", headers=headers, json=data)
>
> if response.status_code != 200:
>     print(f"Error: {response.status_code}, Response: {response.text}")
>     response.raise_for_status()
>
> transcript_json = response.json()
> transcript_id = transcript_json["id"]
> polling_endpoint = f"{base_url}/v2/transcript/{transcript_id}"
>
> while True:
>     transcript = requests.get(polling_endpoint, headers=headers).json()
>     if transcript["status"] == "completed":
>         print(f"Model used: {transcript['speech_model_used']}")
>         print(f"\nTranscript:\n\n{transcript['text']}")
>         break
>     elif transcript["status"] == "error":
>         raise RuntimeError(f"Transcription failed: {transcript['error']}")
>     else:
>         time.sleep(3)
> ```

> [tab] Python SDK
>
> ```python theme={null}
> from assemblyai import TranscriptStatus
> from assemblyai.prerecorded.v2 import Transcriber, TranscriptionConfig
>
> audio_file = "https://assembly.ai/wildfires.mp3"
>
> config = TranscriptionConfig(
>     speech_models=["assemblyai-stt-3-7"],
>     language_detection=True,
> )
>
> transcript = Transcriber(api_key="<YOUR_API_KEY>", config=config).transcribe(audio_file)
>
> if transcript.status == TranscriptStatus.error:
>     raise RuntimeError(f"Transcription failed: {transcript.error}")
>
> print(f"Model used: {transcript.json_response['speech_model_used']}")
> print(f"\nTranscript:\n\n{transcript.text}")
> ```

> [tab] JavaScript
>
> ```javascript expandable theme={null}
> const baseUrl = "https://api.assemblyai.com";
>
> const headers = {
>   authorization: "<YOUR_API_KEY>",
> };
>
> async function transcribe() {
>   const audioFile = "https://assembly.ai/wildfires.mp3";
>
>   const data = {
>     audio_url: audioFile,
>     speech_models: ["assemblyai-stt-3-7"],
>     language_detection: true,
>   };
>
>   let res = await fetch(`${baseUrl}/v2/transcript`, {
>     method: "POST",
>     headers: { ...headers, "Content-Type": "application/json" },
>     body: JSON.stringify(data),
>   });
>   if (!res.ok) throw new Error(`Error: ${res.status}`);
>   const transcriptResponse = await res.json();
>   const transcriptId = transcriptResponse.id;
>   const pollingEndpoint = `${baseUrl}/v2/transcript/${transcriptId}`;
>
>   while (true) {
>     res = await fetch(pollingEndpoint, { headers });
>     if (!res.ok) throw new Error(`Error: ${res.status}`);
>     const transcript = await res.json();
>
>     if (transcript.status === "completed") {
>       console.log(`Model used: ${transcript.speech_model_used}`);
>       console.log(`\nTranscript:\n\n${transcript.text}`);
>       break;
>     } else if (transcript.status === "error") {
>       throw new Error(`Transcription failed: ${transcript.error}`);
>     } else {
>       await new Promise((resolve) => setTimeout(resolve, 3000));
>     }
>   }
> }
>
> transcribe();
> ```

> [tab] JavaScript SDK
>
> ```javascript expandable theme={null}
> import { AssemblyAI } from "assemblyai";
>
> const client = new AssemblyAI({
>   apiKey: "<YOUR_API_KEY>",
> });
>
> const audioFile = "https://assembly.ai/wildfires.mp3";
>
> const params = {
>   audio: audioFile,
>   speech_models: ["assemblyai-stt-3-7"],
>   language_detection: true,
> };
>
> const run = async () => {
>   const transcript = await client.transcripts.transcribe(params);
>
>   if (transcript.status === "error") {
>     throw new Error(`Transcription failed: ${transcript.error}`);
>   }
>
>   console.log(`Model used: ${transcript.speech_model_used}`);
>   console.log(`\nTranscript:\n\n${transcript.text}`);
> };
>
> run();
> ```
