Skip to main content
POST

Authorizations

Authorization
string
header
required

Your AssemblyAI API key

Body

application/json
product
string
required

The product the token is minted for. Use streaming for Real-time STT.

Example:

"streaming"

expires_in_seconds
integer
required

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 rejects the session on the first frame. This does NOT cap the duration of the resulting streaming session — once the WebSocket is open the session runs for up to max_session_duration_seconds. The token is not single-use: until this window elapses, the same token can open multiple sessions, including concurrent sessions.

Required range: 1 <= x <= 600
Example:

60

max_session_duration_seconds
integer
default:10800

Maximum duration of the streaming session started with this token, in seconds. When the limit is reached, the session closes after the current turn ends, or up to 60 seconds later, and this extra time is billed. If you need to finalize work before the session ends, run a client-side timer using the value you passed here.

Required range: 60 <= x <= 10800
Example:

600

access
object

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.

Response

Successfully generated temporary token

token
string
required

The temporary authentication token

Example:

"your-temporary-token"

expires_in_seconds
integer
required

The token redemption window in seconds — the time the client has to use this token to open a WebSocket before it expires unused. This is not the session duration; see max_session_duration_seconds for that.

Example:

60