20% off all GPT ๐ŸŽ‰ 30% off DeepSeekLearn more

Gemini 2.5 Pro TTS

Speech
google/gemini-2.5-pro-tts
Available Providers
Vertex
Supported Protocols
openai

Providers

Vertex
Input Tokens
$1/M
Output Tokens
$20/M
Output Audio
$20/M
Protocols
openai/v1/audio/speech

Code Examples

from openai import OpenAI
client = OpenAI(base_url="https://api.ofox.run/v1", api_key="YOUR_OFOX_API_KEY")
response = client.audio.speech.create(
model="google/gemini-2.5-pro-tts",
voice="Kore",
input="Hello from OFOX.",
response_format="wav",
speed=1.1,
extra_body={"language_code": "en-US", "instructions": "Speak warmly and clearly."},
)
response.stream_to_file("speech.wav")

Older Gemini TTS models: language_code and instructions are optional; speed gives an approximate pace. Only WAV is selectable. In SSE, explicit WAV returns a complete file; without response_format, audio remains PCM chunks.

Frequently Asked Questions

Simply set your base URL to https://api.ofox.run/v1 and use your Ofox API key. The API is OpenAI-compatible โ€” just change the base URL and API key in your existing code.