Agent Stream WebSocket
Connect call audio you already carry over a WebSocket (a PBX, a telephony platform such as Twilio, Exotel or Klicko, or your own app) to a 60db voice agent. The agent listens, answers in its voice, uses its tools (your Webhook (JSON) tools and Call transfer) and knowledge base, and can press keys, transfer to a person or hang up. No phone line or UDP ports are needed: everything runs over HTTPS, port 443.🚀 Quick Start
1. Start the call (from your server)
url is single use and valid for 55 seconds. It carries no API key, so you can hand it to the component that streams audio. See Start stream call for overrides and metadata.
2. Connect and stream (Node.js 22+)
🔌 Connection
🎧 Styles
The style is picked from your first message.Native style
You get
{"event":"started","call_id":"…","format":"mulaw","frame_bytes":160}, then audio as binary messages in both directions.
Twilio Media Streams style
Send your usual Twilio, Exotel or Klicko messages: no adapter, no change to the request.mediaFormatmay be nested instart(Twilio) or at the top of it (Klicko).- Encodings:
audio/x-mulaw,pcmu,mulaw(μ-law) oraudio/x-l16,l16,pcm16,pcm16_8k(PCM16). The rate must be 8000. pcmaand 16 kHz formats close the socket with1008.- There is no
startedreply. Audio comes back as{"event":"media","streamSid":"…","streamId":"…","media":{"payload":"…"}}. markis ignored. Base64 in JSON is about 1.7 times the native bytes.
📨 Messages
From the agent
From you
Tools During a Stream Call
A stream call uses the agent’s tools exactly like a phone call. Add them on the agent (dashboard → agent → Tools & webhooks → Add tool, ortools / transfer_targets in the API).
Webhook (JSON) tools
Your own functions, such as checking availability or booking a table. They do not go over this socket. 60db calls your server directly:- Define the tool on the agent with a JSON Schema, and set the agent’s Tool webhook (
tool_webhook_url):
- During the call, when the agent uses it, 60db sends a signed
POSTto yourtool_webhook_urlwith the tool name and arguments (headersX-60db-Signature,X-60db-Timestamp). - Reply with any JSON object within about 6 seconds, e.g.
{ "booked": true, "table": 12 }. The agent turns it into its spoken answer. A slow or failed reply reaches the agent as{"error": "tool_unavailable", …}, so it can apologise.
tool_webhook_url, or starting the call returns 400 VALIDATION_ERROR (field: tool_webhook_url).
Call transfer tool
Built in: no webhook needed. Settransfer_targets on the agent (or in overrides for one call). When the caller asks for a person, the agent says a short line and this socket receives:
{"event":"transfer_result","outcome":"joined"} (or busy, declined, no_answer, failed). See Call transfer.
Keypad
Withcall_defaults.dtmf: true the agent can press keys ({"event":"dtmf","digits":"1"} arrives on this socket) and collect the caller’s keys (send {"event":"dtmf","digits":"5#"}).
❌ Close Codes
📊 Limits and Pricing
After the call, find it in Agents → History (label Stream), or use Get call, Get transcript and Get recording.