Real-Time WebSocket API Documentation
Connect voice applications using WebSockets for low-latency communication, streaming, and real-time interactions.
WebSocket Endpoints
Voice Stream
Bidirectional audio streaming for voice calls:
wss://api.voxentis.com/v1/calls/{call_id}/stream
Live Transcript
Receive real-time transcripts (read-only):
wss://api.voxentis.com/v1/calls/{call_id}/transcript/live
Call Events
Subscribe to all events for a specific call:
wss://api.voxentis.com/v1/calls/{call_id}/events
Agent Events (Dashboard)
Subscribe to all events across all calls for an agent:
wss://api.voxentis.com/v1/agents/{agent_id}/events
Authentication
Pass your API key in the connection URL or as a header during the WebSocket handshake.
import websockets
async with websockets.connect(
"wss://api.voxentis.com/v1/calls/call_123/stream",
extra_headers={"Authorization": "Bearer YOUR_API_KEY"}
) as ws:
...
Message Types
Client → Server
| Type | Description |
|---|---|
audio | Binary audio frame (voice stream only) |
config | Update stream configuration |
ping | Keepalive ping (server responds with pong) |
close | Gracefully close the connection |
Server → Client
| Type | Description |
|---|---|
audio | Binary audio frame from the agent |
transcript.interim | Partial transcript of caller speech |
transcript.final | Final transcript of caller speech |
agent.speaking | Agent started/stopped speaking |
tool.invoked | Tool call initiated |
tool.result | Tool call completed |
call.started / call.ended | Call lifecycle events |