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.
- Input price
- Input $15, Per 1M characters
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);Copy link to headingPlayground
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
Copy link to headingProviders
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 |
|---|
Copy link to headingAbout 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.
Copy link to headingWhat 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: Zero Data Retention is offered on a per-provider and model basis. See the documentation for details.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
Copy link to headingWhen 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
Copy link to headingConclusion
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.
Copy link to headingFrequently Asked Questions
How do I generate speech with TTS-1 through AI Gateway?
Use the AI SDK's
generateSpeechfunction from theaipackage 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, andshimmer. 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.