utterance is emitted for each segment of speech.
This endpoint produces no emotion, accent, or PII/PHI data. Use STT Streaming if you need those.
Endpoint
Authentication
The API key goes in the query string at connection time, not in a header. See Authentication and rate limits.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 66 others
All 79 accepted container values
All 79 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, 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.
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.
Query parameters
diarize and endpointing are independent; all four combinations are valid.
Language identification
The spoken language is identified automatically across these 25 languages: Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish, Ukrainian. Eachutterance is transcribed in the language spoken, with auto-capitalization and auto-punctuation already applied. There is no language query parameter, and recognition quality varies by language.
Speaker labels
Withdiarize=true, each final utterance carries speaker, a zero-based index identifying who produced it. Partials never carry it, and a label is assigned when an utterance is finalized and never revised.
The index is stable for one connection and meaningless outside it: the same person on a new connection may receive a different index, so it is not an identity that can be matched across connections.
speaker is null when diarization was requested but no speaker could be determined for that utterance. That is distinct from the field being absent, which means diarize=true was not requested.
Speaker capacity
Up to four concurrent speakers are labeled per connection. Beyond four, additional speakers are merged into existing labels: their speech is still transcribed, butspeaker is wrong for some utterances.
Utterances that span a speaker change
Segments are cut at pauses regardless ofdiarize. An utterance spanning a fast exchange with no pause carries the speaker who produced most of it, and speaker_purity reports what proportion that was. 1.0 is cleanly single-speaker; lower means the label describes only the majority.
With endpointing off
diarize=true&endpointing=false produces one final utterance for the whole stream, so a single speaker cannot describe it. Read n_speakers and treat speaker as indicative only.
Connection flow
- Connect with
api_key,audio_format, and (for raw formats)sample_rateandnum_channels. - Stream audio as binary WebSocket frames.
- Receive
partial_utterancemessages while audio arrives. - Send an empty text frame (
"") to signal end of audio. - Receive the final
utterance(s), then adonemessage. - The connection closes.
Server messages
partial_utterance
The complete transcript so far for the current scope — the whole connection by default, or the current segment when endpointing=true. Not a delta: replace the displayed text on each message, never append.
diarize=true.
utterance
The final transcript for one segment. Will not be revised.
With
diarize=false no speaker field appears in any message.
done
Sent once, immediately after the final utterance. The server closes after it.
error
Sent if something goes wrong. The connection closes after it; no further messages follow.
diarize.
WebSocket close codes
Related
- Transcription — parameters, response shape, and audio formats for every transcription endpoint
- Multilingual Fast Transcription Batch — the file-upload counterpart, which does return
language - Which API should I use?