Skip to main content
POST
Create realtime client token
See Client-side streaming with client tokens for the complete server-to-browser flow and supported WebSocket addresses.

Authorizations

Authorization
string
header
required

Your API key: Authorization: Bearer aircaps_sk_...

Body

application/json

Optional. Omit the body or expires_in to use the 3,600-second default.

expires_in
integer
default:3600

Token lifetime in seconds. Use a short lifetime when the browser will connect immediately. Expiry prevents new connections; it does not end an already-open stream.

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

60

Response

Token created.

object
enum<string>
required
Available options:
realtime_token
token
string
required

Credential for the /v1/realtime WebSocket, passed as the token query parameter. Keep it out of logs.

Example:

"aircaps_rt_..."

expires_at
string<date-time>
required

Expiry time in UTC. Authenticate a new session before this time.

expires_in
integer
required

Remaining lifetime in seconds at response time; it may be slightly shorter than the requested lifetime.

Example:

60