Skip to content
No models found
OpenRouter
© 2026 OpenRouter, Inc

Product

  • Chat
  • Rankings
  • Apps
  • Models
  • Providers
  • Pricing
  • Enterprise
  • Labs

Company

  • About
  • Announcements
  • CareersHiring
  • Privacy
  • Terms of Service
  • Support
  • State of AI
  • Works With OR
  • Data

Developer

  • Documentation
  • API Reference
  • SDK
  • Status

Connect

  • Discord
  • GitHub
  • LinkedIn
  • X
  • YouTube
Favicon for google

Google: Gemini 3.1 Flash TTS Preview

google/gemini-3.1-flash-tts-preview

Compare

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. It takes text input and produces audio output across 70+ languages — nearly 3× the language coverage of its predecessor.

The headline addition is a system of 200+ inline audio tags (e.g. [whispers], [laughs], [excited]) that let developers steer delivery, emotion, and pacing mid-sentence, alongside a "director's chair" workflow in Google AI Studio for defining per-character Audio Profiles and scene-level context. It supports up to two speakers with independent voice and style configuration per speaker, outputs PCM audio at 24 kHz / 16-bit mono, and automatically watermarks all output with SynthID. Context window is 32k tokens.

Modalities

Input Price

$1per 1M

Output Price

$20per 1M

Context

8K

Weekly Tokens

166M

Released

Apr 24, 2026

Overview
Providers
Performance
Apps
Activity
Uptime
API

Sample code and API for Gemini 3.1 Flash TTS Preview

OpenRouter normalizes requests and responses across providers for you.

1

Get your API key

Create an API key from your OpenRouter dashboard and set it as an environment variable:

2

Make your first request

Use google/gemini-3.1-flash-tts-preview with the OpenRouter API:

OpenRouter provides a text-to-speech API that converts text into natural-sounding audio. Send text and a voice selection, and receive raw audio bytes in your chosen format.

The response is a raw audio stream (not JSON). The generation ID is returned in the X-Generation-Id response header for tracking.

Using third-party SDKs

For information about using third-party SDKs and frameworks with OpenRouter, please see our frameworks documentation.

Endpoint

POSThttps://openrouter.ai/api/v1/audio/speech
AuthorizationBearer $OPENROUTER_API_KEY
Content-Typeapplication/json
HTTP-Refereroptional — your site URL, for rankings
X-Titleoptional — your site name, for rankings
Modelgoogle/gemini-3.1-flash-tts-preview

Parameters

NameTypeDefaultDescription
max_tokensinteger—This sets the upper limit for the number of tokens the model can generate in response.
temperaturefloat1This setting influences the variety in the model's responses.
top_pfloat1This setting limits the model's choices to a percentage of likely tokens: only the top tokens whose probabilities add up to P.
seedinteger—If specified, the inferencing will sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
response_formatmap—Forces the model to produce specific output format.