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

# Gemini 3.1 Flash TTS

> Generate speech with Gemini 3.1 Flash TTS, using style instructions and selectable voices for narration or dialogue with two speakers.

<Tip>
  1. Submit the request with `VIDGO_API_KEY`. A `task_id` is returned immediately. Keep it until the task reaches `finished` or `failed`.
  2. Use [Query Task Status](/api-manual/task-management/status) to retrieve the result. If you provide a `callback_url`, Vidgo sends the result to your [webhook](/api-manual/task-management/webhooks) when the task finishes or fails.
</Tip>

# Gemini 3.1 Flash TTS

Generate speech with Gemini 3.1 Flash TTS, using style instructions and selectable voices for narration or dialogue with two speakers.

## Available Models

* **google/gemini-3.1-flash/text-to-speech** - Convert text into speech.

## Output Options

### Output Format

* `output_format`: Optional. Accepted values: `mp3`, `wav`, `ogg_opus`. Default: `mp3`.

## Key Features

* Convert text into speech.
* Use one voice or two speaker aliases.
* Control delivery with `style_instructions` and `temperature`.
* Select a voice with `voice` and specify the spoken language with `language_code`.

## Advanced Parameters

Set `model` and optional `callback_url` at the request root. Place all workflow parameters, including output options, inside `input`.

Use the fields in the parameter reference to configure speech generation.

* When supplying `speakers`, provide exactly two distinct `speaker_id` aliases using only letters, digits, and underscores. Speech uses the voice assigned to each speaker.

### Text

* `text`: Required. Supply the text to speak. Length: **1-50,000 characters**.
* Include the words to speak, with optional audio tags such as `[short pause]`, `[whispering]`, and `[laughing]`. For dialogue, prefix each turn with its matching `speaker_id` followed by a colon.

### Style Instructions

* `style_instructions`: Optional. Describe how the speech should be delivered.

### Voice

* `voice`: Optional. Select the voice. String. Default: `Kore`.

<Accordion title="Supported voice values">
  - `Achernar`
  - `Achird`
  - `Algenib`
  - `Algieba`
  - `Alnilam`
  - `Aoede`
  - `Autonoe`
  - `Callirrhoe`
  - `Charon`
  - `Despina`
  - `Enceladus`
  - `Erinome`
  - `Fenrir`
  - `Gacrux`
  - `Iapetus`
  - `Kore`
  - `Laomedeia`
  - `Leda`
  - `Orus`
  - `Pulcherrima`
  - `Puck`
  - `Rasalgethi`
  - `Sadachbia`
  - `Sadaltager`
  - `Schedar`
  - `Sulafat`
  - `Umbriel`
  - `Vindemiatrix`
  - `Zephyr`
  - `Zubenelgenubi`
</Accordion>

### Language Code

* `language_code`: Optional. Select a value below, or omit it to detect the language from `text`.

<Accordion title="Supported language code values">
  - `Arabic (Egypt)`
  - `Bangla (Bangladesh)`
  - `Dutch (Netherlands)`
  - `English (India)`
  - `English (US)`
  - `French (France)`
  - `German (Germany)`
  - `Hindi (India)`
  - `Indonesian (Indonesia)`
  - `Italian (Italy)`
  - `Japanese (Japan)`
  - `Korean (South Korea)`
  - `Marathi (India)`
  - `Polish (Poland)`
  - `Portuguese (Brazil)`
  - `Romanian (Romania)`
  - `Russian (Russia)`
  - `Spanish (Spain)`
  - `Tamil (India)`
  - `Telugu (India)`
  - `Thai (Thailand)`
  - `Turkish (Turkey)`
  - `Ukrainian (Ukraine)`
  - `Vietnamese (Vietnam)`
  - `Afrikaans (South Africa)`
  - `Albanian (Albania)`
  - `Amharic (Ethiopia)`
  - `Arabic (World)`
  - `Armenian (Armenia)`
  - `Azerbaijani (Azerbaijan)`
  - `Basque (Spain)`
  - `Belarusian (Belarus)`
  - `Bulgarian (Bulgaria)`
  - `Burmese (Myanmar)`
  - `Catalan (Spain)`
  - `Cebuano (Philippines)`
  - `Chinese Mandarin (China)`
  - `Chinese Mandarin (Taiwan)`
  - `Croatian (Croatia)`
  - `Czech (Czech Republic)`
  - `Danish (Denmark)`
  - `English (Australia)`
  - `English (UK)`
  - `Estonian (Estonia)`
  - `Filipino (Philippines)`
  - `Finnish (Finland)`
  - `French (Canada)`
  - `Galician (Spain)`
  - `Georgian (Georgia)`
  - `Greek (Greece)`
  - `Gujarati (India)`
  - `Haitian Creole (Haiti)`
  - `Hebrew (Israel)`
  - `Hungarian (Hungary)`
  - `Icelandic (Iceland)`
  - `Javanese (Java)`
  - `Kannada (India)`
  - `Konkani (India)`
  - `Lao (Laos)`
  - `Latin (Vatican City)`
  - `Latvian (Latvia)`
  - `Lithuanian (Lithuania)`
  - `Luxembourgish (Luxembourg)`
  - `Macedonian (North Macedonia)`
  - `Maithili (India)`
  - `Malagasy (Madagascar)`
  - `Malay (Malaysia)`
  - `Malayalam (India)`
  - `Mongolian (Mongolia)`
  - `Nepali (Nepal)`
  - `Norwegian Bokmal (Norway)`
  - `Norwegian Nynorsk (Norway)`
  - `Odia (India)`
  - `Pashto (Afghanistan)`
  - `Persian (Iran)`
  - `Portuguese (Portugal)`
  - `Punjabi (India)`
  - `Serbian (Serbia)`
  - `Sindhi (India)`
  - `Sinhala (Sri Lanka)`
  - `Slovak (Slovakia)`
  - `Slovenian (Slovenia)`
  - `Spanish (Latin America)`
  - `Spanish (Mexico)`
  - `Swahili (Kenya)`
  - `Swedish (Sweden)`
  - `Urdu (Pakistan)`
</Accordion>

### Speakers

* `speakers`: Optional. Supply exactly 2 items. Each item is an object.

* `speakers[].voice`: Required. Select a voice for this speaker.

<Accordion title="Supported voice values">
  - `Achernar`
  - `Achird`
  - `Algenib`
  - `Algieba`
  - `Alnilam`
  - `Aoede`
  - `Autonoe`
  - `Callirrhoe`
  - `Charon`
  - `Despina`
  - `Enceladus`
  - `Erinome`
  - `Fenrir`
  - `Gacrux`
  - `Iapetus`
  - `Kore`
  - `Laomedeia`
  - `Leda`
  - `Orus`
  - `Pulcherrima`
  - `Puck`
  - `Rasalgethi`
  - `Sadachbia`
  - `Sadaltager`
  - `Schedar`
  - `Sulafat`
  - `Umbriel`
  - `Vindemiatrix`
  - `Zephyr`
  - `Zubenelgenubi`
</Accordion>

* `speakers[].speaker_id`: Required. String. Use only letters, digits, and underscores.

### Temperature

* `temperature`: Optional. Control speech-generation variability. Number from `0` to `2`. Default: `1`.

## Output Files

* Read every item in the returned `files` array.
* Generated audio uses `file_type: "audio"`.
* Read the audio URL from `files[].file_url`.


## OpenAPI

````yaml api-manual/music-series/google-gemini-3-1-flash-text-to-speech.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Gemini 3.1 Flash TTS
  description: >-
    Generate speech with Gemini 3.1 Flash TTS, using style instructions and
    selectable voices for narration or dialogue with two speakers.
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Audio Series
      summary: Gemini 3.1 Flash TTS
      description: >-
        Generate narration or two-speaker dialogue. Use speaker_id aliases as
        text prefixes and assign a voice to each speaker. Read the generated
        audio URLs from files, with file_type set to audio.
      operationId: submit_google_gemini_3_1_flash_text_to_speech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: true
              properties:
                model:
                  type: string
                  example: google/gemini-3.1-flash/text-to-speech
                input:
                  type: object
                  required:
                    - text
                  additionalProperties: false
                  properties:
                    text:
                      type: string
                      minLength: 1
                      maxLength: 50000
                      description: Text.
                    style_instructions:
                      type: string
                      description: Style instructions.
                    voice:
                      type: string
                      enum:
                        - Achernar
                        - Achird
                        - Algenib
                        - Algieba
                        - Alnilam
                        - Aoede
                        - Autonoe
                        - Callirrhoe
                        - Charon
                        - Despina
                        - Enceladus
                        - Erinome
                        - Fenrir
                        - Gacrux
                        - Iapetus
                        - Kore
                        - Laomedeia
                        - Leda
                        - Orus
                        - Pulcherrima
                        - Puck
                        - Rasalgethi
                        - Sadachbia
                        - Sadaltager
                        - Schedar
                        - Sulafat
                        - Umbriel
                        - Vindemiatrix
                        - Zephyr
                        - Zubenelgenubi
                      default: Kore
                      description: >-
                        Voice preset for single-speaker speech. Dialogue uses
                        the voices assigned in speakers.
                    language_code:
                      type: string
                      enum:
                        - Arabic (Egypt)
                        - Bangla (Bangladesh)
                        - Dutch (Netherlands)
                        - English (India)
                        - English (US)
                        - French (France)
                        - German (Germany)
                        - Hindi (India)
                        - Indonesian (Indonesia)
                        - Italian (Italy)
                        - Japanese (Japan)
                        - Korean (South Korea)
                        - Marathi (India)
                        - Polish (Poland)
                        - Portuguese (Brazil)
                        - Romanian (Romania)
                        - Russian (Russia)
                        - Spanish (Spain)
                        - Tamil (India)
                        - Telugu (India)
                        - Thai (Thailand)
                        - Turkish (Turkey)
                        - Ukrainian (Ukraine)
                        - Vietnamese (Vietnam)
                        - Afrikaans (South Africa)
                        - Albanian (Albania)
                        - Amharic (Ethiopia)
                        - Arabic (World)
                        - Armenian (Armenia)
                        - Azerbaijani (Azerbaijan)
                        - Basque (Spain)
                        - Belarusian (Belarus)
                        - Bulgarian (Bulgaria)
                        - Burmese (Myanmar)
                        - Catalan (Spain)
                        - Cebuano (Philippines)
                        - Chinese Mandarin (China)
                        - Chinese Mandarin (Taiwan)
                        - Croatian (Croatia)
                        - Czech (Czech Republic)
                        - Danish (Denmark)
                        - English (Australia)
                        - English (UK)
                        - Estonian (Estonia)
                        - Filipino (Philippines)
                        - Finnish (Finland)
                        - French (Canada)
                        - Galician (Spain)
                        - Georgian (Georgia)
                        - Greek (Greece)
                        - Gujarati (India)
                        - Haitian Creole (Haiti)
                        - Hebrew (Israel)
                        - Hungarian (Hungary)
                        - Icelandic (Iceland)
                        - Javanese (Java)
                        - Kannada (India)
                        - Konkani (India)
                        - Lao (Laos)
                        - Latin (Vatican City)
                        - Latvian (Latvia)
                        - Lithuanian (Lithuania)
                        - Luxembourgish (Luxembourg)
                        - Macedonian (North Macedonia)
                        - Maithili (India)
                        - Malagasy (Madagascar)
                        - Malay (Malaysia)
                        - Malayalam (India)
                        - Mongolian (Mongolia)
                        - Nepali (Nepal)
                        - Norwegian Bokmal (Norway)
                        - Norwegian Nynorsk (Norway)
                        - Odia (India)
                        - Pashto (Afghanistan)
                        - Persian (Iran)
                        - Portuguese (Portugal)
                        - Punjabi (India)
                        - Serbian (Serbia)
                        - Sindhi (India)
                        - Sinhala (Sri Lanka)
                        - Slovak (Slovakia)
                        - Slovenian (Slovenia)
                        - Spanish (Latin America)
                        - Spanish (Mexico)
                        - Swahili (Kenya)
                        - Swedish (Sweden)
                        - Urdu (Pakistan)
                      description: >-
                        Select the spoken language, or omit this field to detect
                        it from text.
                    speakers:
                      type: array
                      minItems: 2
                      maxItems: 2
                      items:
                        type: object
                        required:
                          - voice
                          - speaker_id
                        additionalProperties: false
                        properties:
                          voice:
                            type: string
                            enum:
                              - Achernar
                              - Achird
                              - Algenib
                              - Algieba
                              - Alnilam
                              - Aoede
                              - Autonoe
                              - Callirrhoe
                              - Charon
                              - Despina
                              - Enceladus
                              - Erinome
                              - Fenrir
                              - Gacrux
                              - Iapetus
                              - Kore
                              - Laomedeia
                              - Leda
                              - Orus
                              - Pulcherrima
                              - Puck
                              - Rasalgethi
                              - Sadachbia
                              - Sadaltager
                              - Schedar
                              - Sulafat
                              - Umbriel
                              - Vindemiatrix
                              - Zephyr
                              - Zubenelgenubi
                            description: Voice.
                          speaker_id:
                            type: string
                            pattern: ^[A-Za-z0-9_]+$
                            description: Speaker id.
                        description: Speakers.
                      description: >-
                        Provide exactly two speakers with unique speaker_id
                        aliases made of letters, digits and underscores. Speech
                        uses the voice assigned to each speaker.
                    temperature:
                      type: number
                      minimum: 0
                      maximum: 2
                      default: 1
                      description: Temperature.
                    output_format:
                      type: string
                      enum:
                        - mp3
                        - wav
                        - ogg_opus
                      default: mp3
                      description: Output format.
                callback_url:
                  type: string
                  nullable: true
                  description: >-
                    Optional public HTTP(S) endpoint for task completion
                    notifications. HTTPS is recommended. Omit, use null, or use
                    an empty string to disable callbacks.
              description: >-
                Set model and optional callback_url at the request root. Place
                speech parameters inside input.
            examples:
              basic:
                summary: Basic workflow
                value:
                  model: google/gemini-3.1-flash/text-to-speech
                  input:
                    text: >-
                      Welcome to the studio. [short pause] Let us tell your
                      story.
                    style_instructions: Warm narration with a relaxed pace.
                    voice: Kore
                    temperature: 1
                    output_format: mp3
              callback:
                summary: Receive a completion callback
                value:
                  model: google/gemini-3.1-flash/text-to-speech
                  input:
                    text: >-
                      Welcome to the studio. [short pause] Let us tell your
                      story.
                    style_instructions: Warm narration with a relaxed pace.
                    voice: Kore
                    temperature: 1
                    output_format: mp3
                  callback_url: https://your-domain.com/callback
              dialogue:
                summary: Two-speaker dialogue
                value:
                  model: google/gemini-3.1-flash/text-to-speech
                  input:
                    text: |-
                      Host: Welcome to Launch Notes.
                      Guest: Let us explore the new features.
                    speakers:
                      - speaker_id: Host
                        voice: Charon
                      - speaker_id: Guest
                        voice: Kore
                    temperature: 1
                    output_format: ogg_opus
      responses:
        '200':
          description: Task submitted
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - data
                properties:
                  code:
                    type: integer
                    enum:
                      - 200
                  data:
                    type: object
                    required:
                      - task_id
                      - status
                      - created_time
                    properties:
                      task_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - not_started
                          - running
                          - finished
                          - failed
                      created_time:
                        type: string
                        format: date-time
              example:
                code: 200
                data:
                  task_id: task-unified-example
                  status: running
                  created_time: '2026-09-10T08:00:00'
        '400':
          description: Review the request parameters and account balance
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '401':
          description: Invalid credentials
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '404':
          description: Unknown or disabled model
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '408':
          description: Request timed out
          content:
            text/plain:
              schema:
                type: string
              example: Request timeout
        '422':
          description: Invalid JSON or non-object request body
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '429':
          description: Rate or API key credit limit exceeded
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '502':
          description: Generation task creation error
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '503':
          description: Generation service temporarily unavailable
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Use VIDGO_API_KEY.

````