wss://x.kupe.in/agents/v1/realtime (same agents host as telephony media — not the LiveKit root on x.kupe.in).
The session always runs Kupe STT, TTS, and LLM. Voices are addressed by sanitized name (priya) or voice id (copy it from the voice library). Tools attached to the agent run server-side. This path is web-only — it does not write telephony minutes.
Run it in a terminal
Mint
POST /v1/realtime/sessions
Identify the agent with either name or agent_id (copy the id from the agent editor). If name does not exist in the project, Kupe creates the agent with the prompt, greeting, voice, and tools you pass.
string
Agent name. Reuses a live agent with this name, or creates one.
string
Existing agent id. Alias:
id. Optional when name is set.string
Voice name or voice id. Alias:
voice_id. Overrides the agent’s voice for this session.string
Alias for
voice — library voice_id or row id.string
System prompt. Alias:
instructions. Saved on a newly created agent; overlays this session for an existing one.string
Spoken first message. Alias:
greetings.array
OpenAI-style function tools, or webhook/MCP tools (
http_url, type: "mcp").object
MCP server:
{ url, headers?, tools? } where tools are names or full defs. Same as passing MCP items in tools.object
Values for
{{placeholders}} in the prompt and greeting.string
Optional when using an API key (
GET /v1/me already has it).string
Optional when using an API key.
client_secret.value (single-use ticket), websocket_url, and the resolved agent_id.
Connect
Authorization: Bearer {secret} on the WebSocket handshake instead of the query string. ticket is an alias for client_secret.
The SDK helper does this for you:
session.created with instructions, voice, tools, and pcm16 in/out formats.
Client → server
Text-turn example (what
send_text encodes):
input_audio_buffer.append frames; server VAD emits speech start/stop and runs the turn.
Server → client
Every event hasevent_id and type. Audio deltas are base64 PCM16.
The socket may also send dashboard-shaped
{ "kind": "transcript" | "latency" | "tool_call", ... } frames on the same connection.
Close codes
LiveKit web sessions
For the in-app web tester (room + JWT, not this WS), usePOST /v1/sessions with channel: "web". That returns a LiveKit ws_url and participant token. Realtime mint + /v1/realtime is the API you want from Python, TypeScript, or cURL.
