Skip to main content
POST
Create a WebSocket voice session
For a server integration, supply an agent_id owned by the API key or OAuth account. A paired Eigi board can instead present its device token and use its own agent without supplying an ID. A key-bound board must also send a fresh DPoP proof.
Connect a Pipecat WebSocket client to the exact ws_url returned, including its query string. Send the returned token as a Bearer credential during the WebSocket handshake. It is single-use. Use expires_in (seconds) to decide whether to request a fresh session. The socket exchanges protobuf frames for audio and RTVI messages.

Offer tools the device can run

Omit client_tools to offer the agent’s enabled client tools. Send [] to offer none, or send up to 32 names or definitions. A device-declared definition uses a name, description, and a JSON Schema object for its parameters. A definition with the same name as an agent client tool overrides it for this session.
Check client_tools, declared_client_tools, and unknown_client_tools in the response to see which handlers were registered. Keep secrets out of conversation_metadata. It is limited to 4 KB and travels in the connection URL.

Authorizations

X-API-Key
string
header
required

Studio API key for server-side requests.

Headers

DPoP
string

Fresh proof required for a key-bound board.

Body

application/json
agent_id
string

Required for API key and OAuth callers. A paired board may omit it to use its own agent.

conversation_metadata
object

Dynamic variables, up to 4 KB. Included in the connection URL.

is_test_call
boolean
default:false
client_tools
(string | object)[]

Omit to offer all enabled client tools, or send an empty array to offer none.

Maximum array length: 32
scheduled_notification
object
board_notes
string

Notes from a paired board, up to 2 KiB. Ignored for API key and OAuth calls.

Response

Successful request

conversation_id
string
required
ws_url
string
required
token
string
required

Single-use credential for the socket.

expires_in
integer
required

Token lifetime in seconds.

id
string
details
string
client_tools
string[]
declared_client_tools
string[]
unknown_client_tools
string[]
scheduled_notification
object | null