Skip to main content
Pass a language_code in the config part to steer transcription toward a specific language. For multilingual or code-switching audio, pass an array of codes instead of a single code.
  • Accepts a single ISO 639-1 code ("es") or a list of codes (["en", "es"])
  • Defaults to English (en) when omitted
  • Ignored when a custom prompt is set — the prompt fully controls the model, so set the language inside the prompt if you also need custom instructions
import json
import requests

with open("sample.wav", "rb") as f:
    audio = f.read()

response = requests.post(
    "https://sync.assemblyai.com/transcribe",
    headers={
        "Authorization": "<YOUR_API_KEY>",
        "X-AAI-Model": "universal-3-5-pro",
    },
    files={
        "audio": ("sample.wav", audio, "audio/wav"),
        "config": (None, json.dumps({"language_code": "es"}), "application/json"),
    },
    timeout=60,
)
response.raise_for_status()
print(response.json()["text"])
For multilingual or code-switching audio, pass language_code as an array listing every expected language:
{ "language_code": ["en", "es"] }

Supported languages

CodeLanguageCodeLanguage
enEnglishdaDanish
esSpanishfiFinnish
deGermanhiHindi
frFrenchviVietnamese
itItalianarArabic
ptPortugueseheHebrew
trTurkishjaJapanese
nlDutchurUrdu
svSwedishzhMandarin
noNorwegian