[ ABORT TO HUD ]
SEQ. 1
SEQ. 2

Text-to-Speech & Realtime Voice

🎙️ Speech & Audio APIs 15 min 250 BASE XP

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

VoiceCharacter
alloyNeutral, balanced
echoWarm, conversational
fableExpressive, storytelling
onyxDeep, authoritative
novaFriendly, upbeat
shimmerSoft, calm
coralClear, 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:

ModelCapability
gpt-realtime-2GPT-4o-class reasoning for live voice interactions
gpt-realtime-translateReal-time multilingual speech translation
gpt-realtime-whisperLive streaming speech-to-text transcription

Latest Realtime Models (per the official model catalog)

ModelCapability
gpt-realtime-2.1Newest realtime reasoning model with tool use
gpt-realtime-2.1-miniCost-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
🎯 Use Case Decision: Use TTS for pre-generated audio (podcasts, notifications). Use the Realtime API for interactive voice conversations (phone agents, assistants).
SYNAPSE VERIFICATION
QUERY 1 // 3
What makes gpt-4o-mini-tts different from traditional TTS?
It's faster
It accepts natural language instructions to control tone, emotion, and delivery style
It only works in English
It generates video