Gemini 3.1 Flash TTS
[Core Function] Gemini 3.1 Flash TTS is Google’s low-latency, controllable text-to-speech model. [Strengths] Single-speaker and two-speaker dialogue, 30 prebuilt voices, 70+ languages via language_code, and expressive delivery through style prompts plus inline audio tags such as [whispers], [slow], [fast], and [laughs]. Output is WAV (24 kHz mono PCM). [Best For] Voiceovers, virtual presenters, audiobook narration, multilingual speech, podcast-style scripts, and two-person dialogue. [Limitations] Do NOT use for lip-syncing existing video, music or sound-effect generation, image or audio inputs, MP3/OGG export, or API-level speed, volume, encoding, or sample-rate controls. Combined prompt and text must stay within 8,000 bytes. [Routing] Route here for controllable Gemini TTS from text only; for video with native audio use Veo; for talking-head lip sync from a portrait plus audio use Kling Avatar or SkyReels avatar models.
Authorizations
Modellix API Key. Format: Bearer <your_api_key>
Body
Gemini 3.1 Flash TTS request. Always pass voice through speakers (1-2 items), even for single-speaker synthesis. When prompt is set, style and script are combined as "{prompt}: {text}". Byte limits apply to UTF-8 length (multibyte characters count toward the limit).
Script to be spoken. Required. Max 8,000 bytes when used alone; if prompt is set, combined "{prompt}: {text}" must not exceed 8,000 bytes. When prompt is set, put only the spoken script here (do not repeat style instructions such as "Say cheerfully:" in text). May include inline audio tags such as [whispers], [slow], [fast], [laughs], and [short pause] to steer delivery.
1 - 8000"Hello, welcome to Modellix!"
Speaker configuration. Required. Length 1 (single voice) or 2 (dialogue). Voice is always set here; there is no top-level voice field.
1 - 2 elementsOptional director or style instruction (tone, pace, emotion, scene). Max 4,000 bytes. Merged with text as "{prompt}: {text}". Combined prompt + ": " + text must not exceed 8,000 bytes. If you omit prompt, you may embed direction in text using Google's single-field pattern (e.g. "Say cheerfully: ...") or audio tags.
4000"Friendly and warm tone"
Optional BCP-47 language and accent code. Examples: en-us, en-in, cmn-cn, ja-jp, ko-kr, fr-fr.
^[a-z]{2,3}(-[a-z0-9]+)*$"en-us"
Response
Task submitted successfully. Poll GET /api/v1/tasks/{task_id} until the task completes; synthesized audio is returned on the task result.