Speech model
Gemini 3.1 Flash TTS Preview
google/gemini-3.1-flash-tts-preview
google/gemini-3.1-flash-tts-preview is a text-to-speech model from Google you can call on the OceanToken API.
Price card, similar models and questions answered: Gemini 3.1 Flash TTS Preview on oceantoken.ai.
At a glance
| Model ID | google/gemini-3.1-flash-tts-preview |
|---|---|
| Type | Speech |
| Publisher | |
| Price | On oceantoken.ai |
| Endpoint | /v1/audio/speech |
| API shape | OpenAI-compatible |
| In the catalog since | 2026-04-24 |
API
POST /v1/audio/speech. Base URL https://api.oceantoken.ai, your OceanToken key as the bearer token. The OpenAI SDKs work unchanged; see the Quickstart.
Download this spec (JSON) · llms.txt for AI assistants
Basic
- curl
- Python
- JavaScript
curl https://api.oceantoken.ai/v1/audio/speech \
-H "Authorization: Bearer $OCEANTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "google/gemini-3.1-flash-tts-preview",
"input": "Welcome aboard.",
"voice": "Kore"
}' --output speech.wav
import os
from openai import OpenAI
client = OpenAI(base_url="https://api.oceantoken.ai/v1", api_key=os.environ["OCEANTOKEN_API_KEY"])
audio = client.audio.speech.create(
model="google/gemini-3.1-flash-tts-preview",
input="Welcome aboard.",
voice="Kore",
)
audio.write_to_file("speech.wav")
import fs from 'node:fs';
import OpenAI from 'openai';
const client = new OpenAI({baseURL: 'https://api.oceantoken.ai/v1', apiKey: process.env.OCEANTOKEN_API_KEY});
const audio = await client.audio.speech.create({
"model": "google/gemini-3.1-flash-tts-preview",
"input": "Welcome aboard.",
"voice": "Kore"
});
fs.writeFileSync('speech.wav', Buffer.from(await audio.arrayBuffer()));
Request parameters
Only what this model takes. Anything else in the request is left out before it reaches the model.
| Parameter | Type | Description |
|---|---|---|
modelrequired | string | This model's ID. |
inputrequired | string | The text to read. |
voicerequired | string | One of this model's voices (see the Speech guide). |
response_format | string mp3, wav, opus, aac, flac, pcm, url | Audio format; url returns a link instead of the audio. |
speed | number 0.25 to 4 default 1 | Pace, on models that support it. |
instructions | string | Tone notes such as "calm, slow", on models that support them. |
Response
| Field | Type | Description |
|---|---|---|
(body) | binary | The audio file. |
More examples and how errors and billing work: Speech and transcription.
Compared with similar models
Speech models on OceanToken in the same price range as google/gemini-3.1-flash-tts-preview. Compare their prices on oceantoken.ai.
| Model | Publisher | Context |
|---|---|---|
Gemini 3.1 Flash TTS Previewgoogle/gemini-3.1-flash-tts-preview | — | |
Gemini 3.8 Flash TTSgoogle/gemini-3.8-flash-tts | — | |
Gemini 3.8 Flash Lite TTSgoogle/gemini-3.8-flash-lite-tts | — |
More from Google
- Chirp 3
google/chirp-3 - Gemini 2.5 Flash
google/gemini-2.5-flash - Gemini 2.5 Flash Image
google/gemini-2.5-flash-image - Gemini 2.5 Flash Lite
google/gemini-2.5-flash-lite - Gemini 2.5 Pro
google/gemini-2.5-pro - Gemini 2.5 Pro Preview
google/gemini-2.5-pro-preview - Gemini 3 Flash Preview
google/gemini-3-flash-preview - Gemini 3 Pro Image
google/gemini-3-pro-image
All Google models on OceanToken
Use it
Create an account Price on oceantoken.ai
The facts on this page were read from the live OceanToken catalog on 2026-12-02 (UTC), when the documentation was built. Prices are published on oceantoken.ai.