Session token
API reference for the session-token request and response fields.
JavaScript SDK
Package install and SDK entry points.
Connection (message types)
WebSocket Session message catalog. WebRTCSession uses the same event names for signaling except it does not emit
response_audio (agent speech is only on the WebRTC audio path into remoteAudioContainer).Prerequisites
- @vatel/sdk
- Organization API key on the server only, agent UUID, WebRTC enabled on your stack
generateSessionToken (WebRTC)
Connect WebRTCSession (client)
Session events
WebRTCSession uses the same signaling-style events as a WebSocket Session, exceptresponse_audio is not fired - agent audio is delivered only as a remote media stream (attach with remoteAudioContainer or your own playback). Subscribe with session.on(eventName, (msg) => { ... }). Each msg has type, timestamp, and data (fields depend on type).
For base64
response_audio chunks, use a WebSocket Session instead of WebRTCSession.
Reply to tools with session.sendToolCallOutput(toolCallId, outputString) (async in some builds; use .catch(...) if needed).

