{"servers":[{"url":"https://api.modellix.ai/api/v1/google/gemini-3.8-flash-tts"}],"post":{"description":"[Core Function] Gemini 3.8 Flash TTS is Google's controllable text-to-speech model, currently in Preview. [Strengths] Single-speaker and two-speaker dialogue, preset voices, 130 languages via language_code, and expressive delivery through turn-level style and inline vocal tags. Output is WAV (24 kHz mono PCM). [Best For] Voiceovers, audiobook narration, multilingual speech, podcast-style scripts, and two-person dialogue. [Limitations] Do NOT use this for streaming, voice creation, 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. Dialogue requires exactly two speakers with preset voices. Combined text and style must stay within 8,192 Unicode characters. [Routing] Route here for expressive Gemini TTS with per-turn style control; for the prompt-based request format use Gemini 3.1 Flash TTS; for video with native audio use Veo.","operationId":"gemini38FlashTTSAsync","requestBody":{"content":{"application/json":{"examples":{"dual_speaker":{"summary":"Two-speaker dialogue, one part per turn","value":{"language_code":"en-us","speakers":[{"speaker":"Joe","voice":"Puck"},{"speaker":"Jane","voice":"Kore"}],"turns":[{"speaker":"Joe","style":"cheerful and friendly","text":"How is it going today, Jane?"},{"speaker":"Jane","style":"calm and relaxed","text":"Pretty good. Ready when you are."}]}},"single_speaker":{"summary":"Single speaker with turn style","value":{"language_code":"en-us","style":"cheerful and friendly","text":"Have a wonderful day!","voice":"Kore"}}},"schema":{"description":"Gemini 3.8 Flash TTS request. Single-speaker calls send text and voice, with optional style and language_code, and omit speakers and turns. Two-speaker calls send speakers (exactly 2) and turns, and must omit top-level text, voice, and style. style is delivery direction and is not spoken. text is the verbatim transcript. The combined text and trimmed style across the request must not exceed 8,192 Unicode characters. The 3.1 prompt field is not supported. For single-speaker synthesis, voice accepts a prebuilt name (such as Kore or Puck), an extended voice-library ID, or a voice_ / voicekey_ ID. Voice creation and management are not part of this endpoint.","properties":{"language_code":{"description":"Optional BCP-47 language tag in lowercase. Examples: en-us, cmn-cn, ja-jp. The model can also detect the language from the transcript.","example":"en-us","pattern":"^[a-z]{2,3}(-[a-z0-9]+)*$","type":"string"},"speakers":{"description":"Required for two-speaker synthesis. Exactly two speakers. Omit this field for single-speaker calls.","items":{"properties":{"speaker":{"description":"Speaker name used by turns. Alphanumeric, 1-64 characters.","example":"Joe","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9]+$","type":"string"},"voice":{"description":"Preset Gemini voice name for this speaker, such as Puck or Kore. Designed or replicated voices (voice_... or voicekey_...) are not supported in dialogue.","example":"Puck","maxLength":256,"minLength":1,"type":"string"}},"required":["speaker","voice"],"type":"object"},"maxItems":2,"minItems":2,"type":"array"},"style":{"description":"Optional single-speaker delivery direction (emotion, pace, tone). Not spoken aloud. Max 8,192 characters, counted together with text.","example":"cheerful and friendly","maxLength":8192,"type":"string"},"text":{"description":"Verbatim transcript for single-speaker synthesis. Required in single-speaker mode. Do not include stage directions here. Inline vocal events use angle brackets. Together with style, the request must stay within 8,192 characters.","example":"Have a wonderful day!","maxLength":8192,"minLength":1,"type":"string"},"turns":{"description":"Required for two-speaker synthesis. One object per spoken turn, in order. Each speaker must match a name in speakers, case-sensitively. All turns produce one WAV file. The sum of all turn text and trimmed style must stay within 8,192 Unicode characters.","items":{"properties":{"speaker":{"description":"Which configured speaker says this turn.","example":"Joe","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9]+$","type":"string"},"style":{"description":"Optional delivery direction for this turn only. Not spoken aloud.","example":"cheerful and friendly","maxLength":8192,"type":"string"},"text":{"description":"Verbatim line for this turn.","example":"How is it going today, Jane?","maxLength":8192,"minLength":1,"type":"string"}},"required":["speaker","text"],"type":"object"},"minItems":1,"type":"array"},"voice":{"description":"Required for single-speaker synthesis. Prebuilt voice name, extended voice-library ID, or a designed/replicated voice ID (voice_... or voicekey_...). No spaces. Max 256 characters.","example":"Kore","maxLength":256,"minLength":1,"type":"string"}},"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-38-tts-001"},"model_id":"google/gemini-3.8-flash-tts","status":"pending","task_id":"task-gemini-38-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.8 Flash TTS","x-mint":{"content":"## Billing\n\nBilled in **USD per million input characters**. Current prices are listed on the [Modellix Pricing Page](https://www.modellix.ai/pricing).\n\n- **Single speaker:** Count Unicode characters in `text`.\n- **Two speakers:** Sum Unicode characters in all `turns[].text`, without adding separators.\n- `style`, speaker names, voice names, and `language_code` are excluded from the character count.\n","href":"google/gemini-3-8-flash-tts"}}}