Text-to-Speech & Realtime Voice
Generating Speech
The gpt-4o-mini-tts model generates natural-sounding speech with unprecedented control over tone, emotion, and delivery style.
const audio = await openai.audio.speech.create({
model: "gpt-4o-mini-tts",
voice: "coral",
input: "Welcome to the Infinity Tech Stack Academy!",
instructions: "Speak with enthusiasm and energy, like a tech conference host.",
response_format: "mp3"
});
Steerable TTS
Unlike traditional TTS that just reads text flatly, gpt-4o-mini-tts accepts instructions that control HOW it speaks - tone, pacing, emotion, accent emphasis.
Available Voices
| Voice | Character |
|---|---|
| alloy | Neutral, balanced |
| echo | Warm, conversational |
| fable | Expressive, storytelling |
| onyx | Deep, authoritative |
| nova | Friendly, upbeat |
| shimmer | Soft, calm |
| coral | Clear, professional |
The Realtime API (May 2026)
For ultra-low latency voice applications, the Realtime API supports two transport protocols: WebSocket for server-to-server and Node.js clients, and WebRTC as the recommended transport for browser and mobile clients (lower latency, NAT traversal, built-in echo cancellation). New models launched in May 2026:
| Model | Capability |
|---|---|
| gpt-realtime-2 | GPT-4o-class reasoning for live voice interactions |
| gpt-realtime-translate | Real-time multilingual speech translation |
| gpt-realtime-whisper | Live streaming speech-to-text transcription |
Latest Realtime Models (per the official model catalog)
| Model | Capability |
|---|---|
| gpt-realtime-2.1 | Newest realtime reasoning model with tool use |
| gpt-realtime-2.1-mini | Cost-efficient version of gpt-realtime-2.1 with tool use |
The original gpt-realtime-mini is now listed as Deprecated in the official catalog - start new Realtime projects on gpt-realtime-2.1 or gpt-realtime-2.1-mini instead.
- Voice Activity Detection (VAD): Automatically detects when users stop speaking
- Tool Calling in Voice: Trigger backend tools while speaking
- Audio Reasoning: Understands tone, inflection, and urgency