Skip to main content
WSS
agent_id
type:string
required

ID of the deployed Line agent to connect to.

cartesia_version
type:string
required

API version, e.g. 2026-03-01

X-API-Key
type:httpApiKey

Use an API key when you're calling from a trusted server.

access_token
type:httpApiKey

Use a short-lived access token when calling from a browser or client app. Learn more here.

Start Event
type:object

Initializes the stream. This must be the first message sent — the server closes the connection if any other event arrives first.

Media Input Event
type:object

Streams user audio to the agent. Send chunks continuously (for example every 20–100 ms) for the best latency. media.payload must be base64-encoded audio in the format declared in start.config.input_format.

DTMF Event
type:object

Sends a DTMF (dual-tone multi-frequency) tone to the agent.

Custom Event
type:object

Sends arbitrary metadata to the agent mid-call. The agent receives the payload as a custom event in its handler.

Ack Event
type:object

Confirms the stream configuration. Echoes back the resolved config and agent overrides, and returns a server-generated stream_id if one wasn't provided in start.

Media Output Event
type:object

Agent audio. media.payload is base64-encoded audio in the agent's configured output format.

Clear Event
type:object

The agent is interrupting itself — for example, because the user started speaking. Stop playing any buffered audio for this stream.

Transfer Call Event
type:object

The agent wants to transfer the call to a phone number. The client is responsible for initiating the transfer on its telephony side.