{"servers":[{"url":"https://api.modellix.ai/api/v1/google/gemini-3.1-flash-tts"}],"post":{"description":"[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.","operationId":"gemini31FlashTTSAsync","requestBody":{"content":{"application/json":{"examples":{"dual_speaker":{"summary":"Two-speaker dialogue","value":{"language_code":"en-us","speakers":[{"speaker":"Joe","voice":"Kore"},{"speaker":"Jane","voice":"Puck"}],"text":"Joe: Hi there!\nJane: Hello, nice to meet you."}},"single_speaker":{"summary":"Single speaker with style prompt","value":{"language_code":"en-us","prompt":"Friendly and warm tone, cheerful and upbeat delivery","speakers":[{"speaker":"Narrator","voice":"Kore"}],"text":"Hello, welcome to Modellix!"}},"with_audio_tags":{"summary":"Expressive delivery with audio tags","value":{"language_code":"en-us","prompt":"Dramatic suspenseful narration. Whisper the secret lines softly, then return to a tense, urgent tone.","speakers":[{"speaker":"Narrator","voice":"Kore"}],"text":"[whispering] This is a secret. [short pause] But not for long!"}}},"schema":{"description":"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).","properties":{"language_code":{"description":"Optional BCP-47 language and accent code. Examples: en-us, en-in, cmn-cn, ja-jp, ko-kr, fr-fr.","example":"en-us","pattern":"^[a-z]{2,3}(-[a-z0-9]+)*$","type":"string"},"prompt":{"description":"Optional 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.","example":"Friendly and warm tone","maxLength":4000,"type":"string"},"speakers":{"description":"Speaker configuration. Required. Length 1 (single voice) or 2 (dialogue). Voice is always set here; there is no top-level voice field.","items":{"properties":{"speaker":{"description":"Speaker label. For dialogue, must match names used in text (e.g. \"Joe: ...\"). Alphanumeric only, 1-64 characters.","example":"Narrator","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9]+$","type":"string"},"voice":{"description":"Prebuilt Gemini TTS voice name.","enum":["Zephyr","Puck","Charon","Kore","Fenrir","Leda","Orus","Aoede","Callirrhoe","Autonoe","Enceladus","Iapetus","Umbriel","Algieba","Despina","Erinome","Algenib","Rasalgethi","Laomedeia","Achernar","Alnilam","Schedar","Gacrux","Pulcherrima","Achird","Zubenelgenubi","Sadachbia","Sadaltager","Sulafat","Vindemiatrix"],"example":"Kore","type":"string"}},"required":["speaker","voice"],"type":"object"},"maxItems":2,"minItems":1,"type":"array"},"text":{"description":"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.","example":"Hello, welcome to Modellix!","maxLength":8000,"minLength":1,"type":"string"}},"required":["text","speakers"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"example":{"code":0,"data":{"get_result":{"method":"GET","url":"https://api.modellix.ai/api/v1/tasks/task-gemini-tts-001"},"model_id":"google/gemini-3.1-flash-tts","status":"pending","task_id":"task-gemini-tts-001"},"message":"success"},"schema":{"properties":{"code":{"description":"Response code, 0 indicates success","example":0,"type":"integer"},"data":{"description":"Task submission details. Poll GET /api/v1/tasks/{task_id} until status is success; audio appears in result.resources with type audio and format wav.","properties":{"get_result":{"description":"Endpoint to query the task result","properties":{"method":{"example":"GET","type":"string"},"url":{"example":"https://api.modellix.ai/api/v1/tasks/task-gemini-tts-001","type":"string"}},"type":"object"},"model_id":{"description":"Model ID in provider/model format","example":"google/gemini-3.1-flash-tts","type":"string"},"status":{"description":"Initial task status","enum":["pending","processing"],"example":"pending","type":"string"},"task_id":{"description":"Unique task identifier for polling","example":"task-gemini-tts-001","type":"string"}},"required":["status","task_id","model_id"],"type":"object"},"message":{"description":"Response message","example":"success","type":"string"}},"required":["code","message","data"],"type":"object"}}},"description":"Task submitted successfully. Poll GET /api/v1/tasks/{task_id} until the task completes; synthesized audio is returned on the task result."},"400":{"content":{"application/json":{"example":{"code":400,"message":"Invalid parameters: parameter 'text' is required"},"schema":{"properties":{"code":{"description":"Error code (equals HTTP status code)","example":400,"type":"integer"},"message":{"description":"Error message in format 'Category: detail'","example":"Invalid parameters: combined prompt and text must be <= 8000 bytes","type":"string"}},"required":["code","message"],"type":"object"}}},"description":"Invalid request parameters"},"401":{"content":{"application/json":{"example":{"code":401,"message":"Authentication failed: invalid API key"},"schema":{"properties":{"code":{"description":"Error code (equals HTTP status code)","example":400,"type":"integer"},"message":{"description":"Error message in format 'Category: detail'","example":"Invalid parameters: combined prompt and text must be <= 8000 bytes","type":"string"}},"required":["code","message"],"type":"object"}}},"description":"Unauthorized - Invalid or missing API Key"},"429":{"content":{"application/json":{"example":{"code":429,"message":"Rate limit exceeded: 100 requests per minute, retry after 60 seconds"},"schema":{"properties":{"code":{"description":"Error code (equals HTTP status code)","example":400,"type":"integer"},"message":{"description":"Error message in format 'Category: detail'","example":"Invalid parameters: combined prompt and text must be <= 8000 bytes","type":"string"}},"required":["code","message"],"type":"object"}}},"description":"Too many requests - Rate limit exceeded","headers":{"X-RateLimit-Limit":{"description":"Maximum requests per minute","schema":{"example":100,"type":"integer"}},"X-RateLimit-Remaining":{"description":"Remaining quota in current window","schema":{"example":0,"type":"integer"}},"X-RateLimit-Reset":{"description":"Rate limit window reset time (Unix timestamp)","schema":{"example":1704067260,"type":"integer"}}}},"500":{"content":{"application/json":{"example":{"code":500,"message":"Internal server error"},"schema":{"properties":{"code":{"description":"Error code (equals HTTP status code)","example":400,"type":"integer"},"message":{"description":"Error message in format 'Category: detail'","example":"Invalid parameters: combined prompt and text must be <= 8000 bytes","type":"string"}},"required":["code","message"],"type":"object"}}},"description":"Internal server error"}},"summary":"Gemini 3.1 Flash TTS","x-mint":{"href":"google/gemini-3-1-flash-tts"}}}