Voice · API Reference

Mint Voice Token

Mints an ephemeral token that a browser can use to open a Voice WebSocket without exposing your long-lived API key. Tokens expire in ~60 seconds and are bound to a single agent. Pass the `agentId` from the response in the WebSocket URL (`/voice/{agentId}?token=…`). You can also provide an inline `agent` config instead of a stored `agentId`.

POST/v1/voice/tokens
Scope:voice:connect
Request Body
agentId
stringoptional

ID of a stored agent to run for the session. Provide this OR `agent`.

agent
objectoptional

Inline agent config for the session. Use instead of `agentId`.

Responses
{
  "token": "evt_xxxxx.yyyyy",
  "expiresIn": 60,
  "agentId": "agt_xxxxxxxxxxxx"
}
PlaygroundPOST
Authorization

Body

agentIdoptional
agentoptional