Skip to main content
POST
Create Speech
Generate high-quality speech audio from text using our collection of state-of-the-art text-to-speech models from leading AI providers.

Create Speech

POST /audio/speech Convert text to natural-sounding speech audio.

Request Body

string
required
The TTS model to use for speech generation (e.g., “tts-1”, “tts-1-hd”, “elevenlabs”)

Text Input Parameters

string
The text to convert to speech (1-4096 characters)

Voice Parameters

string
Voice name or ID for speech generation

Common Parameters

string
The audio format for the generated speech (“mp3”, “opus”, “aac”, “flac”, “wav”, “pcm”)
number
The speed of the generated audio (0.25 to 4.0 for most models, default: 1.0)
number
Temperature for randomness in speech generation (0.0 to 2.0)

Advanced Parameters

string
GPT-4o Mini TTS: Additional instructions to control voice characteristics
string
Dia model: Speaker transcript for enhanced voice control (max 1000 chars)
integer
Dia model: CFG filter top k value (15-50)
integer
Dia model: CFG scale value for generation control (1-5)
integer
Microsoft TTS: Speech rate adjustment (-100 to 100, default: 0)
integer
Microsoft TTS: Pitch adjustment (-100 to 100, default: 0)
string
Microsoft TTS: Emotional style (e.g., “cheerful”, “sad”, “angry”)

Response

Returns an audio file in the specified format.

Basic Example

Provider-Specific Examples

OpenAI Models (TTS-1, TTS-1 HD, GPT-4o Mini TTS)

ElevenLabs Models

Kokoro 82M Model

NariLabs Dia Model (Advanced)

MeloTTS Multilingual

PlayAI Dialog Models

Microsoft TTS

Available Models

OpenAI Models

TTS-1 (tts-1)
  • Optimized for real-time text-to-speech
  • Cost-effective for most applications
  • 11 available voices: alloy, ash, ballad, coral, echo, fable, onyx, nova, sage, shimmer, verse
TTS-1 HD (tts-1-hd)
  • High-quality text-to-speech
  • Best audio quality with slower generation
  • Same 11 voices as TTS-1
GPT-4o Mini TTS (gpt-4o-mini-tts)
  • Advanced TTS with instruction following
  • Supports voice control via instructions
  • Same 11 voices as TTS-1

Premium Models

ElevenLabs (elevenlabs)
  • Ultra-realistic human-like voices
  • 40+ multilingual voices
  • Supports English, Spanish, French, German, Arabic, Chinese, Hindi, Polish
PlayAI Dialog (playai-tts)
  • Specialized for conversational content
  • 27 expressive voices
  • Optimized for dialogue and storytelling

Specialized Models

Kokoro 82M (kokoro-82m)
  • Lightweight but high-quality
  • 80+ voices in multiple languages
  • Open-source Apache-licensed model
Microsoft TTS (microsoft-tts)
  • Enterprise-grade quality
  • 100+ neural voices
  • Extensive language support

Voice Examples

OpenAI Voices

ElevenLabs Voices

Microsoft TTS Voices

Model-Specific Parameters

Advanced Features

Speed Control

Adjust playback speed for different use cases:

Audio Formats

Choose the optimal format for your application:
  • MP3: Standard, widely compatible
  • WAV: Uncompressed, highest quality
  • OGG/Opus: Efficient compression
  • FLAC: Lossless compression
  • AAC: Good balance of quality and size

Instruction-Based Control (GPT-4o Mini TTS)

Control voice characteristics with natural language:

Microsoft TTS Advanced Controls

Microsoft TTS offers fine-grained control over speech characteristics:

Speech Rate Control

Pitch Adjustment

Emotional Styles

Different voices support different emotional styles:
Available Emotional Styles (voice-dependent):
  • cheerful - Happy and upbeat
  • sad - Melancholic tone
  • angry - Frustrated or upset
  • fearful - Nervous or scared
  • calm - Relaxed and peaceful
  • gentle - Soft and caring
  • newscast - Professional news anchor
  • customerservice - Helpful and polite

Best Practices

Text Optimization

  • Use clear punctuation for natural pauses
  • Spell out numbers and abbreviations
  • Use SSML tags for fine-grained control (model-dependent)

Voice Selection

  • Customer Service: Professional voices (echo, George)
  • Storytelling: Warm voices (fable, nova)
  • Educational: Clear voices (alloy, shimmer)
  • Gaming: Character voices (onyx, sage)

Performance Tips

  • Cache generated audio when possible
  • Use appropriate audio formats for your platform
  • Consider real-time vs. high-quality models based on use case

Error Handling

Common error scenarios:

Use Cases

  • Voice Assistants: Natural conversation interfaces
  • Audiobooks: Long-form content narration
  • E-learning: Educational content delivery
  • Accessibility: Screen reader alternatives
  • Gaming: Character voice generation
  • Customer Service: Automated phone systems
  • Content Creation: Podcast and video narration

Authorizations

Authorization
string
header
required

Enter your API key (starts with 'ek-')

Body

application/json
model
string
required

The TTS model to use for speech generation

Example:

"tts-1"

input
string

The text to convert to speech (OpenAI models)

Required string length: 1 - 4096
Example:

"Hello, world! This is a text-to-speech example."

voice
string

The voice to use for speech generation (OpenAI, Orpheus, PlayAI, ElevenLabs models)

Example:

"alloy"

response_format
enum<string>
default:mp3

The audio format for the generated speech

Available options:
mp3,
opus,
aac,
flac,
wav,
pcm
speed
number
default:1

The speed of the generated audio

Required range: 0.25 <= x <= 4
temperature
number

Temperature for randomness in speech generation

Required range: 0 <= x <= 2
top_p
number

Top-p value for nucleus sampling

Required range: 0 <= x <= 1
instructions
string

Additional instructions to control voice generation (GPT-4o Mini TTS)

speaker_transcript
string

Speaker transcript for Dia model

Maximum string length: 1000
cfg_filter_top_k
integer

CFG filter top k value (Dia model)

Required range: 15 <= x <= 50
cfg_scale
integer

CFG scale value (Dia model)

Required range: 1 <= x <= 5
speech_rate
integer
default:0

Speech rate adjustment for Microsoft TTS (-100 to 100)

Required range: -100 <= x <= 100
pitch_adjustment
integer
default:0

Pitch adjustment for Microsoft TTS (-100 to 100)

Required range: -100 <= x <= 100
emotional_style
string

Emotional style for Microsoft TTS (e.g., 'cheerful', 'sad', 'angry')

Response

Audio file

The response is of type file.