Gemini 3.1 Flash TTS Text to Speech API

google/gemini-3.1-flash/text-to-speech

Gemini 3.1 Flash TTS Text to Speech turns scripts into multilingual audio with two speakers and 30 preset voices. Direct the overall delivery through style instructions, then use inline tags to shape pauses and emotion within individual lines.

Input
Required257 / 50,000
Optional
Speakers
Optional
Optional
Optional
Output
Audio available
$0.120 / 1K chars | 24 credits / 1K chars | Text + Style Instructions
Explore more audio models

Examples

A little warmth in the rain

A little warmth in the rain — A Mandarin photography tour uses gentle emphasis and unhurried pauses.

Half a wheel

Half a wheel — British race commentary builds pace and excitement, then settles after the finish.

Gemini 3.1 Flash TTS Text to Speech

Gemini 3.1 Flash TTS Text to Speech is Google’s speech generation model for narration and dialogue. It combines overall style instructions, inline audio tags and individual speaker voices to guide tone, pacing and expression. Assign distinct voices to a podcast host and guest, or turn localized lesson scripts into spoken audio for review and editing.

Why Choose Gemini 3.1 Flash TTS

  • Generate a two-speaker conversationAssign separate voices to a host and guest, then label their lines to generate the conversation in one request, reducing separate generation and assembly steps.

  • Direct overall delivery in natural languageDescribe the speaker’s role, tone, accent and pace to set the overall delivery for lessons, stories or product narration.

  • Shape expression within individual linesMark pauses, whispers or laughter at specific points to direct key lines, emotional turns and character reactions, then review and refine each passage.

  • Cast roles with 30 preset voicesCompare presets such as Kore, Puck and Zephyr using the same script, then choose a narrator’s voice or pair distinct voices for two dialogue roles.

  • Voice localized scriptsUse automatic language detection or an explicit language selection to turn translated lesson and product scripts into speech, with style instructions guiding delivery for each version.

Parameters

ParameterRequiredWhat it controls
textRequired

Enter 1–50,000 Unicode characters, including spaces, line breaks and audio tags. Prefix dialogue lines with the matching Speaker Id and a colon.

style_instructionsOptional

Describe the tone, pace, accent and emotion for the whole request.

voiceOptional

Choose one of 30 voice presets for single-speaker speech. Default: Kore.

DefaultKore
speakersOptional

Give each of the two speakers a unique Speaker Id and a Voice, then match each line prefix to the corresponding alias.

language_codeOptional

Choose a language value, or use automatic detection from Text.

temperatureOptional

Set speech variation from 0 to 2. Higher values allow more varied delivery. Default: 1.

Default1
output_formatOptional

Choose mp3 for playback, wav for uncompressed editing, or ogg_opus for compact audio. Default: mp3.

Defaultmp3
speakers[].speaker_idRequired per speaker

Use a unique alias made of letters, digits and underscores, then prefix the corresponding lines in Text with that alias.

speakers[].voiceRequired per speaker

Select this speaker’s voice from the 30 presets.

Create narration or dialogue

  1. Prepare the scriptEnter the spoken words in Text, organize sentences with punctuation and add audio tags at the relevant points.

  2. Assign speaker voicesFor narration, choose Voice. For dialogue, fill in Speakers[0].Speaker Id and Speakers[1].Speaker Id, select each speaker’s Voice and prefix their lines with the matching alias and a colon.

  3. Set delivery and submitDescribe tone and pace in Style Instructions, choose Language Code and Output Format, review the estimate and select Run.

  4. Listen and exportListen to the voices and pauses in the output panel, then save the audio from the download menu. Revise the script or style instructions for another take.

Usage and pricing

Speech costs $0.120 (24 credits) per 1,000 Unicode characters, calculated from Text plus Style Instructions.

UsageRateCalculation
Speech generation$0.120 / 1K chars1,000 total characters cost 24 credits. 500 total characters cost 12 credits ($0.060).
Character countText + Style InstructionsCount Unicode code points, including spaces, line breaks and audio tags. A single emoji such as 😀 counts as one code point.

Speech for your project

  • Podcast dialogueGive host and guest lines separate voices for interview segments and question-and-answer shows.

  • Product narrationExplain product features at a clear pace and mark pauses before key points for editing alongside demonstrations.

  • Multilingual lessonsTurn localized lesson scripts into speech using the chosen voice and style instructions across a course.

Direct your speech

  • Use Style Instructions for the speaker’s role, tone and pace, such as “Warm course instructor, steady pace, pauses around key terms.”
  • Place [short pause], [whispering] or [laughing] at the relevant point in a line and review a short sample first.
  • Keep dialogue aliases unique and match each line prefix exactly to the corresponding Speaker Id.
  • Compare voices using the same short script, then use the selected voice and style instructions for the full piece.

Prepare dialogue lines

  • Use distinct aliases for the two speakers and prefix each line with its alias and a colon, such as Host: or Guest:.
  • Put overall delivery directions in Style Instructions and use audio tags in Text for local pauses and emotional changes.

Gemini 3.1 Flash TTS Text to Speech API frequently asked questions

What is the Gemini 3.1 Flash TTS Text to Speech API?

Gemini 3.1 Flash TTS Text to Speech is a Google model that turns scripts into narration and dialogue. It offers 30 preset voices, two-speaker dialogue and multilingual delivery for podcasts, lessons and product voiceovers. Style instructions guide the overall delivery, inline tags shape individual lines, and speaker settings assign each role a voice. You can call it programmatically or try it in the Playground tab.

How does Gemini 3.1 Flash TTS generate two-speaker dialogue?

Assign each of the two speakers a voice and a unique alias, then prefix each line with the matching alias and a colon. Dialogue uses the voices configured in Speakers. Aliases consist of letters, digits and underscores.

Which preset voices does Gemini 3.1 Flash TTS offer?

Choose from 30 preset voices, including Kore, Puck and Zephyr. Kore is the default for single-speaker speech. Compare voices with the same short script before selecting one for narration or a dialogue role.

How do I direct overall style in Gemini 3.1 Flash TTS?

Describe tone, pace, accent and emotion in Style Instructions, such as warm instruction or steady narration. Keep the spoken words in Text so you can adjust the script and its delivery separately.

How do inline audio tags work in Gemini 3.1 Flash TTS?

Insert [short pause], [whispering] or [laughing] at the relevant point to guide a pause, whisper or laugh. Review a tagged short passage before applying that delivery to the full script.

How do I create Chinese speech with Gemini 3.1 Flash TTS?

Enter a Chinese script and select Chinese Mandarin (China) or Chinese Mandarin (Taiwan) in Language Code. You can also use automatic detection from the text and describe the desired pacing in Style Instructions.

How long can a Gemini 3.1 Flash TTS script be?

Text accepts 1–50,000 Unicode characters, including spaces, line breaks and audio tags. Organize longer work into chapters and review the voice and pacing on a short passage before generating a full chapter.

Which audio formats does Gemini 3.1 Flash TTS offer?

Output Format offers mp3, wav and ogg_opus, with mp3 as the default. Use MP3 for everyday playback, WAV for editing and Ogg Opus for workflows that favor compact audio files.