config.language is one code shared by every speech model in the pipeline: stt, tts, realtime and their fallbacks. Each model receives it in its own spelling (Hindi reaches Deepgram as hi and Sarvam as hi-IN). null means Auto and is the default. On a text agent it applies to the voice-note stt only, and is cleared when there is none; set the reply language in the prompt.

Rules

Pick the language first, then models that cover it. Filter the catalog’s stt, tts and realtime entries on their languages, and pass language to GET /v1/catalog/voices to filter voices.

How a code matches a model

  1. Exact: the model publishes the code.
  2. Widen: you asked for en-GB and the model has en.
  3. Narrow: you asked for hi and the model has exactly one variant, such as hi-IN. If it has several (pt-BR and pt-PT), its default_language breaks the tie if it fits; otherwise the match fails.
Odia is accepted as both or and Sarvam’s od-IN.

What Auto does

With language: null, each model falls back to its catalog default_language: Exceptions to read the table with:
  • xai speech-to-text declares en but always detects; the code only controls number and currency formatting.
  • raya speech-to-text never detects, and the code selects the output script (Devanagari on hi, romanized on en). Hindi audio on en loses words. Set language on any Indic agent using Raya.
  • sarvam/bulbul:* takes the spoken language from the text it is given.
  • OpenRouter speech-to-text always detects; no code is sent to it.
  • language_required models (such as soniox/tts-rt-v2) refuse Auto. On Soniox TTS the code is the phonetic system the text is read through, so English text sent as another language is unintelligible.
If callers may switch language mid-call, leave Auto on and pick models whose default_language is empty, auto or multi.

Check before you publish

POST /v1/agents/{agent_id}/validate lists every model that cannot speak the language in one response.
The language also decides turn-taking on batch speech-to-text: see speech and turn detection.

Next

Speech and turn detection

Why the language changes how a turn ends.

Voices

Filtering voices by language.