TTS-1
TTS-1 is OpenAI's text-to-speech model optimized for real-time use, converting text into natural-sounding audio across built-in voices and multiple output formats at low latency.
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);Playground
Try out TTS-1 by OpenAI. 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 OpenAI
| Model |
|---|
About TTS-1
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 When Choosing a Provider
- Configuration: Audio support on AI Gateway is in beta. Speech generation runs through the AI SDK's
generateSpeechfunction, where you set the text, a voice such asalloy, and an output format. If you're producing narration or other polished audio rather than interactive responses,tts-1-hdtrades some speed for higher audio quality. - 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 TTS-1
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 when
- Polished audio production:
tts-1-hddelivers 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-transcribeandwhisper-1cover the transcription direction
Conclusion
TTS-1 is the fast, economical way to give your app a voice through AI Gateway. Use TTS-1 for interactive and request-time speech, and switch to tts-1-hd when the audio itself is the deliverable.