Skip to main content
Use the Vatel Python SDK to call the REST and WebSocket APIs from Python. The REST client exposes the API for your organization; the WebSocket connection is async-only for real-time sessions; you receive events and send input audio and tool results.

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

1

Install the SDK

Install from the repository:
2

Create a client

Create a Client with your organization API key. Optionally set a different host:
3

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="...").
4

Connect and stream messages

Connect with the token and iterate over incoming messages. Handle events and send tool results as needed:
5

Send audio

Send captured audio as base64-encoded PCM 16-bit, 24 000 Hz, mono:

REST API

The client exposes the REST API; see the API reference for all endpoints. Examples: List agents (sync and async):
Session token (required for the WebSocket):

Tool calls

When the server sends a tool_call message, run your logic and send the result back:

Message types (server → client)

Example app

The repo includes a full-duplex demo (mic → server, agent audio → speaker):