Agent WebSocket
A bidirectional session with an Atoms agent. Mint an access token, open the connection with it, and the server creates a session, bridges audio and transcripts to the STT/LLM/TTS pipeline, and streams events back until the client closes or the server ends the session.
Post-call, the full conversation (transcript + recording) is available
at GET /atoms/v1/conversation/{callId} using the call_id from
session.created.
Connection
Recommended: short-lived token flow
-
Register the call. Call
POST /conversation/register-call(see the Register Call reference in this section) with your API key in theAuthorization: Bearer <key>header and theagent_id(plus optionalmodeandvariables) in the body. It returns a short-lived, single-useaccess_token(prefixedwct_, valid forexpires_inseconds). -
Open the WebSocket with only the token:
agent_id,mode, andvariablesare already baked into the token — don’t pass them on the URL.
This keeps your API key server-side; the browser only ever holds the short-lived token.
Alternative: connect with your API key directly
You can also connect with a raw API key — ?token=<sk_key> or
Authorization: Bearer <sk_key> — plus the query params below. This is
convenient for server-side or trusted clients. For browser / client-side
apps, prefer the token flow above so your API key is never exposed.
* token or Authorization: Bearer <key> — not both.
Connection errors
- 401 Unauthorized — invalid or missing token/API key, expired or
already-used
wct_token, oragent_idnot found. - 503 Service Unavailable — server is gracefully draining. The HTTP upgrade is rejected before the WebSocket handshake completes. Clients should retry with exponential backoff.
Example: register a call, then connect (recommended)
Example: connect with your API key directly
Handshake
Authentication
API key from the console ApiKey collection, sent as Bearer token. Also accepts session cookies for browser-based auth.