Skip to main content
Three options shape a streaming session: language tells the model what to expect, mode trades latency for accuracy, and style decides how mixed-language speech is written. Set them as query parameters on the WebSocket URL. Each is fixed for the session, and session.started echoes the values in effect.

Languages

language is a hint, not a translation request. The transcript is in the language that was spoken.
  • Set it when you know what callers will speak, for example a Hindi support line. Use the main language for speech that mixes it with English, for example hi for Hindi with English words.
  • Omit it, or pass none, for automatic language detection, when the language is unknown or changes from caller to caller. The model detects the language from the audio, and session.started reports "language": null.
A hint helps the model with the expected language, but it does not guarantee correct recognition. To change the language, open a new session.

Modes

A mode trades latency for accuracy. balanced prioritizes responsiveness, so text appears soon after it is spoken. high_accuracy allows more context before it commits text, which increases latency and usually gives more accurate transcripts. How soon text arrives also depends on your network and on how you send audio, for example your frame size. To choose a mode, stream a sample of your own audio in each one and compare. Both modes cost the same: 1.5 credits per second of audio. When your audio ends, send input.done. The server finishes the audio it has received, sends any remaining transcript.delta events, and then sends transcript.done.

Styles

Indian-language speech often mixes in English words. style chooses how those words are written. Use codemix to keep English words easy to recognize, for example when you search for them or process them downstream. Use native when the text must be in a single script, for example to feed a system that expects only Devanagari.

When an option is unavailable

If the requested language hint, mode, or style cannot be served when you connect, the session does not start. The server sends an error event with code 1011 whose message says what to change, for example mode=balanced, and closes with 1011. Nothing is billed. Retry with the suggested value, or try again later. For an unavailable language hint, omit language (or pass none) to use automatic language detection. A value that is not in the lists above is rejected with an error event and close code 1008. The message lists the accepted values.