Skip to content
Dashboard

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.

Speech
index.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

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.