Generate voice agent token
Generate a temporary authentication token for the Voice Agent API. Use this to connect browser or other client-side applications to the Voice Agent API without exposing your permanent API key. See Browser integration for the full flow.
Each token is one-time use and can only be used for a single session. All usage is attributed to the API key that generated the token.
Authorizations
Body
Token redemption window, in seconds. The token must be used to open a WebSocket connection within this window. If the window has elapsed when the WebSocket is opened, the server returns a session.error with code unauthorized on the first frame instead of session.ready. This does NOT cap the duration of the resulting voice agent session — once the WebSocket is open the session runs for up to max_session_duration_seconds.
1 <= x <= 600300
Optional per-product settings that narrow what the token can open, keyed by product name. Products you leave out are not restricted. See Temporary tokens for a tutorial.
Maximum duration of the Voice Agent session started with this token, in seconds. There is no "closing soon" warning event before the session ends, so if you need to finalize gracefully (e.g. play a wrap-up message, save state), run a client-side timer using the value you passed here.
60 <= x <= 108008640
Response
Successfully generated a temporary token.