Skip to main content
google avatar

Gemini 3.1 Flash TTS API

google/gemini-3.1-flash-tts

Turn text into expressive, directable speech in 30 voices — describe the delivery in plain language and get back a 24 kHz WAV.

0.0006 per second of output audio

Model Input

Input

Style direction plus the words to speak, as '{style instruction}: {text}' — e.g. 'Say the following in a warm, curious way: OK, so... tell me about this AI thing.' Direction controls accent, pace, tone and emotion. Inline audio tags such as [laughs] or [sigh] are supported. Combined direction and text must be under ~8,000 bytes; audio beyond ~655 seconds is truncated.

Prebuilt voice to speak in. Each has a distinct character, e.g. Kore (firm), Puck (upbeat), Aoede (breezy), Charon (informative), Sulafat (warm), Enceladus (breathy).

Locale for the delivery. Any prebuilt voice can be paired with any of these locales.

You need to be logged in to run this model and view results.
Log in

Model Output

Output

Loading
Generated in 4.574 seconds
Logs (1 lines)

Model Example Requests

Examples

Gemini 3.1 Flash TTS API

Gemini 3.1 Flash TTS is a sound AI model by google. On ModelRunner it runs through a REST API or via MCP from any AI assistant, at $0.0006 per second of audio.

POST https://queue.modelrunner.run/google/gemini-3.1-flash-tts

cURL

# Submit a request to the queue. Input fields go at the top level of the
# body. The optional reserved "metadata" object holds your own flat string
# tags — stored on the request, never sent to the model; filter later with
# GET https://queue.modelrunner.run/requests?metadata=<url-encoded JSON>.
curl -X POST https://queue.modelrunner.run/google/gemini-3.1-flash-tts \
  -H "Authorization: Key $MRUN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "voice": "Vindemiatrix",
    "prompt": "Sakin ve güven veren bir anlatıcı gibi oku: Sabahın ilk ışığıyla birlikte liman yavaşça uyanıyordu.",
    "language_code": "tr-tr",
    "metadata": {
      "project": "my-project"
    }
  }'
# → { "request_id": "...", "status_url": "...", "response_url": "..." }

# Poll status_url until "COMPLETED", then fetch the result
curl "https://queue.modelrunner.run/google/gemini-3.1-flash-tts/requests/$REQUEST_ID/status" \
  -H "Authorization: Key $MRUN_API_KEY"
curl "https://queue.modelrunner.run/google/gemini-3.1-flash-tts/requests/$REQUEST_ID" \
  -H "Authorization: Key $MRUN_API_KEY"

JavaScript

import { modelrunner } from "@modelrunner/client";

const result = await modelrunner.subscribe("google/gemini-3.1-flash-tts", {
  input: {
    "voice": "Vindemiatrix",
    "prompt": "Sakin ve güven veren bir anlatıcı gibi oku: Sabahın ilk ışığıyla birlikte liman yavaşça uyanıyordu.",
    "language_code": "tr-tr"
  },
});
console.log(result);

Python

import os
import requests

headers = {"Authorization": f"Key {os.environ['MRUN_API_KEY']}"}

submitted = requests.post(
    "https://queue.modelrunner.run/google/gemini-3.1-flash-tts",
    headers=headers,
    json={
      "voice": "Vindemiatrix",
      "prompt": "Sakin ve güven veren bir anlatıcı gibi oku: Sabahın ilk ışığıyla birlikte liman yavaşça uyanıyordu.",
      "language_code": "tr-tr"
    },
).json()

# Poll submitted["status_url"] until "COMPLETED", then:
result = requests.get(submitted["response_url"], headers=headers).json()

Input parameters

Input parameters of Gemini 3.1 Flash TTS
NameTypeRequiredDescription
promptstringyesStyle direction plus the words to speak, as '{style instruction}: {text}' — e.g. 'Say the following in a warm, curious way: OK, so... tell me about this AI thing.' Direction controls accent, pace, tone and emotion. Inline audio tags such as [laughs] or [sigh] are supported. Combined direction and text must be under ~8,000 bytes; audio beyond ~655 seconds is truncated.
voiceenumnoPrebuilt voice to speak in. Each has a distinct character, e.g. Kore (firm), Puck (upbeat), Aoede (breezy), Charon (informative), Sulafat (warm), Enceladus (breathy). One of: Achernar, Achird, Algenib, Algieba, Alnilam, Aoede, Autonoe, Callirrhoe, Charon, Despina, Enceladus, Erinome, Fenrir, Gacrux, Iapetus, Kore, Laomedeia, Leda, Orus, Puck, Pulcherrima, Rasalgethi, Sadachbia, Sadaltager, Schedar, Sulafat, Umbriel, Vindemiatrix, Zephyr, Zubenelgenubi. Default: "Kore".
language_codeenumnoLocale for the delivery. Any prebuilt voice can be paired with any of these locales. One of: ar-eg, bn-bd, de-de, en-in, en-us, es-es, fr-fr, hi-in, id-id, it-it, ja-jp, ko-kr, mr-in, nl-nl, pl-pl, pt-br, ro-ro, ru-ru, ta-in, te-in, th-th, tr-tr, uk-ua, vi-vn. Default: "en-us".

Machine-readable: OpenAPI schema · llms.txt

Use Gemini 3.1 Flash TTS from Claude & Cursor (MCP)

Point Claude Code, Claude Desktop, Cursor, or any MCP client at the ModelRunner MCP server and Gemini 3.1 Flash TTS becomes a tool your assistant can call directly — it authorizes via OAuth (no API key in config) and runs this model with the run_model tool using the endpoint google/gemini-3.1-flash-tts.

MCP client config (Claude Desktop, Cursor)

{
  "mcpServers": {
    "modelrunner": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.modelrunner.run/mcp"]
    }
  }
}

Claude Code

claude mcp add --transport http modelrunner https://mcp.modelrunner.run/mcp

Then ask your assistant, for example: “Run google/gemini-3.1-flash-tts on ModelRunner to generate sound”. MCP setup guide.

Model Details

Model Details

Gemini 3.1 Flash TTS is Google's controllable text-to-speech model. It turns written text into natural, expressive speech and lets you direct the performance in plain language rather than through markup or SSML.

The `prompt` field carries both the style direction and the words to be spoken, in the form `{style instruction}: {text}` — for example `Say the following in a warm, curious way: OK, so... tell me about this AI thing.` The model follows that instruction for accent, pace, tone and emotional expression, so the same sentence can be delivered as a whisper, a newscast read, an excited aside or a calm audiobook narration without re-recording anything. This is the main reason to reach for it over a conventional speech synthesiser: the delivery is a parameter, not a fixed property of the voice.

Thirty prebuilt voices are available, each with its own character — Kore is firm, Puck upbeat, Aoede breezy, Charon informative, Sulafat warm, Enceladus breathy, Gacrux mature, Zubenelgenubi casual — and any of them can be paired with a supported locale through `language_code`. Gemini 3.1 also adds expressive audio tags that you can place inline in the text, such as `[laughs]` or `[sigh]`, for finer narration control than a style sentence alone provides.

Combined prompt and text are capped at roughly 8,000 bytes, and a single call returns up to about 655 seconds of audio; input longer than that is truncated. Output is a 24 kHz mono WAV file, and billing is per second of generated audio, so a short line costs a fraction of a cent.

Use it for voice-over and narration, audiobooks and e-learning, IVR and assistant prompts, character dialogue, and anywhere you need a specific delivery rather than a generic read.