Skip to content

Grok Voice

Two different things share the word Voice.

Product Voice is "Talk to Grok hands-free with voice" on grok.com and the iOS / Android apps (docs.x.ai/grok/overview).

Voice API is the developer stack at docs.x.ai/developers/model-capabilities/audio/voice: Speech to Speech, Text to Speech, Speech to Text, and custom voices.

This page maps both. It is not Grok Build.

Goals and non-goals

Audience: people who want to talk to Grok, or ship voice in their own app.

Goals: keep product Voice and the Voice API in separate boxes; list official endpoints; mark missing product-UI detail as TODO.

Non-goals: a full realtime event reference, invented app-button paths, or third-party voice-arena rankings as product specs.

Product Voice (grok.com / apps)

What official pages actually say:

FactSource
Hands-free voice is a first-class Grok capabilityoverview
"Natural voice conversations with low-latency back and forth" / "sub-second latency"x.ai/grok
Available on web, iOS, and Android with synced historyoverview, x.ai/grok
Voice is one slice of the weekly SuperGrok usage pool (with Chat, Imagine, Build, API)FAQ
After the paid weekly cap, free-tier Chat and Voice limits still work and reset on their own scheduleFAQ

TODO — product Voice UI (not on docs.x.ai / x.ai / grok.com as a walkthrough):

  • Which control starts Voice on grok.com vs iOS vs Android (mic button, mode switcher, lock-screen, etc.).
  • Whether product Voice exposes the API voice roster (eve, ara, …) or a shorter in-app set.
  • Whether product Voice can call Connectors mid-call.
  • Barge-in, transcripts, language picker, and Companion overlap (Companions are iOS-only per the FAQ; that is not the same feature as Voice).

Until those pages exist, do not invent a click-path. Open grok.com or the Grok app and use the in-product Voice control you actually see.

Product Voice is a chat capability. For a teammate that keeps working on a cloud VM, use Grok Bot.

Voice API

Official stack (voice overview, x.ai/api/voice):

SurfaceJobOfficial entry
Speech to Speech (Realtime)Full-duplex voice agent, tools, barge-inwss://api.x.ai/v1/realtime?model=grok-voice-latest
Text to SpeechText → audioPOST https://api.x.ai/v1/tts and wss://api.x.ai/v1/tts
Speech to TextAudio → textPOST https://api.x.ai/v1/stt and wss://api.x.ai/v1/stt
Custom voicesClone from a short clip, then pass voice_idPOST https://api.x.ai/v1/custom-voices

Audio is processed in real time and never stored or used for training (voice overview). Same enterprise bullets as Imagine: SOC 2 Type II, HIPAA eligible, GDPR, data residency, SSO & RBAC.

Official prices live on developers/models (Speech to Speech, TTS per 1M characters, STT REST vs streaming). x.ai/api/voice also lists marketing numbers — when they disagree with docs.x.ai, trust docs.x.ai.

Text to Speech

Convert text to spoken audio (text-to-speech). Default voice is eve. Voice IDs are case-insensitive.

bash
curl -X POST https://api.x.ai/v1/tts \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Hello! Welcome to the xAI Text to Speech API.",
    "voice_id": "eve",
    "language": "en"
  }' \
  --output hello.mp3

Official knobs worth knowing:

  • text — required, max 15,000 characters on unary POST /v1/tts. WebSocket has no total cap (each text.delta still ≤ 15,000).
  • language — required. BCP-47 or auto. Table on the TTS page lists 20 codes (en, zh, pt-BR, …).
  • output_format — default MP3 24 kHz / 128 kbps. Codecs: mp3, wav, pcm, mulaw, alaw.
  • speed0.71.5.
  • Speech tags — inline [pause] / [laugh], wrapping <whisper>…</whisper>.
  • replace — pronunciation map (respelling or IPA), applied before synthesis. Billing stays on the text you sent.
  • with_timestamps — JSON envelope with base64 audio + per-character timings.
  • List voices: GET https://api.x.ai/v1/tts/voices.
  • Never call TTS from the browser with your API key. Proxy it.

Streaming: wss://api.x.ai/v1/tts, up to 50 concurrent sessions per team.

Playground: console.x.ai text-to-speech.

Speech to Text

Transcribe a file or a stream (speech-to-text).

bash
curl -X POST https://api.x.ai/v1/stt \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -F format=true \
  -F language=en \
  -F file=@audio.mp3

Official limits: file or url required; file last in the multipart body; max 500 MB. Optional: word timestamps, diarize, multichannel (up to 8 channels), keyterm, filler_words, Inverse Text Normalization (format=true + language). Streaming: wss://api.x.ai/v1/stt with Smart Turn end-of-turn detection.

The Voice overview says 25 languages for STT; the STT page lists a concrete formatting-language table. Do not collapse those two sentences into one number in a table you invent — link the page.

Speech to Speech (Realtime)

Build a voice agent over WebSocket (speech-to-speech).

javascript
import WebSocket from "ws";

const ws = new WebSocket("wss://api.x.ai/v1/realtime?model=grok-voice-latest", {
  headers: { Authorization: `Bearer ${process.env.XAI_API_KEY}` },
});

ws.on("open", () => {
  ws.send(JSON.stringify({
    type: "session.update",
    session: {
      voice: "eve",
      instructions: "You are a helpful customer support agent.",
      turn_detection: { type: "server_vad" },
      tools: [{ type: "web_search" }],
    },
  }));
});

Official model slugs:

SlugMeaning
grok-voice-latestAlias for grok-voice-think-fast-2.0
grok-voice-think-fast-2.0Flagship voice model
grok-voice-think-fast-1.0Previous generation

Client-side apps should use ephemeral tokens so the API key never hits the browser. Browsers cannot set WebSocket headers; pass xai-client-secret.<token> as the protocol.

Server-side tools on the session: file_search, web_search, x_search, mcp. Client-side: custom function tools. Session resumption is opt-in (resumption.enabled), keyed by conversation_id, dropped after 30 minutes of inactivity.

Demo apps from the docs: Web Agent, WebRTC, Twilio, iOS tester.

Custom voices

Clone from a reference clip (max 120s on the Voice overview; x.ai/api/voice says "two minutes"). The resulting voice_id works on TTS, streaming TTS, and Speech to Speech.

When to use which

You wantUse
Talk to Grok with your hands freeProduct Voice on grok.com / the Grok app
Narrate text, captions, telephony promptsTTS API
Transcribe a meeting or a live streamSTT API
A voice agent that searches / calls toolsSpeech to Speech API
A named teammate on a cloud computerGrok Bot, not Voice

Common pitfalls

  • Shipping the API key in a browser Voice widget. Use ephemeral tokens or a backend proxy.
  • Mixing product Voice (subscription weekly pool) with Voice API (API credits / team billing).
  • Sending response.create before playback finishes after a tool call — official Speech-to-Speech docs warn this overlaps audio.
  • Inventing an in-app settings path for choosing eve vs ara. TODO until xAI documents product Voice UI.

Official docs

PageUse
docs.x.ai/grok/overviewProduct Voice one-liner
docs.x.ai/grok/faqWeekly pool, free-tier Voice after cap
docs.x.ai/developers/model-capabilities/audio/voiceAPI stack
text-to-speechTTS
speech-to-textSTT
speech-to-speechRealtime
custom-voicesClone a voice
x.ai/api/voiceAPI marketing + live demos
x.ai/grokProduct marketing

Built for frontend engineers · Powered by VitePress