Session token
REST endpoint used to obtain a short-lived JWT for the WebSocket connection.
Connection
WebSocket channel, message types, and request/response flow.
Prerequisites
- Python 3.9+
- Organization API key from the Vatel dashboard
- Agent ID (agent UUID) for the agent you want to run the call with
Walkthrough
Get a session token
Generate a short-lived token for the WebSocket. Pass the agent UUID you want to run the call with:Async:
resp = await client.session.generate_token_async(agent_id="...").Connect and stream messages
Connect with the token and iterate over incoming messages. Handle events and send tool results as needed:
REST API
The client exposes the REST API; see the API reference for all endpoints. Examples: List agents (sync and async):Tool calls
When the server sends atool_call message, run your logic and send the result back:
Message types (server → client)
| Type | Description |
|---|---|
session_started | Call started; data.id is session ID |
session_ended | Call ended |
response_audio | Agent TTS chunk; data.audio base64, data.turn_id |
response_text | Agent text for the turn |
input_audio_transcript | Your speech (STT) |
speech_started / speech_stopped | VAD events |
interruption | You interrupted the agent |
tool_call | Server requests a tool; reply with send_tool_call_output |

