> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modellix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

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



## OpenAPI

````yaml /model-api/google/google-t2s.json post /google/gemini-3.1-flash-tts
openapi: 3.1.0
info:
  title: Google Text-to-Speech Models API
  description: >-
    Google Gemini text-to-speech. Converts plain text into controllable speech
    audio. Submit an async task, then poll GET /api/v1/tasks/{task_id} for the
    audio.
  version: 1.0.0
  contact:
    name: Modellix Support
    email: support@modellix.ai
servers:
  - url: https://api.modellix.ai/api/v1
    description: The text-to-speech models API from Google.
security:
  - bearerAuth: []
paths:
  /google/gemini-3.1-flash-tts:
    post:
      summary: Gemini 3.1 Flash TTS
      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:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Gemini31FlashTTSRequest'
            examples:
              single_speaker:
                summary: Single speaker with style prompt
                value:
                  text: Hello, welcome to Modellix!
                  prompt: Friendly and warm tone, cheerful and upbeat delivery
                  language_code: en-us
                  speakers:
                    - speaker: Narrator
                      voice: Kore
              dual_speaker:
                summary: Two-speaker dialogue
                value:
                  text: |-
                    Joe: Hi there!
                    Jane: Hello, nice to meet you.
                  language_code: en-us
                  speakers:
                    - speaker: Joe
                      voice: Kore
                    - speaker: Jane
                      voice: Puck
              with_audio_tags:
                summary: Expressive delivery with audio tags
                value:
                  text: >-
                    [whispering] This is a secret. [short pause] But not for
                    long!
                  prompt: >-
                    Dramatic suspenseful narration. Whisper the secret lines
                    softly, then return to a tense, urgent tone.
                  language_code: en-us
                  speakers:
                    - speaker: Narrator
                      voice: Kore
      responses:
        '200':
          description: >-
            Task submitted successfully. Poll GET /api/v1/tasks/{task_id} until
            the task completes; synthesized audio is returned on the task
            result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncTaskResponse'
              example:
                code: 0
                message: success
                data:
                  status: pending
                  task_id: task-gemini-tts-001
                  model_id: google/gemini-3.1-flash-tts
                  get_result:
                    method: GET
                    url: https://api.modellix.ai/api/v1/tasks/task-gemini-tts-001
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    Gemini31FlashTTSRequest:
      type: object
      required:
        - text
        - speakers
      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:
        text:
          type: string
          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.
          minLength: 1
          maxLength: 8000
          example: Hello, welcome to Modellix!
        prompt:
          type: string
          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.
          maxLength: 4000
          example: Friendly and warm tone
        language_code:
          type: string
          description: >-
            Optional BCP-47 language and accent code. Examples: en-us, en-in,
            cmn-cn, ja-jp, ko-kr, fr-fr.
          pattern: ^[a-z]{2,3}(-[a-z0-9]+)*$
          example: en-us
        speakers:
          type: array
          description: >-
            Speaker configuration. Required. Length 1 (single voice) or 2
            (dialogue). Voice is always set here; there is no top-level voice
            field.
          minItems: 1
          maxItems: 2
          items:
            $ref: '#/components/schemas/TTSSpeaker'
    AsyncTaskResponse:
      type: object
      required:
        - code
        - message
        - data
      properties:
        code:
          type: integer
          description: Response code, 0 indicates success
          example: 0
        message:
          type: string
          description: Response message
          example: success
        data:
          type: object
          required:
            - status
            - task_id
            - model_id
          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:
            status:
              type: string
              enum:
                - pending
                - processing
              description: Initial task status
              example: pending
            task_id:
              type: string
              description: Unique task identifier for polling
              example: task-gemini-tts-001
            model_id:
              type: string
              description: Model ID in provider/model format
              example: google/gemini-3.1-flash-tts
            get_result:
              type: object
              description: Endpoint to query the task result
              properties:
                method:
                  type: string
                  example: GET
                url:
                  type: string
                  example: https://api.modellix.ai/api/v1/tasks/task-gemini-tts-001
    TTSSpeaker:
      type: object
      required:
        - speaker
        - voice
      properties:
        speaker:
          type: string
          description: >-
            Speaker label. For dialogue, must match names used in text (e.g.
            "Joe: ..."). Alphanumeric only, 1-64 characters.
          minLength: 1
          maxLength: 64
          pattern: ^[A-Za-z0-9]+$
          example: Narrator
        voice:
          type: string
          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
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: Error code (equals HTTP status code)
          example: 400
        message:
          type: string
          description: 'Error message in format ''Category: detail'''
          example: 'Invalid parameters: combined prompt and text must be <= 8000 bytes'
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 400
            message: 'Invalid parameters: parameter ''text'' is required'
    Unauthorized:
      description: Unauthorized - Invalid or missing API Key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            message: 'Authentication failed: invalid API key'
    TooManyRequests:
      description: Too many requests - Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          description: Maximum requests per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Remaining quota in current window
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: Rate limit window reset time (Unix timestamp)
          schema:
            type: integer
            example: 1704067260
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 429
            message: >-
              Rate limit exceeded: 100 requests per minute, retry after 60
              seconds
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 500
            message: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Modellix API Key. Format: `Bearer <your_api_key>`'

````