Skip to content
Dashboard

TTS-1 HD

TTS-1 HD is the quality-optimized variant of OpenAI's text-to-speech family, generating more polished, natural-sounding audio than tts-1 for narration and produced content.

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-hd'),
text: 'Hello from the Vercel AI Gateway!',
voice: 'alloy',
});
await writeFile('speech.mp3', result.audio.uint8Array);

About TTS-1 HD

TTS-1 HD debuted on November 6, 2023 at OpenAI's first DevDay as the high-definition counterpart to tts-1. The two models share the same interface and voices; the difference is the optimization target. tts-1 favors real-time latency, while TTS-1 HD favors audio quality, producing more human-like speech in exchange for slower generation.

The voice lineup includes alloy, echo, fable, onyx, nova, and shimmer. Output formats cover MP3, Opus, AAC, and FLAC, with FLAC useful when the audio feeds a post-production pipeline. Playback speed is adjustable from 0.25x to 4x. Pricing is per character of input text.

Through AI Gateway, TTS-1 HD runs behind the same key, observability, and spend controls as the rest of your models. Call the AI SDK's generateSpeech function with this model's slug and store or serve the returned audio.