> ## 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.8 Flash TTS

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

## Billing

Billed in **USD per million input characters**. Current prices are listed on the [Modellix Pricing Page](https://www.modellix.ai/pricing).

* **Single speaker:** Count Unicode characters in `text`.
* **Two speakers:** Sum Unicode characters in all `turns[].text`, without adding separators.
* `style`, speaker names, voice names, and `language_code` are excluded from the character count.


## OpenAPI

````yaml /media-model-api/google/google-t2s.json post /google/gemini-3.8-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.8-flash-tts:
    post:
      summary: Gemini 3.8 Flash TTS
      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:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Gemini38FlashTTSRequest'
            examples:
              single_speaker:
                summary: Single speaker with turn style
                value:
                  text: Have a wonderful day!
                  style: cheerful and friendly
                  language_code: en-us
                  voice: Kore
              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
                      text: How is it going today, Jane?
                      style: cheerful and friendly
                    - speaker: Jane
                      text: Pretty good. Ready when you are.
                      style: calm and relaxed
      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-38-tts-001
                  model_id: google/gemini-3.8-flash-tts
                  get_result:
                    method: GET
                    url: >-
                      https://api.modellix.ai/api/v1/tasks/task-gemini-38-tts-001
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    Gemini38FlashTTSRequest:
      type: object
      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:
        text:
          type: string
          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.
          minLength: 1
          maxLength: 8192
          example: Have a wonderful day!
        style:
          type: string
          description: >-
            Optional single-speaker delivery direction (emotion, pace, tone).
            Not spoken aloud. Max 8,192 characters, counted together with text.
          maxLength: 8192
          example: cheerful and friendly
        language_code:
          type: string
          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.
          pattern: ^[a-z]{2,3}(-[a-z0-9]+)*$
          example: en-us
        voice:
          type: string
          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.
          minLength: 1
          maxLength: 256
          example: Kore
        speakers:
          type: array
          description: >-
            Required for two-speaker synthesis. Exactly two speakers. Omit this
            field for single-speaker calls.
          minItems: 2
          maxItems: 2
          items:
            $ref: '#/components/schemas/Gemini38TTSSpeaker'
        turns:
          type: array
          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.
          minItems: 1
          items:
            $ref: '#/components/schemas/Gemini38TTSTurn'
    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
    Gemini38TTSSpeaker:
      type: object
      required:
        - speaker
        - voice
      properties:
        speaker:
          type: string
          description: Speaker name used by turns. Alphanumeric, 1-64 characters.
          minLength: 1
          maxLength: 64
          pattern: ^[A-Za-z0-9]+$
          example: Joe
        voice:
          type: string
          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.
          minLength: 1
          maxLength: 256
          example: Puck
    Gemini38TTSTurn:
      type: object
      required:
        - speaker
        - text
      properties:
        speaker:
          type: string
          description: Which configured speaker says this turn.
          minLength: 1
          maxLength: 64
          pattern: ^[A-Za-z0-9]+$
          example: Joe
        text:
          type: string
          description: Verbatim line for this turn.
          minLength: 1
          maxLength: 8192
          example: How is it going today, Jane?
        style:
          type: string
          description: Optional delivery direction for this turn only. Not spoken aloud.
          maxLength: 8192
          example: cheerful and friendly
    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>`'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.