Realtime Voice

Connect directly to wss://api.x.ai/v1/realtime for native speech-to-speech. Use grok-voice-latest as the rolling alias or pin grok-voice-think-fast-2.0 for reproducibility.

CLI

progrok live   --model grok-voice-think-fast-2.0   --reasoning medium   --event '{"type":"session.update","session":{"voice":"eve","resumption":{"enabled":true}}}'   --once

progrok live bridges NDJSON stdin/stdout. It supports --conversation-id, repeatable --event, --no-stdin, and --once; it does not capture microphone audio.

Protocol

Query parameters include model, call_id, conversation_id, and reasoning.effort. Sessions cover audio formats and transport, VAD, resumption, pronunciation replacement, function and hosted tools, MCP, DTMF, cancellation, and automatic ping/pong.

Browser-direct authentication

async function connectRealtime() {
  const response = await fetch("/v1/realtime/client_secrets", {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({ expires_after: { seconds: 300 } }),
    cache: "no-store",
  });
  if (!response.ok) throw new Error("secret mint failed: " + response.status);
  const secret = await response.json();
  return new WebSocket(
    "wss://api.x.ai/v1/realtime?model=grok-voice-think-fast-2.0",
    ["xai-client-secret." + secret.value],
  );
}

Mint inside the connection function. A secret opens exactly one connection, so every reconnect needs a fresh secret. Never cache or reuse it, and never expose the OAuth access or refresh token to browser code.