Endpoint
Connection Lifecycle
1. Handshake
The connection starts as an HTTP GET withUpgrade: websocket. The server responds with 101 Switching Protocols, then the connection upgrades to WebSocket frames.
2. Streaming
Once connected, audio and transcription flow concurrently — no request/response pairing. Client → Server
Server → Client
See Messages for the complete wire protocol reference.
3. Teardown
Send{"type": "CloseStream"} (Deepgram, Speechmatics, and Soniox) to flush remaining audio and close gracefully. The server finishes processing, sends any remaining transcripts, then closes the WebSocket.
CloseStream works but may lose buffered audio on Deepgram, Speechmatics, and Soniox.
See Examples for complete code samples.