Generate temporary Voice Agent token
<llms-only>
> For the complete documentation index, see [llms.txt](https://www.assemblyai.com/docs/llms.txt)
</llms-only>
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](https://www.assemblyai.com/docs/voice-agents/voice-agent-api/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.
Query parameters
expires_in_seconds
How long the token is valid before it must be used to open a WebSocket connection, in seconds.
max_session_duration_seconds
Maximum duration of the Voice Agent session started with this token, in seconds.
Response
Successfully generated a temporary token.
token
The temporary authentication token. Pass as the token query parameter when opening the WebSocket.
expires_in_seconds
The actual expiration time of the token in seconds.
Errors
400
Bad Request Error
401
Unauthorized Error
429
Too Many Requests Error
500
Internal Server Error