You need an organization API key (from the Vatel dashboard) and an agent ID for the agent you want to run. Session tokens are short-lived JWTs obtained via the API and used to open the WebSocket connection.
Choose your language
Python
REST and WebSocket with async support. Python 3.9+.
JavaScript / TypeScript
Node.js and browser. REST client and WebSocket session.
Go
Single client for REST and WebSocket. Go 1.21+.
WebSockets
Real-time voice sessions. Send audio, receive events, and handle tool calls.
API Reference
Full request/response details and all endpoints.
How it works
1
Get credentials and agent ID
Use your organization API key and the agent UUID from the dashboard (or from the REST API).
2
Obtain a session token
Call the session-token endpoint with your API key and agent ID. The token authorizes one WebSocket connection for that agent.
3
Connect and run the session
Open the WebSocket with the token, then send input audio (e.g. from a microphone) and handle incoming events: agent audio, transcripts, tool calls, and session lifecycle.
API reference
For full request/response details and all endpoints, see the API reference:Session token
Get a short-lived JWT for the WebSocket connection.
Connection
WebSocket URL, message types, and flow.
Next steps
Next.js example
Full Session WebSocket demo in Next.js: server-side token, real-time voice, and event display.

