O

OpenAI TTS

Text-to-Speech

by OpenAI

OpenAI's TTS API with natural-sounding voices, real-time streaming, and multiple quality tiers.

Registration & API Key Steps

1

Create OpenAI Account

Same account as DALL-E and Whisper.

Open link
2

Get API Key

Generate an API key from account settings.

Open link
3

Choose Voice & Model

Choose from 13 voices and 3 model tiers (tts-1, tts-1-hd, gpt-4o-mini-tts).

Pricing

TierPriceFeatures
TTS Standard$15.00 / 1M charactersGood quality, Low latency, Streaming, 13 voices
TTS HD$30.00 / 1M charactersPremium quality, Higher fidelity, Professional content
GPT-4o Mini TTS$0.60/1M input + $12/1M output tokens~$0.015/min, Controllable expressions, Advanced features

Application Tips

Stream for Low Latency

Use streaming endpoint to play audio before full generation. Great for real-time apps.

Choose Voice Wisely

"nova"/"shimmer" more feminine, "onyx"/"echo" more masculine, "alloy" neutral.

China Access Solutions

API Proxy

Use same OpenAI proxy services.

Code Example

JavaScript / TypeScript
import OpenAI from 'openai';
import fs from 'fs';

const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });

async function generateSpeech() {
  const mp3 = await openai.audio.speech.create({
    model: 'tts-1-hd',
    voice: 'nova',
    input: 'Welcome to our platform powered by AI.',
    response_format: 'mp3',
    speed: 1.0,
  });
  const buffer = Buffer.from(await mp3.arrayBuffer());
  fs.writeFileSync('speech.mp3', buffer);
}

generateSpeech();

Rate Limits

TierLimits
Tier 150 RPM
Tier 3+500+ RPM

Recommended Use Cases

Voice assistantsAudiobook productionAccessibilityLanguage learningIVR systems
Last Updated: 2025-02

Related API Guides