API Reference
Generate WebRTC Token
Generate a LiveKit WebRTC token and dispatch a voice agent for in-browser calls
POST
Generate WebRTC Token
Generate a LiveKit-compatible WebRTC token and dispatch a voice agent. Use this token to connect a browser or mobile client directly to a Vaani voice agent over a real-time audio channel — no phone number required.Parameters
UUID (or name) of the agent to dispatch. Either
agent_id or agent_name is required.Display name of the agent. Either
agent_id or agent_name is required.Voice gender preset:
"male" | "female".Primary language code for the session (e.g.
"en", "hi").Fallback language code for the session.
Custom greeting the agent speaks when the call connects. Overrides the agent’s default greeting.
Whether the welcome message can be interrupted by the user speaking.
Enable background noise for the session.
Background noise volume (0–100).
Speech speed multiplier (0.6–1.4).
Override the LiveKit server WebSocket URL (advanced — leave unset to use the default).
Environment flag passed to the internal backend (advanced use).
Arbitrary metadata key-value pairs forwarded to the agent session.
Request Example
Response
Short-lived LiveKit JWT. Pass this to the LiveKit client SDK to connect.
The LiveKit room the agent has been dispatched to. The token grants access to this room only.
Agent identifier that was dispatched.
LiveKit server WebSocket URL (
wss://...). Use this as the server URL in the LiveKit client SDK.Connecting in the Browser
Use the LiveKit JavaScript SDK to connect:Tokens are single-use and short-lived. Generate a new token for each call session.

