This demo was recorded on Universal-3.5 Pro. For the current model, see the AssemblyAI-STT-3.7 launch post.
People don't stick to one language per conversation, and the words that matter most are often the ones a general model has never heard. This post looks at two capabilities of AssemblyAI-STT-3.7, AssemblyAI's flagship model for recorded audio, that handle exactly those cases: native code switching across 32 languages, and contextual prompting that steers the transcript with a plain-language description of the audio.
We first published this walkthrough in August 2026 for Universal-3.5 Pro, which supported code switching across 18 languages. Universal-3.5 Pro was deprecated on November 17, 2026, when AssemblyAI-STT-3.7 replaced it. This version covers the new model, with benchmarks and working code. For the launch-day details on the previous model, see the Universal-3.5 Pro async announcement.
What code switching is, and why models get it wrong
Code switching is when a speaker moves between languages within a conversation, or within a single sentence. A bilingual support call, a lecture that quotes a source in its original language, a family conversation that drifts between Hindi and English: all of it is ordinary speech, and much of it is where the important details sit.
Speech-to-text systems fail here in two opposite ways:
- They miss real switches. Some force the whole transcript into one language, writing Catalan as Spanish or Galician as Portuguese.
- They invent switches. Others flip a few words, or a whole sentence, into another language or script even though the speaker never switched. Accented English is the usual victim.
A model has to do both jobs at once: follow every genuine switch, and stay in one language when the speaker does.
Native code switching on AssemblyAI-STT-3.7
AssemblyAI-STT-3.7 handles code switching inside the model, across all 32 of its languages. Set language_detection to true and it follows speakers as they shift mid-sentence, transcribing every word in the language it was spoken, without translating anything into a single language. There's no separate language pass and no flag to turn code switching on.
Here's what that looks like on the three sample clips in the AssemblyAI docs:
- English and French: "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."
- Hindi and English: "मेरा रुकने का तो बहुत मन है, but I have an exam to give tomorrow."
- English and Mandarin: a lecture sentence in English with "我父母不工作了" in the middle, down to the single character 了 the speaker goes on to explain.
You can run the same clips with this request:
import os
from assemblyai.prerecorded.v2 import Transcriber, TranscriptionConfig
config = TranscriptionConfig(
speech_models=["assemblyai-stt-3-7"],
language_detection=True, # code-switch across all 32 languages
)
transcript = Transcriber(api_key=os.environ["ASSEMBLYAI_API_KEY"], config=config).transcribe(
"https://assembly.ai/code-switching-2"
)
if transcript.status == "error":
raise RuntimeError(f"Transcription failed: {transcript.error}")
print(transcript.text)The full scripts are in the companion repo.
Limit switching to the languages you expect
When you know which languages a file contains, pass language_codes. AssemblyAI-STT-3.7 then code-switches only among the languages you list, and English isn't required:
config = TranscriptionConfig(
speech_models=["assemblyai-stt-3-7"],
language_codes=["en", "hi"], # English and Hindi only
)A one-element list such as ["es"] pins the file to one language. language_codes can't be combined with language_code or language_detection. The code switching docs cover the edge cases, and identifying languages in audio with Python covers detection on its own.
Upload a multilingual clip to the playground, with no language flags and no separate detection pass, and see each word come back in the language it was spoken.
How much better is AssemblyAI-STT-3.7 at code switching?
In the AssemblyAI-STT-3.7 research post, AssemblyAI's research team measured AssemblyAI-STT-3.7 against Universal-3.5 Pro on mixed-language audio, by language pair. It's more accurate on six of seven pairs, with the largest gains on English–Italian, English–German and English–Arabic, where errors fell by 16% to 20%. English–French is level.
| Language pair | AssemblyAI-STT-3.7 | Change vs Universal-3.5 Pro |
|---|---|---|
| English–Italian | 3.4% | −20% |
| English–German | 7.7% | −16% |
| English–Arabic | 26.0% | −16% |
| English–French | 7.1% | +3% (level) |
Normalized word error rate on mixed-language audio, mean over each pair's code-switching datasets, lower is better. The change column is relative to Universal-3.5 Pro on the same datasets. The full seven-pair chart is in the research post.
The bigger change is on the second failure mode. Earlier models would sometimes transcribe accented English in another language's script. Across AssemblyAI's English benchmarks, stray characters from other scripts fell by 85% on AssemblyAI-STT-3.7, from 161 to 24 per million characters. The model got better at following speakers who switch, and much better at leaving alone the ones who don't.
Against other providers, on 16 datasets that mix English with German, Spanish, French, Italian or Portuguese, AssemblyAI-STT-3.7 has the lowest average error rate at 6.2% and the lowest error rate on 12 of the 16 datasets, ahead of ElevenLabs Scribe v3 (6.8%), Soniox (10.2%), and Azure, AWS, OpenAI, Deepgram and Gladia (all at 17% or higher). The benchmarks page has the methodology, and multilingual transcription covers per-language accuracy for all 32 languages.
Contextual prompting: steer the transcript with plain language
The second capability matters most on short or hard audio. A two-second clip from a League of Legends pro interview is close to unintelligible without context. Here's the example from the AssemblyAI docs:
- Without a prompt: "And so look who I've been a dear."
- With the prompt "League of Legends roles": "In solo queue, I ban Azir."
The prompt gave the model what it needed: Azir is a champion, and "ban" is a common move in the game.
import os
from assemblyai.prerecorded.v2 import Transcriber, TranscriptionConfig
config = TranscriptionConfig(
speech_models=["assemblyai-stt-3-7"],
language_detection=True,
prompt="League of Legends roles",
)
transcript = Transcriber(api_key=os.environ["ASSEMBLYAI_API_KEY"], config=config).transcribe(
"https://assembly.ai/prompt-8"
)
print(transcript.text)Use the prompt parameter to describe what the audio is about. The model ignores formatting and behavior instructions, and it stays grounded in the audio, so irrelevant context won't add words that weren't spoken. The docs suggest three levels of detail:
| Level | Length | Example |
|---|---|---|
| Domain | 2–5 words | Medical consultation call. |
| Scenario | 5–15 words | Cardiology consultation about chest pain symptoms. |
| Detailed | 20–50 words | A full description, including names, products or identifiers. |
Start with the least specific level that covers your use case, and add detail when the audio contains names or terms the model can't otherwise know. Write plain, complete sentences, and keep lists of terms out of the prompt.
For those lists, use keyterms prompting instead. keyterms_prompt takes up to 1,000 words or phrases (six words per phrase at most) that the model should spell exactly, like "Kelly Byrne-Donoghue" in the docs example. On AssemblyAI-STT-3.7, prompting and keyterms prompting are $0.05/hr add-ons each. For more on writing prompts, see the prompting docs and when keyterm prompting backfires.
Prompting and code switching work well together. A prompt that names the setting, such as "Bilingual support call in English and Spanish about a billing dispute", gives the model context for names and jargon on both sides of the switch, while language_codes limits which languages it switches between.
Give AssemblyAI-STT-3.7 a clip full of names, jargon or product terms plus a one-line prompt, and check the entities it resolves.
Moving from Universal-3.5 Pro
If you followed the original version of this post, the switch is one line: set speech_models to ["assemblyai-stt-3-7"]. There is no new endpoint. Three behaviors changed, per the migration guide:
- Fallback. With
language_detection: trueand only AssemblyAI-STT-3.7 in the list, there's no fallback to another model. To cover languages outside the 32, use["assemblyai-stt-3-7", "universal-2"]. - Verbatim by default. AssemblyAI-STT-3.7 keeps disfluencies by default: fillers, repetitions, stutters, false starts and informal contractions. Set
disfluencies: falsefor clean transcripts, as Universal-3.5 Pro returned by default. - Code-switching options.
code_switchingandcode_switching_confidence_thresholdinlanguage_detection_optionsnow apply only to Universal-2. AssemblyAI-STT-3.7 code-switches natively.
If you don't set speech_models, the default depends on your account. New accounts created on or after November 17, 2026 already use AssemblyAI-STT-3.7. Existing accounts that default to Universal-3.5 Pro or Universal-3 Pro move to AssemblyAI-STT-3.7 on December 8, 2026.
What you get on the pre-recorded API
AssemblyAI-STT-3.7 is $0.21/hr, unchanged from Universal-3.5 Pro. Alongside code switching and contextual prompting, it ships with a new speaker diarization model; see what is speaker diarization for how it works and how it's measured. For summaries or structured extraction on top of a transcript, hand it to LLM Gateway. Meeting notetakers, post-call analytics and transcription pipelines that serve users in many languages are the use cases this model is built for. The Speech-to-Text API page covers the rest of the feature set.
Code switching across 32 languages, contextual prompting and speaker diarization on one API key, at $0.21/hr. Start free.
Frequently Asked Questions (FAQs)
What is code-switching in speech?
Code switching is when a speaker moves between two or more languages within a conversation or a single sentence, such as starting a sentence in Hindi and finishing it in English. Speech recognition has to transcribe each word in the language it was spoken without forcing everything into one language.
Which model should I use for code switching on recorded audio?
Use AssemblyAI-STT-3.7 (assemblyai-stt-3-7), AssemblyAI's flagship pre-recorded model. It code-switches natively across 32 languages when you set language_detection: true, and averages 6.2% word error rate on AssemblyAI's 16-dataset code-switching benchmark.
How does contextual prompting improve accuracy?
You pass a short natural-language description of the audio in the prompt parameter, and the model uses it to resolve names, jargon and hard-to-hear terms. In the AssemblyAI docs, the prompt "League of Legends roles" turns "And so look who I've been a dear" into the correct "In solo queue, I ban Azir."
What's the difference between prompt and keyterms_prompt?
prompt describes what the audio is about in plain sentences: the domain, the scenario or the full details. keyterms_prompt is an explicit list of up to 1,000 words or phrases the model should spell exactly. Use the prompt for context and key terms for spellings.
Which languages does AssemblyAI-STT-3.7 support?
32 languages with native code switching: the 18 that Universal-3.5 Pro supported (English, Spanish, French, German, Italian, Portuguese, Arabic, Danish, Dutch, Finnish, Hebrew, Hindi, Japanese, Mandarin, Norwegian, Swedish, Turkish and Vietnamese) plus Urdu, Russian, Korean, Catalan, Galician, Romanian, Estonian, Persian, Cantonese, Afrikaans, Marathi, Zulu, Xhosa and Norwegian Nynorsk.
Is Universal-3.5 Pro still available for pre-recorded audio?
Yes, but it's deprecated as of November 17, 2026, with a retirement date to be announced. After retirement, requests that name it route to AssemblyAI-STT-3.7 automatically. To switch now, set speech_models to ["assemblyai-stt-3-7"].