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.
google/gemini-3.8-flash-ttsgoogle/gemini-3.8-flash-lite-ttsLower rateFor all TTS models, see the models page . For the common endpoint parameters, see Audio Speech API.
Examples
Python
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
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
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".