Endpoint
Authentication
Pass your API key as a query parameter when opening the connection.Supported audio formats
Container formats —sample_rate and num_channels are ignored if supplied:
mp3, wav, flac, m4a, mp4, ogg, opus, webm, aac, aiff, wma, amr, and au, plus 67 others
All 80 accepted container values
All 80 accepted container values
3g2, 3ga, 3gp, 3gpp, 8svx, aa3, aac, ac3, act, adts, aif, aifc, aiff,
amb, amr, asf, at3, au, avr, awb, bwf, c2, caf, dss, dts, dtshd,
eac3, ec3, f4a, f4b, flac, gsm, iff, m2a, m2ts, m4a, m4b, m4r, m4v,
mka, mkv, mlp, mp+, mp1, mp2, mp3, mp4, mpa, mpc, mpga, mpp, mts,
oga, ogg, ogx, oma, omg, opus, paf, pvf, qcp, ra, rf64, rm, rmvb,
snd, spx, svx, thd, ts, tta, voc, vqf, w64, wav, wave, weba, webm,
wma, wmvmp4, m4a, m4b, m4r, m4v, 3gp, 3gpp, 3ga, 3g2, f4a, f4b) must be sent in a streamable layout; otherwise the connection ends with an audio-processing error.
Opus audio is accepted either as opus or, for Opus-in-Ogg streams, as ogg.
Raw PCM formats — sample_rate and num_channels are required:
s8, s16le, s16be, s24le, s24be, s32le, s32be, u8, u16le, u16be, u24le, u24be, u32le, u32be, f32le, f32be, f64le, f64be, mulaw, alaw, g722, vox
g722 and vox are mono-only: num_channels must be 1.
Valid sample rates: 8000, 11025, 16000, 22050, 32000, 44100, 48000, 96000
For lowest end-to-end latency, send audio_format=s16le&sample_rate=16000&num_channels=1. This matches the model’s native input format and bypasses the server’s audio decoder entirely.
Query parameters
This endpoint accepts no enrichment toggles. Diarization, emotion, accent, and PII parameters are not recognized and have no effect. Use STT Streaming if you need those features.
Utterance segmentation (endpointing)
By default, the connection produces one finalutterance at end-of-stream covering everything you sent, and each partial_utterance reflects the whole stream so far.
With endpointing=true, speech is segmented at pauses:
- Each
partial_utterancecontains the complete transcript of the current segment so far (still replace, never append). - Each time a pause ends a segment, you immediately receive a final
utterancefor it — final text arrives shortly after the speaker stops, instead of at end-of-stream. Each final carriesstart_msandduration_msfor its speech. - The full transcript is the concatenation of the final
utterancetexts, in order. - Every connection still ends with at least one final
utterance(a stream containing no speech yields one with emptytext), followed bydone.
Connection flow
- Connect to the WebSocket endpoint with
api_key,audio_format, (for raw PCM)sample_rateandnum_channels, and optionallyendpointing. - Stream audio as binary WebSocket frames. Frames can be any size; 4–64 KB is typical.
- Receive
partial_utteranceJSON messages every ~1.5 seconds. Each contains the complete transcript of its scope so far — replace any previously displayed partial, do not append. - With
endpointing=true, receive a finalutterancemessage each time a pause ends a segment. - Send an empty text frame (
"") to signal end of audio. - Receive the final
utterancefor any content not already finalized at a pause (the whole stream with endpointing off; skipped when the last segment was already finalized mid-stream). - Receive a
donemessage with total audio duration. - The connection closes automatically.
Server messages
partial_utterance
Sent roughly every 1.5 seconds while audio is streaming. Each message contains the complete transcript built so far for the current scope — the whole connection by default, or the current speech segment when endpointing=true. It is not a delta from the previous message: replace your displayed partial text with each new value — never append.
utterance
The final transcript for one utterance. Will not be revised. With endpointing off, sent exactly once at end-of-stream, covering the entire audio stream. With endpointing=true, sent each time a pause ends a segment; the full transcript is the concatenation of every utterance text in order.
done
Sent immediately after the final utterance. Signals stream completion. The connection closes shortly after.
error
Sent if something goes wrong. The connection closes after this message. No further messages follow an error.
WebSocket close codes
Rate limits
- Concurrent connection limits apply per model; exceeding them rejects the handshake with close code
4030.
Examples
- Python (websockets)
- JavaScript (Node.js)
The examples above work unchanged with endpointing: append
&endpointing=true to the URL and the same message loop prints one [final] line per pause instead of a single one at the end.WebSocket APIs cannot be tested with cURL. For command-line testing, use
websocat.Related
- Which API should I use? — when Streaming v2 is the right choice vs STT Streaming or batch
- STT Streaming — multilingual streaming with speaker diarization and enrichments
- Authentication and rate limits