Skip to Content
ModelsGemini TTS

Gemini TTS family

Google’s Gemini speech synthesis models, called through the OpenAI-compatible POST /v1/audio/speech. You can describe tone and style in natural language.

Common model IDs (copy them exactly)
Gemini 3.8 Flash TTSgoogle/gemini-3.8-flash-tts
Gemini 3.8 Flash-Lite TTSgoogle/gemini-3.8-flash-lite-ttsLower rate

For all TTS models, see the models page . For the common endpoint parameters, see Audio Speech API.

Examples

gemini_tts.py
import os from openai import OpenAI client = OpenAI(base_url="https://api.ofox.ai/v1", api_key=os.environ["OFOX_API_KEY"]) with client.audio.speech.with_streaming_response.create( model="google/gemini-3.8-flash-tts", voice="Kore", input="The meeting today has moved to 3 p.m. Please be on time.", instructions="Read in a calm, clear tone, like a news broadcast.", response_format="wav", ) as resp: resp.stream_to_file("speech.wav")

Parameter values

Key pointvoice is required and takes a Google voice name; only wav and pcm output formats are supported.
ParameterDescription
voiceRequired. A Google voice name, such as Kore, Puck, or Zephyr. For the full list, see Gemini official docs · Voices . OpenAI voice names (such as alloy) cannot be used
response_formatwav (default) or pcm, both 24 kHz, 16-bit, mono. mp3, opus, aac, and flac are not supported
instructionsDescribes tone, pace, and style in natural language, such as “in a cheerful tone” or “slow down”
language_codeLanguage code, such as cmn-CN or en-US; detected automatically from the text if omitted
stream_formatSet to sse to receive audio chunks as a stream, suited to playing while generating

If you need mp3, fetch wav first and convert it with a tool such as ffmpeg: ffmpeg -i speech.wav speech.mp3.

Latency and long text

In our tests, a Chinese sentence of about 20 characters returned in about 3 seconds. About 6,000 characters of English produced about 9 minutes of audio in about 105 seconds, with a wav file of about 26 MB. For long text, set the client timeout to 300 seconds or more, or use stream_format: "sse" to fetch it as a stream.

Common errors

HTTPError messageCauseFix
400voice is required for speech completionvoice was not sentPass a voice name, such as Kore
400Request contains an invalid argument.The voice name does not exist, e.g. alloy was passedUse a Google voice name
400unsupported Gemini response_format: mp3Unsupported formatUse wav or pcm

For more errors, see Audio Speech API.

Official docs

FAQ

What do I put in voice for Gemini TTS?

A Google voice name, such as Kore, Puck, or Zephyr; the full list is in the official Gemini docs. voice is required, and OpenAI voices such as alloy cannot be used.

Can Gemini TTS output mp3?

No. Only wav and pcm (24 kHz, 16-bit, mono) are supported. If you need mp3, convert it yourself, e.g. ffmpeg -i speech.wav speech.mp3.

How do I control tone with Gemini TTS?

Describe it in natural language with the instructions parameter, for example "read in a cheerful tone" or "calm and steady, like a news broadcast".

Gemini TTS returns voice is required?

Gemini TTS requires voice, for example "voice": "Kore".

Last updated on