X
xAI Realtime WebSocket API
Details
- URL
-
wss://api.x.ai/v1/realtime - Docs
- https://docs.x.ai/developers/model-capabilities/audio/ephemeral-tokens
Authentication
Authorization: Bearer <credential> Sign in to the xAI Console, then open API Keys and create an API key. Use it as a bearer token in the Authorization header: Bearer <your xAI API key>.
xAI ephemeral client secret bearer discovered
Authorization: Bearer <credential> /sec-websocket-protocol: xai-client-secret. <credential> Have your server call POST https://api.x.ai/v1/realtime/client_secrets using your regular xAI API key to mint a short-lived client secret, then pass that secret to your browser or mobile app for Voice Agent / Realtime connections. These tokens are created from the API described in Ephemeral Tokens.