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 not required:
wav, mp3, ogg, flac, webm, aac, aiff
Opus audio is typically shipped as ogg (Opus-in-Ogg). Pass audio_format=ogg for Opus streams.
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
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 feature toggles. Diarization, emotion, accent, and PII parameters are not recognized and have no effect. Use STT Streaming if you need those features.
Connection flow
- Connect to the WebSocket endpoint with
api_key,audio_format, and (for raw PCM)sample_rateandnum_channels. - 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 so far — replace any previously displayed partial, do not append. - Send an empty text frame (
"") to signal end of audio. - Receive one final
utterancemessage with the complete transcript. - 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, not a delta from the previous message. Replace your displayed partial text with each new value — never append.
utterance
Sent exactly once, after the client signals end-of-stream. Contains the final transcript covering the entire audio stream. Supersedes all preceding partial_utterance messages.
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 organization.
- Monthly usage limits (in audio hours) apply per organization.
- Connections that exceed limits are rejected during the WebSocket handshake with close code
4029.
Examples
- Python (websockets)
- JavaScript (Node.js)
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