Direct Call — overview
Direct Call is a WebSocket that puts your client on a real phone call. You place the call, you send the audio, you receive the audio. There is no AI in the middle.
Use it when the conversation is yours to run: a browser-based softphone, an agent console, a device that talks to customers, or anything where a person — not a model — is the other end of the line.
Want an AI agent to run the call instead? That's Phone Calls. Want an AI agent with no phone network? That's the Voice Socket.
How it works
Your client (browser / app)
│ wss://core.eurekatechlabs.com/v1/direct-call/{productId}
│ • {"type":"dial"} → place the call
│ • binary frames → your microphone audio
│ • binary frames ← the other person's audio
│ • JSON frames ↔ ringing, answered, ended
▼
EurekaConnect → the phone network → the person you calledYou connect first, then dial. The socket is opened before the call exists — that is what lets your client be the audio endpoint from the first ring.
- Audio is raw binary WebSocket frames, both ways.
- Control is JSON frames, each tagged
{"v":1, …}. - When the call ends it bills and fires the same
call.endedwebhook as any other call, and appears in call history.
What you need
| A product | With the Direct Call capability enabled, under Call Settings on the product page. |
| A number | Assigned to that product. You name it on every dial. |
| An API key | Scope direct_call:connect to open the socket, and calls:write to place a call. |
| Audio format | pcm_s16le@24000 — signed 16-bit PCM, 24 kHz, mono — both directions. |
Connecting is not dialing
The two scopes are separate on purpose. A key with only direct_call:connect
can open the socket but every dial is refused. That is how you give a browser
console live audio without also giving it the ability to originate calls on your
numbers.
AI and Direct Call on the same number
A product has two independent capabilities — AI Agent and Direct Call — and you can turn on both. They are not modes to switch between; they are two surfaces available at once on the same product and the same numbers.
That makes the common follow-up flow ordinary:
10:00 an AI agent takes a call on +60123456789
10:15 your server opens a Direct Call socket and dials the same customer,
from the same +60123456789, with a human on your endNothing needs to be reconfigured between the two, and there is no waiting period. You decide which surface to use, per call, by which API you call:
| You want | You use |
|---|---|
| An AI agent to run the call | Phone Calls — POST /v1/calls |
| Your own client on the call | This API — connect the socket, then dial |
Two notes on the mixed setup:
- Inbound still goes to the agent. A call to your number is answered by
the product's AI routing (or its
call.answerwebhook). Inbound Direct Call is not available yet, so there is no ambiguity about who picks up. - Each call bills for what it was. A Direct Call has carrier cost and no model cost; an AI call has both. The two show up separately in call history and in usage.
Turning a capability off is what changes behaviour — agents stop answering, or Direct Call clients stop connecting. Turning one on takes nothing away.
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 |
A Direct Call token is not interchangeable with a Voice Socket token. Each is minted for its own surface and rejected by the other — a token that can start a cheap AI session must not also be able to place billed phone calls.
Test-mode (ek_test_) keys cannot open a Direct Call socket at all.
Caller ID
Every dial names the number to call from, and it must be a number assigned
to this product. There is no default and nothing is inferred. A number belonging
to another product — even inside your own organization — is refused with
number_not_owned.
This rule is unchanged by having both capabilities on: the number is assigned to the product either way, so a number your agent answers on is a number you may dial from.
What we don't do
Direct Call is a pipe. Routing calls to particular people, queues, presence, hold music between agents — all of that is yours to build on top. We give you the audio and the call control; what you make of the conversation is up to you.
Inbound Direct Call (ringing a set of connected clients when someone calls you) is not available yet.
Next
- Direct Call vs AI calls — the two side by side, and when to use which.
- Quickstart — Browser — a working call in one page of code.
- Protocol reference — every frame, in both directions.
