Generate session token
Get credentials to start a voice or chat session with an agent. Specify agent_id and optionally the agent version, transport (websocket or webrtc), opening message, prompt, chat access, and custom variables.
Authorizations
Send your organization API key as Authorization: Bearer <key>.
Body
UUID of the agent that will run this voice session.
Agent version to use. If omitted, the active published version is used.
Existing chat to continue in this session.
websocket for voice over the platform WebSocket API (default). webrtc for WebRTC; the response includes room connection details.
websocket, webrtc Opening line the agent uses for this session.
System instructions for the agent for this session.
Also allow access to the chat API for this session.
Custom key-value data available to the agent in this session.
Response
Session credentials.
Connection credentials for the session.
Credential for voice WebSocket, WebRTC setup, or chat API as applicable.
Room name for WebRTC. Returned when transport is webrtc.
Your participant id for WebRTC. Returned when transport is webrtc.
Media server URL for WebRTC. Returned when transport is webrtc.
Credential to join the WebRTC media room. Returned when transport is webrtc.

