Skip to main content
Transcribe audio containing multiple languages with code switching detection. This feature enables accurate transcription of conversations where speakers naturally switch between languages during conversations. Universal-3.5 Pro natively handles code switching across 18 languages. Set language_detection as True and the model follows speakers as they shift mid-sentence between languages like English and Spanish, French, Hindi or Mandarin, preserving exactly what was said without translating everything into a single language. See Universal-3.5 Pro code switching in action. English <> French
English <> Hindi
English <> Mandarin

Quickstart

Constrain the language set

By default, Universal-3.5 Pro auto-detects and code-switches across all 18 supported languages. When you already know which languages a file contains, pass the language_codes parameter to constrain the model to that set. On Universal-3.5 Pro, language_codes accepts any number of languages, and English is not required:
  • Multiple languages — for example ["en", "es", "pt"] or ["es", "fr"]. The model code-switches only among the languages you list.
  • A single language — a one-element list such as ["es"] pins transcription to that language, exactly like language_code.
  • The language_code returned in the response also honors your list, since the language set is passed to language identification.
  • If your list includes a language Universal-3.5 Pro doesn’t support, the request runs automatic language detection. If the detected language falls outside Universal-3.5 Pro’s supported set, the job falls through to the next model in speech_models (typically universal-2); otherwise Universal-3.5 Pro transcribes it with code switching.
language_codes is mutually exclusive with language_code and language_detection. Set only one of the three on a request.

Universal-2 (Legacy)

While Universal-2 supports code switching, we recommend upgrading to Universal-3.5 Pro for best results. To enable code switching on Universal-2, set speech_models to universal-2, language_detection to true, and code_switching to true inside the language_detection_options parameter.

Quickstart

Configuration

Manually Setting Language Codes On Universal-2, you can use the language_codes parameter to set the languages manually. A maximum of two language codes can be set, and one of them must be "en". For example, if your file contains both English and Spanish, it would be "language_codes": ["en", "es"].
These two-code, English-required limits apply to Universal-2 only. On Universal-3.5 Pro, language_codes accepts any number of languages and English is not required — see Constrain the language set above.
Code Switching Confidence Threshold The code_switching_confidence_threshold parameter controls how the model routes transcription when multiple languages are detected. When code switching is enabled, the model detects up to two languages per audio file and assigns each a confidence score.
Code Switching Routing BehaviorThis parameter controls routing, not rejection. Audio is always transcribed, even if confidence scores do not meet this threshold. To return an error instead of a low-confidence transcription, you can use language_confidence_threshold alongside this parameter.
The threshold determines which language is used for transcription using the following logic:
  • If the non-English language’s confidence score meets or exceeds the threshold, the audio is routed to that non-English language model.
  • If the non-English language’s confidence score falls below the threshold, the audio is routed to whichever language has the highest overall confidence, which may be English or non-English.
  • If both detected languages are non-English, the audio is always routed to whichever has the higher confidence score, regardless of the threshold.
Code Switching DefaultBy default, the code_switching_confidence_threshold parameter is set to 0.3. If you would like to disable this, make sure to set this parameter to 0. Setting code_switching_confidence_threshold to 0 means the non-English language is always used for routing, even with very low confidence.

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.