/calls/create (saved agent) or /calls/inline (config in
the request) and connects you to the returned WebSocket.
Basic use
Where the API key goes
string
required
Your API key.
string
default:"https://api.omnia-voice.com"
Point this at your own proxy to keep the key server-side.
boolean
default:"true"
Stream the user’s own speech as they talk, arriving with
isFinal: false.AudioContext
Supply your own, if you already manage one.
Joining a call
joinCall resolves to { callId } and accepts either shape:
Controlling the call
method
Inject text as though the user had spoken it. Pass
deferResponse: true to
add context without prompting an immediate reply — useful for feeding in facts
mid-call.method
Send a structured message. Must include a
type, and the encoded payload must
stay under 1024 bytes.Client tools
Register a handler and the agent can call it during the conversation:Events
React
Requirements
Microphone access needs a secure context — HTTPS orlocalhost. It will not
work on a plain-HTTP staging domain.
Troubleshooting
Microphone permission denied
Microphone permission denied
Once denied, the browser will not ask again — the user must clear it in site
settings. Ask for permission on a click; requesting it on page load is
denied far more often, because the user has no idea what it is for yet.
Connection failed
Connection failed
Confirm the agent is
ACTIVE and the workspace has credits — an
out-of-credit workspace fails at call creation with 402. WebSocket URLs are
short-lived and single-use, so never cache one.Tools are not firing
Tools are not firing
Usually the tool
description, not the wiring — the model decides from that
text alone. Also check the name passed to registerTool matches the tool’s
modelToolName exactly.No audio out
No audio out
Browsers block autoplaying audio until the user interacts with the page.
Start the call from a real click.
Inline calls
Configure an agent per call, with no saved record.
Raw WebSocket
Skip the SDK and speak the protocol.