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

# Universal-3.5 Pro

> Set up and configure Universal-3.5 Pro for pre-recorded audio transcription.

export const AudioPlayer = ({src, type = "audio/mpeg", fallbackText = "Your browser does not support the audio element."}) => {
  return <audio controls style={{
    width: "100%"
  }}>
      <source src={src} type={type} />
      {fallbackText} <a href={src}>Download the audio</a>.
    </audio>;
};

Universal-3.5 Pro is our latest Voice AI model. It delivers:

* State-of-the-art transcription accuracy across [18 languages](/docs/pre-recorded-audio/universal-3-5-pro#support-for-99-languages)
* Strong performance on accented English and seamless [code-switching](/docs/pre-recorded-audio/universal-3-5-pro#code-switching) between supported languages
* A more intelligent [contextual prompting](/docs/pre-recorded-audio/universal-3-5-pro#contextual-prompting) that reliably follows the context you provide — from a single topic label to a full description of your audio

## Quickstart

Get started with Universal-3.5 Pro using the code below. This example transcribes a pre-recorded audio file and prints the transcript text to your terminal.

<Tabs groupId="language">
  <Tab language="python" title="Python" default>
    <Steps>
      <Step>
        Install the required library

        ```bash theme={null}
        pip install requests
        ```
      </Step>

      <Step>
        Create a new file `main.py` and paste the code below. Replace `<YOUR_API_KEY>` with your API key.
      </Step>

      <Step>
        Run with `python main.py`.
      </Step>
    </Steps>

    ```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/new-approved-medication",
        "language_detection": True,
        "speech_models": ["universal-3-5-pro"]
    }

    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_response = response.json()
    transcript_id = transcript_response["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(transcript["text"])
            break
        elif transcript["status"] == "error":
            raise RuntimeError(f"Transcription failed: {transcript['error']}")
        else:
            time.sleep(3)
    ```
  </Tab>

  <Tab language="python-sdk" title="Python SDK">
    <Steps>
      <Step>
        Install the required library

        ```bash theme={null}
        pip install "assemblyai>=1.0.0"
        ```
      </Step>

      <Step>
        Create a new file `main.py` and paste the code below. Replace `<YOUR_API_KEY>` with your API key.
      </Step>

      <Step>
        Run with `python main.py`.
      </Step>
    </Steps>

    ```python theme={null}
    import assemblyai as aai

    aai.settings.api_key = "<YOUR_API_KEY>"

    audio_file = "https://assembly.ai/new-approved-medication"

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

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

    print(transcript.text)
    ```
  </Tab>

  <Tab language="javascript" title="JavaScript">
    <Steps>
      <Step>
        Create a new file `index.mjs` and paste the code below. Replace `<YOUR_API_KEY>` with your API key.
      </Step>

      <Step>
        Run with `node index.mjs`.
      </Step>
    </Steps>

    ```javascript expandable theme={null}
    const baseUrl = "https://api.assemblyai.com";
    const headers = {
      authorization: "<YOUR_API_KEY>",
    };

    const data = {
      audio_url: "https://assembly.ai/new-approved-medication",
      language_detection: true,
      speech_models: ["universal-3-5-pro"],
    };

    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>

  <Tab language="javascript-sdk" title="JavaScript SDK">
    <Steps>
      <Step>
        Install the required library

        ```bash theme={null}
        npm install assemblyai
        ```
      </Step>

      <Step>
        Create a new file `index.mjs` and paste the code below. Replace `<YOUR_API_KEY>` with your API key.
      </Step>

      <Step>
        Run with `node index.mjs`.
      </Step>
    </Steps>

    ```javascript theme={null}
    import { AssemblyAI } from "assemblyai";

    const client = new AssemblyAI({
      apiKey: "<YOUR_API_KEY>",
    });

    const audioFile = "https://assembly.ai/new-approved-medication";

    const params = {
      audio: audioFile,
      speech_models: ["universal-3-5-pro"],
      language_detection: true,
    };

    const run = async () => {
      const transcript = await client.transcripts.transcribe(params);
      console.log(transcript.text);
    };

    run();
    ```
  </Tab>
</Tabs>

## Code switching

Universal-3.5 Pro natively handles code switching across 18 languages — *no prompt configuration needed*. When speakers shift mid-sentence between languages like English and Spanish, French, Hindi or Mandarin, the model follows seamlessly, preserving exactly what was said without translating everything into a single language.

See Universal-3.5 Pro code switching in action.

### **English \<> French**

<AudioPlayer src="https://assembly.ai/code-switching-1" type="audio/wav" />

```txt theme={null}
I said something like, j'ai dit à mes étudiants que it's time to really pay attention to what the idea of code-switching is.
```

### **English \<> Hindi**

<AudioPlayer src="https://assembly.ai/code-switching-2" type="audio/wav" />

```txt theme={null}
मेरा रुकने का तो बहुत मन है, but I have an exam to give tomorrow.
```

### **English \<> Mandarin**

<AudioPlayer src="https://assembly.ai/code-switching-3" type="audio/wav" />

```txt theme={null}
But this sentence, 我父母不工作了, you can see the 了 at the end of the sentence indicates that the situation now, my parents don't work, is different from what it was before.
```

## Contextual prompting

Universal-3.5 Pro is highly accurate out of the box, but for challenging audio like short clips with limited context, noisy environments, or audio with very niche references, providing a brief description in the `prompt` parameter can meaningfully improve accuracy.

For example, this is a 2-second clip from a League of Legends pro interview:

<AudioPlayer src="https://assembly.ai/prompt-8" type="audio/wav" />

Without prompt:

```txt theme={null}
And so look who I've been a dear.
```

With prompt:

```txt theme={null}
In solo queue, I ban Azir.
```

<Tabs groupId="language">
  <Tab language="python" title="Python" default>
    ```python {11} expandable theme={null}
    import requests
    import time

    base_url = "https://api.assemblyai.com"
    headers = {"authorization": "<YOUR_API_KEY>"}

    data = {
        "audio_url": "https://assembly.ai/prompt-8",
        "language_detection": True,
        "speech_models": ["universal-3-5-pro"],
        "prompt": "League of Legend roles"
    }

    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_response = response.json()
    transcript_id = transcript_response["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(transcript["text"])
            break
        elif transcript["status"] == "error":
            raise RuntimeError(f"Transcription failed: {transcript['error']}")
        else:
            time.sleep(3)
    ```
  </Tab>

  <Tab language="python-sdk" title="Python SDK">
    ```python {10} expandable theme={null}
    import assemblyai as aai

    aai.settings.api_key = "<YOUR_API_KEY>"

    audio_file = "https://assembly.ai/prompt-8"

    config = aai.TranscriptionConfig(
      speech_models=["universal-3-5-pro"],
      language_detection=True,
      prompt="League of Legend roles",
    )

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

    print(transcript.text)
    ```
  </Tab>

  <Tab language="javascript" title="JavaScript">
    ```javascript {10} expandable theme={null}
    const baseUrl = "https://api.assemblyai.com";
    const headers = {
      authorization: "<YOUR_API_KEY>",
    };

    const data = {
      audio_url: "https://assembly.ai/prompt-8",
      language_detection: true,
      speech_models: ["universal-3-5-pro"],
      prompt: "League of Legend roles",
    };

    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>

  <Tab language="javascript-sdk" title="JavaScript SDK">
    ```javascript {13} expandable theme={null}
    import { AssemblyAI } from "assemblyai";

    const client = new AssemblyAI({
      apiKey: "<YOUR_API_KEY>",
    });

    const audioFile = "https://assembly.ai/prompt-8";

    const params = {
      audio: audioFile,
      speech_models: ["universal-3-5-pro"],
      language_detection: true,
      prompt: "League of Legend roles",
    };

    const run = async () => {
      const transcript = await client.transcripts.transcribe(params);
      console.log(transcript.text);
    };

    run();
    ```
  </Tab>
</Tabs>

### Prompting guide

Contextual prompts work at three levels of specificity. Use the least specific level that covers your use case, and add detail when your audio contains uncommon names or terms the model can't otherwise know.

| Level        | Length      | What it contains                                            | Example                                                                                                                                                     |
| ------------ | ----------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Domain**   | 2–5 words   | The domain only                                             | `Medical consultation call.`                                                                                                                                |
| **Scenario** | 5–15 words  | What the conversation is about                              | `Cardiology consultation about chest pain symptoms.`                                                                                                        |
| **Detailed** | 20–50 words | Full description, including names, products, or identifiers | `Cardiology consultation between Dr. Smith and an elderly patient regarding recurring chest pain, ECG results, and medication adjustment for hypertension.` |

Guidelines for writing contextual prompts:

* Write plain, complete sentences that describe the audio
* Keep it to one short block of text. Don't pack lists of keywords into the contextual prompt

## Keyterms prompting

Universal-3.5 Pro has strong out-of-the-box vocabulary coverage, so in many cases you won't need keyterms prompting at all. But when you're dealing with highly specific names, brands, acronyms, or niche industry jargon, the `keyterms_prompt` parameter gives you an extra layer of control. You can pass up to 1,000 words or phrases (max 6 words per phrase) to boost recognition for those terms and contextually similar variations.

See keyterms prompt in action:

<AudioPlayer src="https://assemblyaiassets.com/audios/keyterms_prompting.wav" type="audio/wav" />

Without keyterms prompting:

```txt theme={null}
Hi, this is Kelly Byrne Donahue
```

With keyterms prompting:

```txt theme={null}
Hi, this is Kelly Byrne-Donoghue
```

<Tabs groupId="language">
  <Tab language="python" title="Python" default>
    ```python {11} expandable theme={null}
    import requests
    import time

    base_url = "https://api.assemblyai.com"
    headers = {"authorization": "<YOUR_API_KEY>"}

    data = {
        "audio_url": "https://assemblyaiassets.com/audios/keyterms_prompting.wav",
        "language_detection": True,
        "speech_models": ["universal-3-5-pro"],
        "keyterms_prompt": ["Kelly Byrne-Donoghue"]
    }

    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_response = response.json()
    transcript_id = transcript_response["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(transcript["text"])
            break
        elif transcript["status"] == "error":
            raise RuntimeError(f"Transcription failed: {transcript['error']}")
        else:
            time.sleep(3)
    ```
  </Tab>

  <Tab language="python-sdk" title="Python SDK">
    ```python {10} theme={null}
    import assemblyai as aai

    aai.settings.api_key = "<YOUR_API_KEY>"

    audio_file = "https://assemblyaiassets.com/audios/keyterms_prompting.wav"

    config = aai.TranscriptionConfig(
      speech_models=["universal-3-5-pro"],
      language_detection=True,
      keyterms_prompt=["Kelly Byrne-Donoghue"],
    )

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

    print(transcript.text)
    ```
  </Tab>

  <Tab language="javascript" title="JavaScript">
    ```javascript {12} expandable theme={null}
    const baseUrl = "https://api.assemblyai.com";
    const headers = {
      authorization: "<YOUR_API_KEY>",
    };

    const data = {
      audio_url: "https://assemblyaiassets.com/audios/keyterms_prompting.wav",
      language_detection: true,
      speech_models: ["universal-3-5-pro"],
      keyterms_prompt: ["Kelly Byrne-Donoghue"],
    };

    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>

  <Tab language="javascript-sdk" title="JavaScript SDK">
    ```javascript {13} expandable theme={null}
    import { AssemblyAI } from "assemblyai";

    const client = new AssemblyAI({
      apiKey: "<YOUR_API_KEY>",
    });

    const audioFile = "https://assemblyaiassets.com/audios/keyterms_prompting.wav";

    const params = {
      audio: audioFile,
      speech_models: ["universal-3-5-pro"],
      language_detection: true,
      keyterms_prompt: ["Kelly Byrne-Donoghue"],
    };

    const run = async () => {
      const transcript = await client.transcripts.transcribe(params);
      console.log(transcript.text);
    };

    run();
    ```
  </Tab>
</Tabs>

## Support for 99 languages

Universal-3.5 Pro supports 18 languages, and for anything outside that set, the system automatically falls back to Universal-2, giving you coverage across 99 languages total without any extra configuration.

| Model               | Supported languages                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `universal-3-5-pro` | Global English, Australian English, British English, US English, Spanish, French, German, Italian, Portuguese, Arabic, Danish, Dutch, Finnish, Hebrew, Hindi, Japanese, Mandarin, Norwegian, Swedish, Turkish, Vietnamese                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| `universal-2`       | Global English, Australian English, British English, US English, Spanish, French, German, Italian, Portuguese, Dutch, Hindi, Japanese, Chinese, Finnish, Korean, Polish, Russian, Turkish, Ukrainian, Vietnamese, Afrikaans, Albanian, Amharic, Arabic, Armenian, Assamese, Azerbaijani, Bashkir, Basque, Belarusian, Bengali, Bosnian, Breton, Bulgarian, Burmese, Catalan, Croatian, Czech, Danish, Estonian, Faroese, Galician, Georgian, Greek, Gujarati, Haitian, Hausa, Hawaiian, Hebrew, Hungarian, Icelandic, Indonesian, Javanese, Kannada, Kazakh, Khmer, Lao, Latin, Latvian, Lingala, Lithuanian, Luxembourgish, Macedonian, Malagasy, Malay, Malayalam, Maltese, Maori, Marathi, Mongolian, Nepali, Norwegian, Norwegian Nynorsk, Occitan, Panjabi, Pashto, Persian, Romanian, Sanskrit, Serbian, Shona, Sindhi, Sinhala, Slovak, Slovenian, Somali, Sundanese, Swahili, Swedish, Swiss German, Tagalog, Tajik, Tamil, Tatar, Telugu, Thai, Tibetan, Turkmen, Urdu, Uzbek, Welsh |
