Skip to content

Gemini 3.1 Flash Tts

Integrate

Model id gemini-3.1-flash-tts
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/gemini-3.1-flash-tts?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

This request: $0.003 3 API credits Run it on this page

Get API key
Google Text to Speech LipsyncFast #avatar

Gemini 3.1 Flash text-to-speech with inline style control, 30 voices and up to 10 speakers

Google · Audio

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

•required 50 / 50000

Speech-synthesis text for Gemini 3.1 Flash TTS; multi-speaker lines must start with aliases from the speakers field, as in 'Alice: Hello!\nBob: Hi!'. Delivery can be finely controlled with expressive audio tags such as [sigh], [laughing], [whispering], and [short pause], or with inline natural-language directions for accent, emotion, pacing, and style, such as 'Say cheerfully: Have a wonderful day!'.

Advanced style_instructions · output_format · voice · language_code · temperature · speakers
0 / 4000

Optional natural-language directions kept separate from spoken content and inserted before the prompt to shape expressiveness, accent, pace, tone, and emotion. Examples include 'Speak warmly and slowly', 'Read this as a dramatic newscast', 'Use a British accent with a cheerful tone', and 'Whisper mysteriously'.

output_format default mp3

Format for the output audio: mp3 provides compressed, compact files and is recommended; wav contains uncompressed PCM in a WAV container at 24 kHz with 16-bit mono audio; ogg_opus uses Opus inside Ogg for a favorable balance of quality and size.

default Kore

Single-speaker voice selection from 30 distinct presets; setting speakers makes this selection inactive. Popular female options are Kore, with a strong and firm delivery, Zephyr, with a bright and clear delivery, and Aoede, with a warm and melodic delivery; popular male options are Puck, upbeat and lively, and Charon, calm and professional.

Multilingual synthesis language override: automatic detection from the text applies unless you specify a language to steer the model's speech.

default 1

Speech randomness setting, ranging in effect from focused, predictable delivery at lower settings to creative, varied delivery at higher settings.

Voice configuration that enables multiple speakers to read separate portions of the text. Assign each speaker a voice plus a speaker_id alias matching the corresponding prompt prefixes.

POST /run/gemini-3.1-flash-tts?wait=20 quote → $0.003
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/gemini-3.1-flash-tts?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Hello from Doitong. This is a short test sentence."
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Gemini 3.1 Flash Tts

Converts a `prompt` of up to 50000 characters into speech. Delivery can be steered inline or via `style_instructions`. Pick one of 30 voices, set a `language_code`, or use `speakers` (2 to 10) for multi-speaker audio. Output is mp3, wav or ogg_opus, with `temperature` from 0 to 2.

Parameters

NameType DefaultAllowed Description
promptrequired
Typestring
≤ 50,000 characters
Speech-synthesis text for Gemini 3.1 Flash TTS; multi-speaker lines must start with aliases from the speakers field, as in 'Alice: Hello!\nBob: Hi!'. Delivery can be finely controlled with expressive audio tags such as [sigh], [laughing], [whispering], and [short pause], or with inline natural-language directions for accent, emotion, pacing, and style, such as 'Say cheerfully: Have a wonderful day!'.
style_instructionsoptional
Typestring | null
≤ 4,000 characters
Optional natural-language directions kept separate from spoken content and inserted before the prompt to shape expressiveness, accent, pace, tone, and emotion. Examples include 'Speak warmly and slowly', 'Read this as a dramatic newscast', 'Use a British accent with a cheerful tone', and 'Whisper mysteriously'.
voiceoptional
Typeenum
DefaultKore
AchernarAchirdAlgenibAlgiebaAlnilamAoedeAutonoeCallirrhoeCharonDespinaEnceladusErinomeFenrirGacruxIapetusKore
+14 moreLaomedeiaLedaOrusPulcherrimaPuckRasalgethiSadachbiaSadaltagerSchedarSulafatUmbrielVindemiatrixZephyrZubenelgenubi
Single-speaker voice selection from 30 distinct presets; setting speakers makes this selection inactive. Popular female options are Kore, with a strong and firm delivery, Zephyr, with a bright and clear delivery, and Aoede, with a warm and melodic delivery; popular male options are Puck, upbeat and lively, and Charon, calm and professional.
language_codeoptional
Typeenum
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)
+71 moreRussian (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)
Multilingual synthesis language override: automatic detection from the text applies unless you specify a language to steer the model's speech.
speakersoptional
Typeobject[]
Voice configuration that enables multiple speakers to read separate portions of the text. Assign each speaker a voice plus a speaker_id alias matching the corresponding prompt prefixes.
temperatureoptional
Typenumber
Default1
0 – 2
Speech randomness setting, ranging in effect from focused, predictable delivery at lower settings to creative, varied delivery at higher settings.
output_formatoptional
Typeenum
Defaultmp3
wavmp3ogg_opus
Format for the output audio: mp3 provides compressed, compact files and is recommended; wav contains uncompressed PCM in a WAV container at 24 kHz with 16-bit mono audio; ogg_opus uses Opus inside Ogg for a favorable balance of quality and size.
required

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "gemini-3.1-flash-tts",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 3,
    "usd": "0.003",
    "charged": 3,
    "refunded": 0
  },
  "input": {
    "prompt": "Hello from Doitong. This is a short test sentence."
  },
  "output": {
    "audio": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_name": "0-output.mp3",
      "file_size": 1843200
    }
  },
  "outputs": [
    {
      "type": "audio",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp3",
      "content_type": "audio/mpeg",
      "file_size": 1843200,
      "duration": 12,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
audio
object {url, content_type, file_name, file_size}Audio file produced by generation.

For AI agents: this page as Markdown is at https://doitong.com/developers/models/gemini-3.1-flash-tts.md. All models and guides: https://doitong.com/developers/llms.txt