Voice Socket
Voice Socket — overview
The Voice Socket is a WebSocket that streams live, two-way speech between your app and an AI agent. You send microphone audio; you get the agent's voice back — plus events (transcripts, tool calls, lifecycle). No phone number, no phone network.
Use it for voice inside something you control: a browser, a mobile app, a device — or to bridge audio from your own telephony.
Want us to dial a real phone instead? That's Phone Calls.
How it works
Your app (browser / server / device)
│ wss://core.eurekatechlabs.com/v1/voice/{agentId}
│ • binary frames → your mic audio in
│ • binary frames ← agent voice out
│ • JSON frames ↔ transcripts, tool calls, lifecycle
▼
EurekaConnect → your AI agent- Audio is raw binary WebSocket frames, both ways.
- Events are JSON frames, each tagged
{"v":1, …}. - When the session ends it bills and fires the same
call.endedwebhook as a phone call. It shows up in call history with direction socket.
What you need
| An agent | A saved agent, or an inline agent sent when you mint the token. |
| An API key | Scope voice:connect. |
| Audio format | pcm_s16le@24000 — signed 16-bit PCM, 24 kHz, mono — both directions. |
Two ways to connect
| When | How you authenticate | |
|---|---|---|
| Browser | Client-side | Mint a short-lived token on your server, connect with ?token=… |
| Server / device | Your backend | Send Authorization: Bearer ek_… on the handshake |
Browsers can't set headers on a WebSocket, so they use a token. Anything that can set headers sends the key directly. See Connection auth.
Good to know (v1)
- No recording. Socket sessions return
recordingUrl: null. Capture audio on your side if you need it. - No transfer to a human — there's no phone leg to transfer to. The agent's end-call action just closes the socket.
- Set the agent up front. Pick a saved agent, or pass an inline agent when you mint the token. There's no changing the prompt mid-stream.
