# Grok TTS

Grok TTS converts text into spoken audio with five expressive voices. Speech tags shape expression and delivery, and telephony codec support targets phone-system audio.

- **Model ID:** `spacexai/grok-tts`
- **Type:** speech
- **Providers:** xai
- **Context window:** Not applicable
- **Maximum output tokens:** 0
- **Pricing:** $15/1M input tokens
- **Canonical page:** https://vercel.com/ai-gateway/models/grok-tts

## Supported parameters

Detailed capability metadata has not been reported for this model.

## Example

```ts
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('spacexai/grok-tts'),
  text: 'Hello from the Vercel AI Gateway!',
  voice: 'eve',
});

await writeFile('speech.mp3', result.audio.uint8Array);
```

## About

Grok TTS is SpaceXAI'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

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.

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.warnings` during development.

## When to use

### Best For

- **Voiceovers and narration** converting articles, scripts, or docs into spoken audio files
- **Telephony and IVR audio** where codec support targets phone-system playback paths
- **Expressive delivery control** with five voices plus speech tags shaping tone and delivery
- **Spoken app responses** generated from a server route with one call

### Consider Alternatives When

- **Two-way voice sessions** where `grok-voice-think-fast-1.0` streams speech in and out in real time
- **Audio transcription** where `grok-stt` converts recorded audio into text instead
- **Streamed audio playback** since AI Gateway returns complete audio files rather than progressive streams

## 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

- **Two-Way Voice Sessions:** `grok-voice-think-fast-1.0` streams speech in and out in real time
- **Audio Transcription:** `grok-stt` converts recorded audio into text instead
- **Streamed Audio Playback:** AI Gateway returns complete audio files rather than progressive streams

## Frequently asked questions

### How many voices does Grok TTS offer?

Grok TTS offers five expressive voices, such as `eve`. Set the `voice` option in `generateSpeech` to choose one.

### What are speech tags in Grok TTS?

Speech tags are controls for expression and delivery in generated speech. Combined with the expressive voices, they let you adjust how Grok TTS reads your text.

### What audio formats does Grok TTS support?

Set `outputFormat` to a format like `mp3` or `wav`. Grok TTS also supports telephony codecs for phone-system audio, and unsupported options are reported in `warnings`.

### How do I generate speech with Grok TTS?

Use the AI SDK's `experimental_generateSpeech` function with your text, a `voice`, and an `outputFormat`, then save `result.audio.uint8Array`. A REST endpoint returns base64-encoded audio if you're not using the AI SDK.

### What does Grok TTS cost?

Billing is per input character, so cost scales with text length. See the pricing panel on this page for current rates.

### How do I authenticate with Grok TTS through Vercel AI Gateway?

Use your Vercel AI Gateway API key with `spacexai/grok-tts` as the model identifier. AI Gateway handles provider routing automatically.

### Does Vercel AI Gateway support Zero Data Retention for Grok TTS?

Yes, Zero Data Retention is available for this model. Zero Data Retention is offered on a per-provider basis. See https://vercel.com/docs/ai-gateway/capabilities/zdr for details.

## Links

- [Model page](https://vercel.com/ai-gateway/models/grok-tts)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://docs.x.ai/developers/model-capabilities/audio/text-to-speech)
