Realtime Translation
Real-time translation: get translated text alongside transcription while speech is happening.
translate_to is not currently enabled for external sessions. The public realtime gateway forwards language but does not forward translate_to, so a session.update with that field has no effect.Usage
Configure translation
Set the source language and translation target via session.update:
{
"type": "session.update",
"language": "zh",
"translate_to": "en"
}
language: source language of the audiotranslate_to: target language for translation
Translation output
When enabled, translation results are returned alongside transcription in the conversation.item.input_audio_transcription.completed event.
Source and translated text correspondence
Source and translation for each utterance arrive in the same conversation.item.input_audio_transcription.completed event, ensuring correspondence. No client-side matching needed.
Switching languages
Change language at any time during the session:
{ "type": "session.update", "language": "en" }
New utterances after the switch use the new language. In-flight utterances complete with the previous language.
Latency
Translation adds additional latency:
| Component | Typical p50 |
|---|---|
| STT (transcription) | ~310ms |
| Translation | ~200ms |
| End-to-end | ~510ms |
Translation latency depends on audio length, context, and service load. Measure end-to-end latency in your integration and tune session settings for your use case.
Multilingual / code-switching
- Auto-detect: set
language: "auto" - Mixed language: upstream supports code-switching, accuracy depends on model and audio quality
- Chinese aliases:
zh-cn,zh-tw,mandarinetc. are normalized tozh
UI strategy
- Receive
conversation.item.input_audio_transcription.completedevent - Display source text on first line
- Display translation on second line
- Each utterance is independent, no replacement needed
See Build Live Translation for a detailed guide.
Related
- Session Configuration —
session.updatedetails - Live Translation — translation concepts
- Build Live Translation — UI guide
