Gemini 3.1 Flash TTS Preview
google/gemini-3.1-flash-tts-preview
Gemini 3.1 Flash TTS Preview is a text-to-speech model from Google, and a substantial generational step up from Gemini 2.5 Flash TTS.
Enterprise rate
Up to 30% off
By quote
Our price $1.00 / $20.00 Per 1M tokens
- InputtextOutput: speech
- ReleasedApril 24, 2026In the OceanToken catalog
01 · Learn
What is Gemini 3.1 Flash TTS Preview?
Gemini 3.1 Flash TTS Preview is a speech model from Google on the OceanToken API.
- $1.00 / $20.00Per 1M input / output
- textInputOutput: speech
- Up to 30% offEnterprise rate vs officialUp to, by quote
What Gemini 3.1 Flash TTS Preview can do.
- Text-to-speech
- Voice-overs and narration
Gemini 3.1 Flash TTS Preview specs.
- Input
- text
- Output
- speech
- Released
- April 24, 2026
Model ID and endpoint
- OceanToken model ID
google/gemini-3.1-flash-tts-preview- OpenAI-compatible base URL
https://api.oceantoken.ai/v1- Endpoint
POST /v1/audio/speech
03 · Buy and build
How much does the Gemini 3.1 Flash TTS Preview API cost?
| Rate | Input | Output | Off |
|---|---|---|---|
| Tier 1 to 3Self-serve | $1.00 | $20.00 | |
| Enterprise rateBy quote | Up to 30% off | ||
- Tell usYour model and monthly spend.
- We email your rateUp to 60% off. Price lock available.
- We activate itOn your account, same key.
The console always shows the current price.
How tiers work
- Self-serveTier 1From sign-up
- Self-serveTier 2$1,000 total
- Self-serveTier 3$10,000 total
- By quoteEnterprise rateUp to 60% off, by quote
You pay per use from a prepaid balance, with no subscription. Official price: the model maker’s list price. Tier 1 to 3 are standing rates by total top-up.
How to use Gemini 3.1 Flash TTS Preview on OceanToken.
Three steps from no account to a working request. The same key and balance work for every model in the catalog.
Create an account and get an API key
One key works for every model your account can use.
Get API KeyAdd credits
OceanToken is prepaid: add credits, and each request is billed from that balance.
Add creditsCall Gemini 3.1 Flash TTS Preview from your code
Send a request to
See the API request in docsPOST /v1/audio/speechwith the model IDgoogle/gemini-3.1-flash-tts-preview.
client.pyPythonfrom openai import OpenAI
# Your API Key from the OceanToken console
client = OpenAI(base_url="https://api.oceantoken.ai/v1",
api_key="YOUR_API_KEY")
speech = client.audio.speech.create(
model="google/gemini-3.1-flash-tts-preview",
voice="Kore", input="Hello from OceanToken")
speech.write_to_file("speech.mp3")client.tsTypeScriptimport OpenAI from "openai";
import { writeFile } from "node:fs/promises";
// Your API Key from the OceanToken console
const client = new OpenAI({ baseURL: "https://api.oceantoken.ai/v1", apiKey: "YOUR_API_KEY" });
const speech = await client.audio.speech.create({
model: "google/gemini-3.1-flash-tts-preview",
voice: "Kore",
input: "Hello from OceanToken",
});
await writeFile("speech.mp3", Buffer.from(await speech.arrayBuffer()));request.mjsJavaScript// Your API Key from the OceanToken console
const KEY = "YOUR_API_KEY";
const res = await fetch("https://api.oceantoken.ai/v1/audio/speech", {
method: "POST",
headers: { Authorization: `Bearer ${KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({ model: "google/gemini-3.1-flash-tts-preview", voice: "Kore", input: "Hello from OceanToken" }),
});
const audio = Buffer.from(await res.arrayBuffer());
console.log(audio.length, "bytes of MP3");request.shcurl# Your API Key from the OceanToken console
curl https://api.oceantoken.ai/v1/audio/speech \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "google/gemini-3.1-flash-tts-preview", "voice": "Kore",
"input": "Hello from OceanToken"}' \
--output speech.mp3main.goGopackage main
import (
"io"
"net/http"
"os"
"strings"
)
func main() {
// Your API Key from the OceanToken console
body := strings.NewReader(`{"model": "google/gemini-3.1-flash-tts-preview", "voice": "Kore", "input": "Hello from OceanToken"}`)
req, _ := http.NewRequest("POST", "https://api.oceantoken.ai/v1/audio/speech", body)
req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
out, _ := io.ReadAll(res.Body)
os.WriteFile("speech.mp3", out, 0o644)
}Main.javaJavaimport java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) throws Exception {
// Your API Key from the OceanToken console
String body = "{\"model\": \"google/gemini-3.1-flash-tts-preview\", \"voice\": \"Kore\", \"input\": \"Hello from OceanToken\"}";
HttpRequest req = HttpRequest.newBuilder(URI.create("https://api.oceantoken.ai/v1/audio/speech"))
.header("Authorization", "Bearer YOUR_API_KEY")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
.build();
HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofFile(Path.of("speech.mp3")));
}
}request.phpPHP<?php
// Your API Key from the OceanToken console
$ch = curl_init("https://api.oceantoken.ai/v1/audio/speech");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Authorization: Bearer YOUR_API_KEY", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => '{"model": "google/gemini-3.1-flash-tts-preview", "voice": "Kore", "input": "Hello from OceanToken"}',
]);
file_put_contents("speech.mp3", curl_exec($ch));request.rbRubyrequire "net/http"
# Your API Key from the OceanToken console
uri = URI("https://api.oceantoken.ai/v1/audio/speech")
req = Net::HTTP::Post.new(uri, "Authorization" => "Bearer YOUR_API_KEY", "Content-Type" => "application/json")
req.body = '{"model": "google/gemini-3.1-flash-tts-preview", "voice": "Kore", "input": "Hello from OceanToken"}'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
File.binwrite("speech.mp3", res.body)Gemini 3.1 Flash TTS Preview API: frequently asked questions.
What is Gemini 3.1 Flash TTS Preview?
Gemini 3.1 Flash TTS Preview is a text-to-speech model from Google, and a substantial generational step up from Gemini 2.5 Flash TTS.
How much does Gemini 3.1 Flash TTS Preview cost?
Gemini 3.1 Flash TTS Preview costs $1.00 per 1M input tokens and $20.00 per 1M output tokens. These are OceanToken starting prices as of November 28, 2026, charged per use to your prepaid balance. The console always shows the current price.
What inputs and outputs does Gemini 3.1 Flash TTS Preview support?
Gemini 3.1 Flash TTS Preview takes text as input and produces speech.
How do I call Gemini 3.1 Flash TTS Preview through the API?
Send requests to https://api.oceantoken.ai/v1/audio/speech with the model ID google/gemini-3.1-flash-tts-preview and your OceanToken API key. The API is OpenAI-compatible, so an OpenAI SDK needs only the base URL https://api.oceantoken.ai/v1 and your key. The same OceanToken API key works for every model your account can use. Full reference: docs.oceantoken.ai.
How do I top up?
OceanToken is prepaid. Open Credits in the console, choose an amount and pay by card on Stripe's hosted checkout page (Link works too). Your balance updates a few seconds after payment. Have a trial code? Redeem it on the same page.
Do credits expire, and can I get a refund?
Purchased credits are valid for 12 months from the date of purchase. Credits from trial codes, promotions or gifts may have a shorter validity. All purchases are final and non-refundable, except where the law requires a refund. Section 6 of the Terms of Service has the details.
Am I charged for failed requests?
No. If a request fails, you are not charged: that covers a request refused for an insufficient balance or by a safety check, one whose provider fails before returning any output, and a video job that fails or is refused by a safety check, whose held amount goes back to your balance. The one exception: if a request breaks off after the model has started producing output, for example a stream cut off part-way, you pay for the tokens that were processed and generated for it.
Related articles
More from Google
Similar speech & audio models
- GPT Audio MiniOur discount−10%
- GPT AudioOur discount−10%
Sources
- OceanToken model catalog: every price, context window, input, output and parameter on this page (November 28, 2026).
- How tiers work: Tier 1 to 3 and the Enterprise rate.