# TTS-1

TTS-1 converts text to natural-sounding speech with latency low enough for interactive products. Pick a built-in voice, choose an output format such as MP3, and add spoken audio to your app.

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

## 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('openai/tts-1'),
  text: 'Hello from the Vercel AI Gateway!',
  voice: 'alloy',
});

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

## About

TTS-1 debuted on November 6, 2023 at OpenAI's first DevDay, alongside GPT-4 Turbo and the DALL-E 3 API. The release included two variants: TTS-1, optimized for real-time use, and `tts-1-hd`, optimized for audio quality.

The model ships with built-in voices, including `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`, each with a distinct character. Output formats cover MP3, Opus, AAC, and FLAC, and playback speed is adjustable from 0.25x to 4x. Pricing is per character of input text, which keeps cost estimation simple: count the characters in your script.

Through AI Gateway, you call TTS-1 with the AI SDK's `generateSpeech` function. The result returns audio data you can save, serve, or play directly, all behind AI Gateway's authentication, observability, and spend controls.

## What to consider

Audio support on AI Gateway is in beta. Speech generation runs through the AI SDK's `generateSpeech` function, where you set the text, a voice such as `alloy`, and an output format. If you're producing narration or other polished audio rather than interactive responses, `tts-1-hd` trades some speed for higher audio quality.

## When to use

### Best For

- Voice responses in interactive apps where speed beats studio polish
- Reading interfaces and accessibility features that speak on demand
- Notifications, IVR prompts, and short-form audio generated at request time
- Prototyping voice output before committing to a full realtime stack

### Consider Alternatives When

- Audio quality is the product; `tts-1-hd` produces more polished speech at higher latency
- You need a live two-way conversation; the gpt-realtime family handles speech-to-speech directly
- The workflow starts from audio rather than text; `gpt-4o-transcribe` and `whisper-1` cover transcription

## Best for

- **Interactive voice responses:** Low-latency speech for apps where speed beats studio polish
- **Accessibility features:** Reading interfaces that speak content on demand
- **Request-time audio:** Notifications, IVR prompts, and short-form clips generated as needed
- **Voice output prototyping:** Testing spoken interfaces before committing to a realtime stack

## Consider alternatives

- **Polished audio production:** `tts-1-hd` delivers higher audio quality when latency is negotiable
- **Two-way voice conversation:** The gpt-realtime family handles live speech-to-speech directly
- **Audio-first workflows:** `gpt-4o-transcribe` and `whisper-1` cover the transcription direction

## Frequently asked questions

### How do I generate speech with TTS-1 through AI Gateway?

Use the AI SDK's `generateSpeech` function from the `ai` package with this model's slug, your text, and a voice. Audio support on AI Gateway is in beta. Authenticate with an AI Gateway API key or OIDC token.

### What voices does TTS-1 offer?

Built-in voices include `alloy`, `echo`, `fable`, `onyx`, `nova`, and `shimmer`. Each has a distinct character, so test a few against your product's tone before shipping.

### What output formats does TTS-1 support?

MP3, Opus, AAC, and FLAC. Opus suits low-bandwidth streaming contexts, AAC targets broad device compatibility, and FLAC is lossless for post-processing pipelines.

### How does TTS-1 differ from tts-1-hd?

TTS-1 is optimized for real-time use and lower latency. TTS-1 HD is optimized for audio quality and suits narration or produced content where generation time is less important.

### How is TTS-1 priced?

Speech generation is billed by characters of input text. Current rates are listed on this page and update when providers change list prices.

### Does TTS-1 support zero data retention through AI Gateway?

Zero Data Retention is not currently 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.

### What are typical latency characteristics?

This page shows live performance metrics measured across real AI Gateway traffic.

## Links

- [Model page](https://vercel.com/ai-gateway/models/tts-1)
- [AI Gateway documentation](https://vercel.com/docs/ai-gateway)
- [Provider model documentation](https://developers.openai.com/api/docs/models/tts-1)
