Text-to-Speech APIs: OpenAI and Google Compared
Compare speech generation architectures, multi-speaker support, output encodings, and prompt control between OpenAI and Gemini text-to-speech APIs.
- OpenAI provides a dedicated REST speech endpoint with natural language prompt instructions, while Google uses the Gemini Interactions API with structured metadata.
- Gemini 3.8 Flash TTS natively synthesizes multi-speaker conversations in a single request; OpenAI requires separate API calls per speaker voice.
- Google separates sustained turn-level tone from point-in-time sound effects using inline tags like short pause, gasp, or sigh directly in verbatim text.
- All legacy OpenAI speech models including gpt-4o-mini-tts, tts-1, and tts-1-hd shut down on January 6, 2027, requiring migration to the Realtime API.
Architectural Concepts: Flat Requests vs Structured Interactions
OpenAI and Google approach synthetic voice generation through fundamentally different API designs. OpenAI provides a dedicated endpoint at /v1/audio/speech. Developers submit a flat JSON payload specifying the voice, the text string, the model ID, and optional prompt instructions. This paradigm handles single-speaker generation cleanly: the API receives text, processes global style instructions, and outputs a complete or streamed audio container.
In contrast, Google routes text-to-speech synthesis through the Gemini Interactions API using POST https://generativelanguage.googleapis.com/v1beta/interactions. Instead of treating voice synthesis as a isolated utility, Google models audio generation as structured multi-turn conversation steps. Input payloads contain explicit user turns, turn-level speech annotations, and speaker mappings. The model produces an audio interaction output containing raw base64 data rather than streaming a raw audio file directly across HTTP transport boundaries.
| Feature | OpenAI Speech API | Google Gemini TTS |
|---|---|---|
| Primary Endpoint | /v1/audio/speech | /v1beta/interactions |
| Supported Models | gpt-4o-mini-tts, tts-1, tts-1-hd | gemini-3.8-flash-tts, gemini-3.8-flash-lite-tts |
| Deprecation Status | Shut down on January 6, 2027 | Active in v1beta Interactions API |
| Styling Mechanism | Free-form text in instructions property | speech_metadata annotations and bracketed tags |
| Multi-Speaker Support | Single speaker per HTTP call | Native multi-speaker array per interaction |
| Default Unary Output | MP3 | WAV (audio/wav, 24 kHz, 16-bit) |
Styling and Prosody: Natural Language Prompts vs Inline Vocal Tags
Controlling the performance of generated speech exposes another major design difference. With OpenAI’s gpt-4o-mini-tts, voice modulation relies on the instructions parameter. Developers describe the intended delivery using plain descriptive prose—such as requesting a positive and cheerful tone, whispering, altering speech velocity, shifting accents, or conveying specific emotional intensity. The model interprets these holistic directions and applies them globally to the rendered audio clip.
Gemini TTS models enforce strict separation between spoken transcript text and performance directions. The input text is handled strictly as a verbatim script. To prevent the synthesis engine from vocalizing stage directions, styling operates across two distinct scopes. Broad, sustained emotional characteristics—such as an urgent whisper, breathless delivery, or warm and enthusiastic pacing—are defined inside a speech_metadata annotation on each turn. Momentary acoustic cues and pauses are embedded directly into the verbatim text via angle-bracketed vocal tags, including <short pause>, <sigh>, <cough>, <gasp>, and <laugh>.
{
"model": "gemini-3.8-flash-tts",
"input": [{
"type": "user_input",
"content": [{
"type": "text",
"text": "Wait... <short pause> look over there! <gasp>",
"annotations": [{
"type": "speech_metadata",
"style": "urgent and cautious"
}]
}]
}],
"response_format": {"type": "audio"},
"generation_config": {
"speech_config": [{"voice": "Kore"}]
}
}
Multi-Speaker Dialogue Orchestration
Applications that require dialogue between multiple characters reveal the operational advantages of each platform. OpenAI’s /v1/audio/speech endpoint accepts exactly one voice parameter per request. To build a two-person podcast or conversational exchange using OpenAI models, an application must segment the transcript, execute separate requests for each character’s lines, download multiple audio clips, and stitch the resulting binary files together on a local server. This increases network overhead and complicates latency management.
Google’s Gemini TTS architecture supports multi-speaker conversation directly in a single payload. In the request configuration, developers define speaker mappings inside speech_config.speakers, binding individual identifiers to specific voices such as Puck and Kore. In the REST API, setting "mode": "conversational" guides natural turn-taking cadence. Each message block within the content payload specifies its assigned speaker and turn-specific delivery style, allowing the server to synthesize an entire back-and-forth conversation into a unified output buffer.
{
"model": "gemini-3.8-flash-tts",
"input": [{
"type": "user_input",
"content": [
{
"type": "text",
"text": "Did you review the release schedule?",
"annotations": [{"type": "speech_metadata", "speaker": "Joe", "style": "calm and relaxed"}]
},
{
"type": "text",
"text": "Yes, everything looks ready to deploy.",
"annotations": [{"type": "speech_metadata", "speaker": "Jane", "style": "cheerful and friendly"}]
}
]
}],
"response_format": {"type": "audio"},
"generation_config": {
"speech_config": {
"mode": "conversational",
"speakers": [
{"speaker": "Joe", "voice": "Puck"},
{"speaker": "Jane", "voice": "Kore"}
]
}
}
}
Audio Encodings, Streaming Modes, and Telephony Support
Both providers offer compressed and uncompressed audio containers, but their defaults reflect differing priorities. OpenAI defaults to compressed mp3, but also supports opus for low-latency web streaming, aac for mobile and video platforms, flac for lossless archiving, uncompressed wav, and raw pcm containing 24kHz 16-bit signed little-endian audio without headers. For minimum playback delay, OpenAI recommends using wav or pcm over HTTP chunk transfer encoding.
Gemini TTS shifts default formats based on whether streaming is enabled. Unary calls (stream: false) return full 24 kHz mono uncompressed audio/wav audio with a standard RIFF header, ready to write directly to disk. When stream: true is configured, Gemini models default to returning headerless raw linear PCM (audio/l16) chunks at 24 kHz mono with 16-bit signed little-endian samples. This design lets client audio engines concatenate incoming chunks smoothly without having to strip redundant RIFF headers from every network delta.
- OpenAI formats: MP3 (default), Opus, AAC, FLAC, WAV, and headerless 24kHz 16-bit signed PCM.
- Gemini unary format: WAV (audio/wav) with standard RIFF header at 24 kHz mono.
- Gemini streaming format: Raw headerless Linear PCM (audio/l16) at 24 kHz mono.
- Gemini telephony support: G.711 mu-law (audio/mulaw) and A-law (audio/alaw) at selectable rates like 8000 Hz, 16000 Hz, or 24000 Hz.
Voices, Customization, and Policy Obligations
OpenAI provides 13 built-in voices for gpt-4o-mini-tts: alloy, ash, ballad, coral, echo, fable, nova, onyx, sage, shimmer, verse, marin, and cedar. OpenAI recommends marin and cedar for highest synthesis quality. Older legacy models (tts-1 and tts-1-hd) support a subset of 9 voices. Custom voice creation is supported by registering consent recordings and speaker audio samples to obtain a custom voice ID. OpenAI policies explicitly require end-user disclosures stating that speech outputs are synthetic.
Gemini TTS provides prebuilt options including Kore and Puck, alongside an Extended Voice Library accessible through GET /v1beta/voices. Custom voices are supported through Google’s Voice Design endpoints, which generate a custom identifier prefixed with voice_, or Voice Replication workflows, which issue identifiers prefixed with voice_ or stateless tokens prefixed with voicekey_. Gemini models accept text-only input and output audio only, separating scripted narration workloads from the bidirectional real-time capabilities of the Gemini Live API.
Deprecations and Lifecycle Deadlines
Engineering teams evaluating OpenAI’s text-to-speech stack must account for critical end-of-life schedules. OpenAI has deprecated its entire line of dedicated /v1/audio/speech models: tts-1, tts-1-hd, and gpt-4o-mini-tts are scheduled for shutdown on January 6, 2027. Existing implementations can use these models until the deadline, but future development requires migrating to gpt-realtime-2.1-mini on the Realtime API, which represents an architectural change because the Realtime API model does not run on /v1/audio/speech.
Google’s Gemini TTS models (gemini-3.8-flash-tts and gemini-3.8-flash-lite-tts) represent the active, long-term foundation for scripted narration within the Google GenAI ecosystem. SDK requirements specify google-genai >= 2.25.0 for Python or @google/genai >= 2.24.0 for JavaScript and TypeScript to leverage speaker configuration arrays. Teams planning new voice synthesis pipelines should factor these migration timelines into their infrastructure decisions, using tools such as the LLM API cost calculator to monitor operational budgets across providers.
Implementation and Selection Checklist
Selecting the right voice generation stack depends on script complexity, target telephony environments, and timeline requirements. Review this checklist before standardizing on an implementation path:
- Select Gemini 3.8 Flash TTS if you produce podcasts, audiobooks, or interviews that require coordinating two distinct voices in a single API roundtrip.
- Choose Google Gemini if your distribution network feeds enterprise telephony or IVR systems that demand native audio/mulaw or audio/alaw at 8000 Hz or 16000 Hz.
- Use OpenAI gpt-4o-mini-tts if you need compressed MP3, AAC, or Opus output directly without local transcoding steps.
- Factor the January 6, 2027 shutdown date into any OpenAI speech implementation, and avoid planning new long-term architectures on tts-1 or tts-1-hd.
- Upgrade your client libraries to at least google-genai 2.25.0 in Python or @google/genai 2.24.0 in JavaScript when building Gemini multi-speaker pipelines.
- Ensure user-facing applications display the required synthetic audio disclosures under OpenAI usage policies.