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

# Steer toward known languages

> Steer a voice agent's speech-to-text toward the languages you expect with language_codes, or leave it on automatic multilingual detection.

The agent transcribes any [supported language](/docs/voice-agents/voice-agent-api/supported-languages) automatically and code-switches natively, so a caller can move between, say, English and Spanish mid-sentence with no configuration. When you know which language(s) a line serves, set `input.language_codes` to steer transcription toward them for a bit more accuracy. Omit it for automatic detection. Set it when you [create](/docs/voice-agents/voice-agent-api/create-agent) or [update](/docs/voice-agents/voice-agent-api/manage-agents) the agent.

* **Global or mixed-language line**: omit `language_codes`. The agent detects and code-switches on its own.
* **Region-specific line**: pin the language(s) you expect. A Spanish support line set to `["es"]` won't drift into look-alike transcriptions of another language.

<CodeGroup>
  ```bash cURL {8} theme={null}
  curl -X POST https://agents.assemblyai.com/v1/agents \
    -H "Authorization: $ASSEMBLYAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Soporte",
      "system_prompt": "Eres un agente de soporte amable. Responde en español.",
      "voice": { "voice_id": "lola" },
      "input": { "language_codes": ["es"] }
    }'
  ```

  ```python Python {12} theme={null}
  # pip install requests
  import os
  import requests

  resp = requests.post(
      "https://agents.assemblyai.com/v1/agents",
      headers={"Authorization": os.environ["ASSEMBLYAI_API_KEY"]},
      json={
          "name": "Soporte",
          "system_prompt": "Eres un agente de soporte amable. Responde en español.",
          "voice": {"voice_id": "lola"},
          "input": {"language_codes": ["es"]},
      },
  )
  resp.raise_for_status()
  print(resp.json())
  ```

  ```javascript Node.js {12} theme={null}
  // Node 18+ has fetch built in
  const res = await fetch("https://agents.assemblyai.com/v1/agents", {
    method: "POST",
    headers: {
      Authorization: process.env.ASSEMBLYAI_API_KEY,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      name: "Soporte",
      system_prompt: "Eres un agente de soporte amable. Responde en español.",
      voice: { voice_id: "lola" },
      input: { language_codes: ["es"] },
    }),
  });
  const data = await res.json();
  console.log(data);
  ```
</CodeGroup>

| Field                  | Type      | Required | Notes                                                                                                                                               |
| ---------------------- | --------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `input.language_codes` | string\[] | No       | Languages to steer toward. Omit (or leave empty) for automatic detection. Pass one code to pin a single language, or several to constrain to a set. |

## Supported language codes

Universal-3.5 Pro Streaming code-switches across all 18 languages below. Pass any of these codes in `language_codes`:

| Language   | Code | Language   | Code |
| ---------- | ---- | ---------- | ---- |
| English    | `en` | Danish     | `da` |
| Spanish    | `es` | Finnish    | `fi` |
| French     | `fr` | Hindi      | `hi` |
| German     | `de` | Vietnamese | `vi` |
| Italian    | `it` | Arabic     | `ar` |
| Portuguese | `pt` | Hebrew     | `he` |
| Turkish    | `tr` | Japanese   | `ja` |
| Dutch      | `nl` | Mandarin   | `zh` |
| Swedish    | `sv` | Norwegian  | `no` |

<Tip>
  Set the input language and a matching [voice](/docs/voice-agents/voice-agent-api/voices) together: transcribing Spanish while replying in an English voice is jarring. The example above pairs `["es"]` with the Spanish voice `lola`.
</Tip>

<Note>
  `language_codes` is applied when the speech-to-text connection opens; a mid-session change takes effect on the next reconnect, not the current turn. For how native code-switching works, see [Multilingual transcription](/docs/streaming/multilingual-transcription).
</Note>
