Grok TTS
Grok TTS is xAI's text-to-speech model with five expressive voices, speech tags, and telephony codec support, available through Vercel AI Gateway.
import { experimental_generateSpeech as generateSpeech } from 'ai';import { gateway } from '@ai-sdk/gateway';import { writeFile } from 'node:fs/promises';
const result = await generateSpeech({ model: gateway.speechModel('xai/grok-tts'), text: 'Hello from the Vercel AI Gateway!', voice: 'eve',});
await writeFile('speech.mp3', result.audio.uint8Array);Playground
Try out Grok TTS by xAI. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Your generated audio will appear here
Providers
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
| Provider |
|---|
More models by xAI
| Model |
|---|
About Grok TTS
Grok TTS is xAI's text-to-speech model, released March 16, 2026 and available through AI Gateway. Five expressive voices cover different tones and characters. Speech tags give you control over expression and delivery, and telephony codec support makes Grok TTS a fit for phone systems and IVR flows. Text to speech through AI Gateway is in beta, so access is rolling out gradually.
Integration uses the AI SDK's experimental_generateSpeech function, available on the canary releases of the AI SDK. Set the voice, such as eve, and an outputFormat like mp3 or wav. Optional instructions, speed, and language settings adjust how the speech sounds. Unsupported options surface in warnings on the result instead of failing the request. A REST endpoint returns base64-encoded audio if you're not using the AI SDK.
Billing is per input character, so cost scales with the length of the text you synthesize. See the pricing panel on this page for current rates. For live conversation, grok-voice-think-fast-1.0 streams speech both ways, and grok-stt covers the transcription direction.
What To Consider When Choosing a Provider
- Configuration: Audio returns base64-encoded in a single response through AI Gateway. Streaming audio output isn't supported, so progressive playback needs buffering on your side. Billing is per input character, and long documents scale cost linearly with text length.
- Configuration: Text to speech is in beta, and AI SDK support ships on canary releases. Voice and option support can vary, and unsupported options come back as warnings rather than errors, so check
result.warningsduring development. - Zero Data Retention: AI Gateway does not currently support Zero Data Retention for this model. See the documentation for models that support ZDR.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
When to Use Grok TTS
Best for
- Voiceovers and Narration: Convert articles, scripts, or docs into spoken audio files
- Telephony and IVR Audio: Codec support targets phone-system playback paths
- Expressive Delivery Control: Five voices plus speech tags shape tone and delivery
- Spoken App Responses: Generate audio replies from a server route with one call
Consider alternatives when
- Two-Way Voice Sessions:
grok-voice-think-fast-1.0streams speech in and out in real time - Audio Transcription:
grok-sttconverts recorded audio into text instead - Streamed Audio Playback: AI Gateway returns complete audio files rather than progressive streams
Conclusion
Grok TTS turns text into expressive spoken audio through AI Gateway. Five voices, speech tags, and telephony codec support cover narration, app responses, and phone systems. Call the AI SDK's generateSpeech function with a voice and output format, and check current per-character rates on this page.