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

# Language selection

> Steer Sync STT transcription toward one or more languages with the language_codes field.

Pass `language_codes` 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 language code (`"es"`) or a list of codes (`["en", "es"]`)
* When omitted, no language steering is applied
* Applies alongside a custom `prompt` — see [Specifying the language](https://assemblyai.com/docs/sync-stt/prompting-and-keyterms.md#specifying-the-language)

> [tab] Python SDK
>
> ```python theme={null}
> from assemblyai.sync.v1 import SyncTranscriber, SyncTranscriptionConfig
>
> config = SyncTranscriptionConfig(model="universal-3-6-pro", language_codes=["es"])
>
> transcriber = SyncTranscriber(api_key="<YOUR_API_KEY>", config=config)
> transcriber.warm()  # open the connection ahead of the request
> result = transcriber.transcribe("sample.wav")
> print(result.text)
> ```

> [tab] JavaScript SDK
>
> ```javascript theme={null}
> import { AssemblyAI } from "assemblyai";
>
> const client = new AssemblyAI({ apiKey: process.env.ASSEMBLYAI_API_KEY });
>
> await client.sync.warm(); // open the connection ahead of the request
> const result = await client.sync.transcribe("sample.wav", {
>   model: "universal-3-6-pro",
>   language_codes: ["es"],
> });
> console.log(result.text);
> ```

> [tab] Python
>
> ```python theme={null}
> import json
> import requests
>
> with open("sample.wav", "rb") as f:
>     audio = f.read()
>
> response = requests.post(
>     "https://sync.assemblyai.com/v1/transcribe",
>     headers={
>         "Authorization": "<YOUR_API_KEY>",
>         "X-AAI-Model": "universal-3-6-pro",
>     },
>     files={
>         "audio": ("sample.wav", audio, "audio/wav"),
>         "config": (None, json.dumps({"language_codes": ["es"]}), "application/json"),
>     },
>     timeout=60,
> )
> response.raise_for_status()
> print(response.json()["text"])
> ```

> [tab] JavaScript
>
> ```javascript theme={null}
> import { readFileSync } from "fs";
>
> const audio = readFileSync("sample.wav");
> const form = new FormData();
> form.append("audio", new Blob([audio], { type: "audio/wav" }), "sample.wav");
> form.append(
>   "config",
>   new Blob([JSON.stringify({ language_codes: ["es"] })], {
>     type: "application/json",
>   })
> );
>
> const response = await fetch("https://sync.assemblyai.com/v1/transcribe", {
>   method: "POST",
>   headers: {
>     Authorization: "<YOUR_API_KEY>",
>     "X-AAI-Model": "universal-3-6-pro",
>   },
>   body: form,
> });
>
> const result = await response.json();
> console.log(result.text);
> ```

> [tab] cURL
>
> ```bash theme={null}
> curl -X POST https://sync.assemblyai.com/v1/transcribe \
>   -H 'Authorization: <YOUR_API_KEY>' \
>   -H 'X-AAI-Model: universal-3-6-pro' \
>   -F 'audio=@sample.wav;type=audio/wav' \
>   -F 'config={"language_codes":["es"]};type=application/json'
> ```

For multilingual or code-switching audio, pass `language_codes` as an array listing every expected language:

```json theme={null}
{ "language_codes": ["en", "es"] }
```

With the SDKs, list the same codes: `SyncTranscriptionConfig(language_codes=["en", "es"])` in Python, or `{ language_codes: ["en", "es"] }` in JavaScript.

## Supported languages

The endpoint accepts 32 codes. Anything outside this set is rejected with a
`400` that lists the full set in its `detail`.

| Code | Language | Code | Language |
| - | - | - | - |
| `en` | English | `ko` | Korean |
| `es` | Spanish | `ca` | Catalan |
| `de` | German | `gl` | Galician |
| `fr` | French | `ru` | Russian |
| `it` | Italian | `ro` | Romanian |
| `pt` | Portuguese | `et` | Estonian |
| `tr` | Turkish | `fa` | Persian |
| `nl` | Dutch | `yue` | Cantonese |
| `sv` | Swedish | `af` | Afrikaans |
| `no` | Norwegian | `mr` | Marathi |
| `da` | Danish | `zu` | Zulu |
| `fi` | Finnish | `xh` | Xhosa |
| `hi` | Hindi | `nn` | Norwegian Nynorsk |
| `vi` | Vietnamese | `ar` | Arabic |
| `he` | Hebrew | `ja` | Japanese |
| `ur` | Urdu | `zh` | Mandarin |
