# Google Gemini 3.1 Flash Tts API

> Gemini 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.

Source: https://www.sandbase.ai/model/google/gemini-3.1-flash-tts
API reference: https://www.sandbase.ai/model/google/gemini-3.1-flash-tts/docs

## Facts

- Provider: Google
- Type: Audio model
- Model ID: `google/gemini-3.1-flash-tts`
- Price: From $0.05 per run
- Capabilities: text to speech
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "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"
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## 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.

## 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: line` and map each name to a voice in `speakers`.

#### Also on SandBase

Related: `google/gemini-3.8-flash-tts` (newer, cheaper).
