ModelsUniversal-2

Universal-2

Set up and configure Universal-2 for pre-recorded audio transcription.

Universal-2 offers the broadest language coverage of any AssemblyAI model, supporting high-accuracy transcription across 99 languages with low latency. It supports customization through keyterms prompting (up to 200 words) and includes features like multichannel support, automatic language detection, code switching, speaker diarization, and more. Universal-2 is the go-to choice when you need reliable transcription across diverse languages.

Key capabilities

  • 99 language support: Transcribe audio in 99 languages with high accuracy
  • Keyterms prompting: Improve recognition of up to 200 domain-specific terms, rare words, and proper nouns
  • Automatic language detection: Automatically detect the spoken language in your audio
  • Speaker diarization: Identify and label different speakers in the audio
  • Multichannel support: Transcribe audio with multiple channels separately
  • Code switching: Handle audio that switches between languages

Supported languages

Global Englishen
Australian Englishen_au
British Englishen_uk
US Englishen_us
Spanishes
Frenchfr
Germande
Italianit
Portuguesept
Dutchnl
Hindihi
Japaneseja
Chinesezh
Finnishfi
Koreanko
Polishpl
Russianru
Turkishtr
Ukrainianuk
Vietnamesevi
Afrikaansaf
Albaniansq
Amharicam
Arabicar
Armenianhy
Assameseas
Azerbaijaniaz
Bashkirba
Basqueeu
Belarusianbe
Bengalibn
Bosnianbs
Bretonbr
Bulgarianbg
Burmesemy
Catalanca
Croatianhr
Czechcs
Danishda
Estonianet
Faroesefo
Galiciangl
Georgianka
Greekel
Gujaratigu
Haitianht
Hausaha
Hawaiianhaw
Hebrewhe
Hungarianhu
Icelandicis
Indonesianid
Javanesejw
Kannadakn
Kazakhkk
Khmerkm
Laolo
Latinla
Latvianlv
Lingalaln
Lithuanianlt
Luxembourgishlb
Macedonianmk
Malagasymg
Malayms
Malayalamml
Maltesemt
Maorimi
Marathimr
Mongolianmn
Nepaline
Norwegianno
Norwegian Nynorsknn
Occitanoc
Panjabipa
Pashtops
Persianfa
Romanianro
Sanskritsa
Serbiansr
Shonasn
Sindhisd
Sinhalasi
Slovaksk
Sloveniansl
Somaliso
Sundanesesu
Swahilisw
Swedishsv
Swiss Germande_ch
Tagalogtl
Tajiktg
Tamilta
Tatartt
Telugute
Thaith
Tibetanbo
Turkmentk
Urduur
Uzbekuz
Welshcy
Yiddishyi
Yorubayo

Quickstart

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

1

Install the required library

$pip install requests
2

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

3

Run with python main.py.

1import requests
2import time
3
4base_url = "https://api.assemblyai.com"
5headers = {"authorization": "<YOUR_API_KEY>"}
6
7data = {
8 "audio_url": "https://assembly.ai/wildfires.mp3",
9 "speech_models": ["universal-2"],
10 "language_detection": True
11}
12
13response = requests.post(base_url + "/v2/transcript", headers=headers, json=data)
14
15if response.status_code != 200:
16 print(f"Error: {response.status_code}, Response: {response.text}")
17 response.raise_for_status()
18
19transcript_response = response.json()
20transcript_id = transcript_response["id"]
21polling_endpoint = f"{base_url}/v2/transcript/{transcript_id}"
22
23while True:
24 transcript = requests.get(polling_endpoint, headers=headers).json()
25 if transcript["status"] == "completed":
26 print(transcript["text"])
27 break
28 elif transcript["status"] == "error":
29 raise RuntimeError(f"Transcription failed: {transcript['error']}")
30 else:
31 time.sleep(3)