Upgrade to WebSocket for real-time streaming
Upgrade to WebSocket for real-time streaming
Upgrades the HTTP connection to a WebSocket for real-time audio streaming.
Usage
- Create a transcription session with
stream=true - Connect to this WebSocket endpoint
- Send audio chunks as JSON messages
- Receive transcription results in real-time
Client → Server (Audio Chunks)
{
"message_type": "transcriptions_session_audio",
"message_source": "audio_analytics_api",
"session_id": "session123",
"type": "input_audio",
"data": "<BASE64_ENCODED_AUDIO>"
}
Server → Client (Event Sequence per Utterance)
1. Speech detected:
{ "session_id": "session123", "type": "transcript.event", "state": "speech_start" }
2. Partial transcription (zero or more):
{ "session_id": "session123", "text": "Partial transcription text", "language": "en", "type": "transcript.text.delta", "state": "transcription" }
3. End of speech detected:
{ "session_id": "session123", "type": "transcript.event", "state": "speech_end" }
4. Final transcription:
{ "session_id": "session123", "text": "Complete transcription text.", "language": "en", "type": "transcript.text.done", "state": "transcription" }
After step 4 the engine resets and listens for the next utterance.
The session stays open until the client calls /transcriptions/close.
Connection
- Protocol: WebSocket (ws:// or wss://)
- URL:
ws://<host>:8085/stream - Requires prior session creation via
/transcriptions/create
GET
Upgrade to WebSocket for real-time streaming
Response
Switching Protocols - WebSocket connection established

