Gemini 3.1 Flash Tts
google/gemini-3.1-flash-ttsGemini 3.1 Flash Tts by Google - convert text to natural-sounding speech with AI. Supports multiple voices, languages, emotions, and speaking styles for content creation and accessibility.
- Base price
- $0.05USD / run
- Execution
- async
- Model type
- audio
- Input fields
- 7
Try the model
Playground
What would you like to do next?
Examples
Select an example to load its inputs and result into the playground.
- Open result ↗
Input
{ "prompt": "I can't believe it worked! [laughing] After all those hours of debugging [sigh] it was just a missing semicolon." }
Model card
Specifications
Pricing
- Base price
- $0.05 / run
Context & modalities
- Input
- Schema-defined
- Output
- audio
Capabilities
- Chat
- Not supported
- Vision
- Not supported
- Reasoning
- Not supported
- Structured output
- Not supported
- Function calling
- Not supported
- Audio input
- Not supported
Access
- Provider
- Model ID
- google/gemini-3.1-flash-tts
- Execution
- async
- Base URL
- https://api.sandbase.ai
- API
- Unified Run API
- Endpoint
- /v1/run
API README
Gemini 3.1 Flash Tts
Gemini 3.1 Flash TTS speaks text in dozens of languages with 30 prebuilt voices, and supports two-speaker dialogue through speakers. Steer tone and pace with style_instructions.
Fields
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Text to speak. For dialogue, prefix lines with the speaker names defined in speakers. |
output_format | wav / mp3 / ogg_opus | mp3 | Output file format. |
temperature | number 0–2 | 1 | Higher values give more varied delivery. |
speakers | object[] | — | Optional speaker-to-voice list for multi-speaker dialogue. |
language_code | Arabic (Egypt) / Bangla (Bangladesh) / Dutch (Netherlands) / English (India) / English (US) / French (France) / German (Germany) / Hindi (India) / Indonesian (Indonesia) / Italian (Italy) / Japanese (Japan) / Korean (South Korea) / Marathi (India) / Polish (Poland) / Portuguese (Brazil) / Romanian (Romania) / Russian (Russia) / Spanish (Spain) / Tamil (India) / Telugu (India) / Thai (Thailand) / Turkish (Turkey) / Ukrainian (Ukraine) / Vietnamese (Vietnam) / Afrikaans (South Africa) / Albanian (Albania) / Amharic (Ethiopia) / Arabic (World) / Armenian (Armenia) / Azerbaijani (Azerbaijan) / Basque (Spain) / Belarusian (Belarus) / Bulgarian (Bulgaria) / Burmese (Myanmar) / Catalan (Spain) / Cebuano (Philippines) / Chinese Mandarin (China) / Chinese Mandarin (Taiwan) / Croatian (Croatia) / Czech (Czech Republic) / Danish (Denmark) / English (Australia) / English (UK) / Estonian (Estonia) / Filipino (Philippines) / Finnish (Finland) / French (Canada) / Galician (Spain) / Georgian (Georgia) / Greek (Greece) / Gujarati (India) / Haitian Creole (Haiti) / Hebrew (Israel) / Hungarian (Hungary) / Icelandic (Iceland) / Javanese (Java) / Kannada (India) / Konkani (India) / Lao (Laos) / Latin (Vatican City) / Latvian (Latvia) / Lithuanian (Lithuania) / Luxembourgish (Luxembourg) / Macedonian (North Macedonia) / Maithili (India) / Malagasy (Madagascar) / Malay (Malaysia) / Malayalam (India) / Mongolian (Mongolia) / Nepali (Nepal) / Norwegian Bokmal (Norway) / Norwegian Nynorsk (Norway) / Odia (India) / Pashto (Afghanistan) / Persian (Iran) / Portuguese (Portugal) / Punjabi (India) / Serbian (Serbia) / Sindhi (India) / Sinhala (Sri Lanka) / Slovak (Slovakia) / Slovenian (Slovenia) / Spanish (Latin America) / Spanish (Mexico) / Swahili (Kenya) / Swedish (Sweden) / Urdu (Pakistan) | — | Spoken language. |
voice | Achernar / Achird / Algenib / Algieba / Alnilam / Aoede / Autonoe / Callirrhoe / Charon / Despina / Enceladus / Erinome / Fenrir / Gacrux / Iapetus / Kore / Laomedeia / Leda / Orus / Pulcherrima / Puck / Rasalgethi / Sadachbia / Sadaltager / Schedar / Sulafat / Umbriel / Vindemiatrix / Zephyr / Zubenelgenubi | Kore | Prebuilt voice for single-speaker requests. |
style_instructions | string | — | How to say it. |
Billing
$0.05 per started 1,000 characters of text.
| Text | Price |
|---|---|
| 200 characters | $0.05 |
| 1,000 characters | $0.05 |
| 2,500 characters | $0.15 |
Failed runs are not charged.
Prompting
- For dialogue, write
Name: lineand map each name to a voice inspeakers.
Also on SandBase
Related: google/gemini-3.8-flash-tts (newer, cheaper).
Start building
Send your first request
OpenAI-compatible endpoint with unified authentication and usage tracking.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "google/gemini-3.1-flash-tts",
"voice": "Kore",
"prompt": "I can't believe it worked! [laughing] After all those hours of debugging [sigh] it was just a missing semicolon.",
"speakers": [
{
"voice": "Charon",
"speaker_id": "Host"
},
{
"voice": "Kore",
"speaker_id": "DrChen"
}
],
"temperature": 1,
"language_code": "English (US)",
"output_format": "mp3",
"style_instructions": "Say the following in a warm, conversational tone"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Input Schema
7 parameters · 1 required · 6 optional
| Parameter | Type | Required | Description |
|---|---|---|---|
prompt | string | Required | The text to convert to speech. Gemini 3.1 Flash TTS supports natural-language prompting for style, pace, accent, and emotional expression — include delivery instructions inline with the text (e.g. 'Say cheerfully: Have a wonderful day!'). Supports expressive audio tags like [sigh], [laughing], [whispering], [short pause] for fine-grained control over delivery. For multi-speaker synthesis, prefix lines with speaker aliases defined in the speakers field (e.g. 'Alice: Hello!\nBob: Hi!'). · Min length: 1 · Max length: 50000 |
voice | string | Optional | Voice preset for single-speaker synthesis. 30 distinct voices are available. Ignored when speakers is set. Popular choices: Kore (strong, firm female), Puck (upbeat, lively male), Charon (calm, professional male), Zephyr (bright, clear female), Aoede (warm, melodic female). · Options: Achernar, Achird, Algenib, Algieba, Alnilam, Aoede, Autonoe, Callirrhoe, Charon, Despina, Enceladus, Erinome, Fenrir, Gacrux, Iapetus, Kore, Laomedeia, Leda, Orus, Pulcherrima, Puck, Rasalgethi, Sadachbia, Sadaltager, Schedar, Sulafat, Umbriel, Vindemiatrix, Zephyr, Zubenelgenubi · Default: "Kore" AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKoreLaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi |
speakers | object[] | Optional | Multi-speaker voice configuration. When set, enables multi-speaker synthesis where different parts of the text are spoken by different voices. Each speaker needs a voice and a speaker_id (alias) that matches prefixes in the prompt. |
temperature | number | Optional | Controls the randomness of the speech output. Higher values produce more creative and varied delivery, while lower values make the output more predictable and focused. · Min: 0 · Max: 2 · Default: 1 |
language_code | string | Optional | Language for multilingual synthesis. When set, steers the model to speak in the specified language. If not set, the model auto-detects the language from the text. · Options: Arabic (Egypt), Bangla (Bangladesh), Dutch (Netherlands), English (India), English (US), French (France), German (Germany), Hindi (India), Indonesian (Indonesia), Italian (Italy), Japanese (Japan), Korean (South Korea), Marathi (India), Polish (Poland), Portuguese (Brazil), Romanian (Romania), Russian (Russia), Spanish (Spain), Tamil (India), Telugu (India), Thai (Thailand), Turkish (Turkey), Ukrainian (Ukraine), Vietnamese (Vietnam), Afrikaans (South Africa), Albanian (Albania), Amharic (Ethiopia), Arabic (World), Armenian (Armenia), Azerbaijani (Azerbaijan), Basque (Spain), Belarusian (Belarus), Bulgarian (Bulgaria), Burmese (Myanmar), Catalan (Spain), Cebuano (Philippines), Chinese Mandarin (China), Chinese Mandarin (Taiwan), Croatian (Croatia), Czech (Czech Republic), Danish (Denmark), English (Australia), English (UK), Estonian (Estonia), Filipino (Philippines), Finnish (Finland), French (Canada), Galician (Spain), Georgian (Georgia), Greek (Greece), Gujarati (India), Haitian Creole (Haiti), Hebrew (Israel), Hungarian (Hungary), Icelandic (Iceland), Javanese (Java), Kannada (India), Konkani (India), Lao (Laos), Latin (Vatican City), Latvian (Latvia), Lithuanian (Lithuania), Luxembourgish (Luxembourg), Macedonian (North Macedonia), Maithili (India), Malagasy (Madagascar), Malay (Malaysia), Malayalam (India), Mongolian (Mongolia), Nepali (Nepal), Norwegian Bokmal (Norway), Norwegian Nynorsk (Norway), Odia (India), Pashto (Afghanistan), Persian (Iran), Portuguese (Portugal), Punjabi (India), Serbian (Serbia), Sindhi (India), Sinhala (Sri Lanka), Slovak (Slovakia), Slovenian (Slovenia), Spanish (Latin America), Spanish (Mexico), Swahili (Kenya), Swedish (Sweden), Urdu (Pakistan) Arabic (Egypt)Bangla (Bangladesh)Dutch (Netherlands)English (India)English (US)French (France)German (Germany)Hindi (India)Indonesian (Indonesia)Italian (Italy)Japanese (Japan)Korean (South Korea)Marathi (India)Polish (Poland)Portuguese (Brazil)Romanian (Romania)Russian (Russia)Spanish (Spain)Tamil (India)Telugu (India)Thai (Thailand)Turkish (Turkey)Ukrainian (Ukraine)Vietnamese (Vietnam)Afrikaans (South Africa)Albanian (Albania)Amharic (Ethiopia)Arabic (World)Armenian (Armenia)Azerbaijani (Azerbaijan)Basque (Spain)Belarusian (Belarus)Bulgarian (Bulgaria)Burmese (Myanmar)Catalan (Spain)Cebuano (Philippines)Chinese Mandarin (China)Chinese Mandarin (Taiwan)Croatian (Croatia)Czech (Czech Republic)Danish (Denmark)English (Australia)English (UK)Estonian (Estonia)Filipino (Philippines)Finnish (Finland)French (Canada)Galician (Spain)Georgian (Georgia)Greek (Greece)Gujarati (India)Haitian Creole (Haiti)Hebrew (Israel)Hungarian (Hungary)Icelandic (Iceland)Javanese (Java)Kannada (India)Konkani (India)Lao (Laos)Latin (Vatican City)Latvian (Latvia)Lithuanian (Lithuania)Luxembourgish (Luxembourg)Macedonian (North Macedonia)Maithili (India)Malagasy (Madagascar)Malay (Malaysia)Malayalam (India)Mongolian (Mongolia)Nepali (Nepal)Norwegian Bokmal (Norway)Norwegian Nynorsk (Norway)Odia (India)Pashto (Afghanistan)Persian (Iran)Portuguese (Portugal)Punjabi (India)Serbian (Serbia)Sindhi (India)Sinhala (Sri Lanka)Slovak (Slovakia)Slovenian (Slovenia)Spanish (Latin America)Spanish (Mexico)Swahili (Kenya)Swedish (Sweden)Urdu (Pakistan) |
output_format | string | Optional | Audio output format. mp3: compressed, small file size (recommended). wav: uncompressed PCM wrapped in WAV (24 kHz, 16-bit mono). ogg_opus: Ogg container with Opus codec, good quality-to-size ratio. · Options: wav, mp3, ogg_opus · Default: "mp3" wavmp3ogg_opus |
style_instructions | string | Optional | Optional style and delivery instructions prepended to the prompt. Controls expressiveness, accent, pace, tone, and emotional expression using natural language. Use this to separate style control from the text content. Examples: 'Speak warmly and slowly', 'Read this as a dramatic newscast', 'Use a British accent with a cheerful tone', 'Whisper mysteriously'. · Max length: 4000 |
Output Schema
| Field | Type | Description |
|---|---|---|
id | string | Unique identifier for the generation task |
status | string | Task status: pending, running, completed, failed, timeout |
model | string | Model used for the generation |
outputs | array | Array of output items |
outputs[].url | string | URL of the generated artifact |
outputs[].content_type | string | MIME type (e.g. image/png, video/mp4) |
error | object | null | Error details if failed, null on success |
error.type | string | Machine-readable error type code |
error.message | string | Human-readable error description |
Async Workflow
This model runs asynchronously. Submit a request, then poll for the result.
- Submit: POST to /v1/run and read the returned
id. - Poll: GET /v1/run/{id} until status is
completed,failedortimeout. - Retrieve: read
outputsfrom the completed response.
Choose your model
Compare models
| Model | Type | Default price | Released |
|---|---|---|---|
Gemini 3.1 Flash TtsThis model Google | Audio | $0.05 / run | Apr 16, 2026 |
Google | Audio | $0.04 / run | Sep 25, 2026 |
Google | Audio | $0.03 / run | Sep 25, 2026 |
Google | Audio | $0.10 / run | Sep 15, 2026 |
Questions
FAQ
How do I call Google Gemini 3.1 Flash Tts through SandBase?
Create a SandBase API key, then send requests with the model ID "google/gemini-3.1-flash-tts" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.
Do I need a separate Google account?
No. One SandBase API key and balance gives you access to Google Gemini 3.1 Flash Tts and the other models in the catalog; you do not need to sign up with Google separately.
