Live transcription and translation
The streaming WebSocket interface, returning incremental captions and translations.
Opening a connection
wss://api.winteam.tech/v1/stream?token=<API_KEY>
Once connected, send a configuration message first:
{
"type": "config",
"audio": { "encoding": "pcm_s16le", "sample_rate": 16000, "channels": 1 },
"source_language": "en",
"target_languages": ["zh"],
"glossary_id": "gls_medical_2026",
"interim_results": true
}
Then stream binary audio frames continuously, ideally 20–100 ms per frame.
Messages you receive
{
"type": "transcript",
"state": "live",
"start_ms": 12340,
"text": "Real-time captions arrive in under two seconds",
"translations": { "zh": "实时字幕在两秒内同步呈现" }
}
state takes one of three values, matching the three caption states:
live— being recognized; the tail can still changestable— the prefix is confirmed and will not be rewrittenfinal— the sentence is locked
Stable prefix
When rendering, keep everything before stable fixed and redraw only the active tail. Captions then never reflow.
Reconnecting
After a network interruption, reconnect with the same session_id. The server resumes the context, and no confirmed text is lost.