Skip to main content
POST
Mint realtime voice session

Authorizations

Authorization
string
header
required

Your AI Reserve API key (aireserve_api_…) from the API Keys page in the portal (https://portal.aireserve.com/keys).

Body

application/json
model
enum<string>
required

Must be grok-voice.

Available options:
grok-voice
voice
string
required

Voice to use for this session. Pass a built-in voice ID (from GET /v1/voices) or one of your organization's custom voice IDs. Defaults to ara when omitted. Voice is locked at mint and cannot change mid-session.

Response

Session minted. Connect the WebSocket before expires_at.

Realtime session mint response. Use wss_url and ephemeral_key to open the WebSocket.

session_id
string<uuid>
required

Unique session identifier used for billing and logging.

model
enum<string>
required
Available options:
grok-voice
voice
string
required

Voice bound to this session (cannot change mid-session).

wss_url
string
required

Environment-specific WebSocket URL returned by the session mint; use it verbatim.

Example:

"wss://voice-relay-uat-abcdefg-ue.a.run.app/v1/realtime?model=grok-voice"

ephemeral_key
string
required

HMAC-SHA-256 signed opaque one-use relay ticket. Encodes expiry and a random nonce only — voice authorization is stored in the session record keyed by this ticket's SHA-256 hash, not in the token itself. Valid until expires_at; consumed on first successful connection (replay rejected). Do not log or share.

expires_at
string<date-time>
required

Timestamp after which ephemeral_key is rejected. Connect promptly — key_ttl_seconds is short by design.

key_ttl_seconds
integer
required

Seconds from mint until ephemeral_key expires (300 s / 5 min).

max_session_seconds
integer
required

Hard session length ceiling enforced by the relay (3,540 s). Mint a new session to continue.

browser_subprotocols
string[]
required

Pass this array verbatim as the WebSocket subprotocols from a browser (browsers cannot set Authorization headers). Server-side callers should use Authorization: Bearer <ephemeral_key> instead.