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

# Create task

> Creates a text-to-speech task: `model` picks the model, the speakers and lines go in `input`, and the optional `callBackUrl` receives a completion callback. On success `data.taskId` is returned and the task runs asynchronously; poll the query endpoint for the result. Every response has HTTP status 200; check `code`.



## OpenAPI

````yaml /openapi/en/gemini-3-8-flash-tts.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: >-
    Google's flagship text-to-speech model: one- or two-speaker dialogue with
    per-line style direction, audio tags and one-off voice cloning, output as
    WAV.
  title: Gemini 3.8 Flash TTS
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Gemini 3.8 Flash TTS
paths:
  /api/v1/jobs/createTask:
    post:
      tags:
        - Gemini 3.8 Flash TTS
      summary: Create task
      description: >-
        Creates a text-to-speech task: `model` picks the model, the speakers and
        lines go in `input`, and the optional `callBackUrl` receives a
        completion callback. On success `data.taskId` is returned and the task
        runs asynchronously; poll the query endpoint for the result. Every
        response has HTTP status 200; check `code`.
      operationId: geminiTTSCreateTask
      requestBody:
        content:
          application/json:
            examples:
              Two-speaker dialogue:
                description: >-
                  Two preset voices with per-line style direction and audio
                  tags, called back when the task finishes.
                summary: Two-speaker dialogue
                value:
                  model: gemini-3.8-flash-tts
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    temperature: 1
                    speakers:
                      - speaker_id: Speaker 1
                        voice_name: Fola
                      - speaker_id: Speaker 2
                        voice_name: Zephyr
                    dialogue_turns:
                      - speaker_id: Speaker 1
                        text: Hello there. <laugh> That works.
                        style: >-
                          Speak like a tired night-shift radio host, slow and
                          dry.
                      - speaker_id: Speaker 2
                        text: >-
                          Wait, did you hear that? <gasp> I think it actually
                          worked.
                        style: Bright and curious, slightly faster.
              Single narrator:
                description: One speaker reading a narration with a preset voice.
                summary: Single narrator
                value:
                  model: gemini-3.8-flash-tts
                  input:
                    speakers:
                      - speaker_id: Speaker 1
                        voice_name: Achird
                    dialogue_turns:
                      - speaker_id: Speaker 1
                        text: >-
                          Long ago, an old lighthouse keeper lived by the sea.
                          <short pause> Every evening, he lit the lamp.
                        style: A warm, unhurried audiobook narrator.
              Voice clone:
                description: >-
                  Speaker 1 clones a voice from a reference and a consent
                  recording, speaker 2 uses a preset voice, with filler words.
                summary: Voice clone
                value:
                  model: gemini-3.8-flash-tts
                  input:
                    speakers:
                      - speaker_id: Speaker 1
                        replica:
                          source_audio_url: https://your-cdn.example.com/voice/reference.wav
                          consent_audio_url: https://your-cdn.example.com/voice/consent.wav
                      - speaker_id: Speaker 2
                        voice_name: Puck
                    filler_words: true
                    dialogue_turns:
                      - speaker_id: Speaker 1
                        text: >-
                          Welcome back to the podcast. Let's keep it light
                          today.
                      - speaker_id: Speaker 2
                        text: Sounds good, I brought a few fun questions.
            schema:
              $ref: '#/components/schemas/GeminiTTSCreateTaskRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                Created:
                  description: '`data.taskId` is the task ID.'
                  summary: Created
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 5e2a9c7f13b84d06a8f1c3e5b7d9a2c4
                Invalid request (422):
                  description: The request is invalid; no task is created or charged.
                  summary: Invalid request (422)
                  value:
                    code: 422
                    msg: >-
                      input.dialogue_turns[0].speaker_id "Speaker 2" is not
                      declared in input.speakers.
                    data: null
                Invalid API Key (401):
                  description: The API Key is missing or invalid.
                  summary: Invalid API Key (401)
                  value:
                    code: 401
                    msg: >-
                      Unauthorized - Authentication credentials are missing or
                      invalid
                    data: null
                Insufficient balance (402):
                  description: The balance does not cover the task.
                  summary: Insufficient balance (402)
                  value:
                    code: 402
                    msg: >-
                      Insufficient Credits - Account does not have enough
                      credits to perform the operation
                    data: null
                Rate limited (429):
                  description: Rate limit exceeded; retry later.
                  summary: Rate limited (429)
                  value:
                    code: 429
                    msg: >-
                      Rate Limited - Request limit has been exceeded for this
                      resource
                    data: null
                Server error (500):
                  description: >-
                    The service is temporarily unavailable; retry later. Not
                    charged.
                  summary: Server error (500)
                  value:
                    code: 500
                    msg: >-
                      Server Error - An unexpected error occurred while
                      processing the request
                    data: null
              schema:
                $ref: '#/components/schemas/GeminiTTSCreateTaskResponse'
          description: >-
            Always HTTP 200. With `code` `200` the task was created and
            `data.taskId` is its ID; any other `code` is an error with the
            reason in `msg` and `data` `null`.
          headers:
            X-Request-Id:
              description: ID of this request; include it when reporting issues.
              schema:
                type: string
components:
  schemas:
    GeminiTTSCreateTaskRequest:
      additionalProperties: false
      description: Request body of createTask.
      properties:
        model:
          default: gemini-3.8-flash-tts
          description: >-
            Model name.


            **Allowed values:**

            - `gemini-3.8-flash-tts`: Gemini 3.8 Flash TTS: flagship speech
            generation with the highest expressiveness and fidelity
          enum:
            - gemini-3.8-flash-tts
          type: string
        callBackUrl:
          description: >-
            Optional URL that receives a callback when the task finishes
            (success or failure); it must be a public `http` / `https` URL.
            Recommended in production; you can also just poll the query
            endpoint. See Task callback for the body and signature.
          format: uri
          type: string
        input:
          $ref: '#/components/schemas/GeminiTTSInput'
          description: Generation parameters.
      required:
        - model
        - input
      type: object
    GeminiTTSCreateTaskResponse:
      additionalProperties: false
      description: Response of createTask; always HTTP 200.
      properties:
        code:
          description: >-
            Result code:

            - `200`: success

            - `401`: missing or invalid API Key

            - `402`: insufficient balance

            - `404`: the model does not exist or is not enabled

            - `405`: wrong HTTP method

            - `422`: invalid request, with the reason in `msg`; no task is
            created or charged

            - `429`: too many requests; retry later

            - `455`: service under maintenance

            - `500`: server error; retry later

            - `501`: generation failed

            - `505`: feature disabled
          format: int64
          type: integer
        msg:
          description: 'Message: `success`, or the English reason of an error.'
          type: string
        data:
          $ref: '#/components/schemas/GeminiTTSCreateTaskData'
          description: The task on success; `null` on error.
      required:
        - code
        - msg
        - data
      type: object
    GeminiTTSInput:
      additionalProperties: false
      description: Text-to-speech parameters.
      properties:
        temperature:
          default: 1
          description: >-
            Sampling temperature, `0`–`2`, default `1`. Higher values make the
            delivery more varied, lower values more stable.
          format: double
          maximum: 2
          minimum: 0
          type: number
        speakers:
          description: >-
            Required list of 1–2 speakers. Each speaker uses either `voice_name`
            (a preset voice) or `replica` (a voice clone); with neither, `Fola`
            is used.
          items:
            $ref: '#/components/schemas/GeminiTTSSpeaker'
          maxItems: 2
          minItems: 1
          type: array
        filler_words:
          default: false
          description: >-
            Whether to insert filler words in a two-speaker dialogue; default
            `false`. Only takes effect when `speakers` has two speakers.
          type: boolean
        dialogue_turns:
          description: Required list of lines, spoken in order; at least one.
          items:
            $ref: '#/components/schemas/GeminiTTSDialogueTurn'
          minItems: 1
          type: array
      required:
        - speakers
        - dialogue_turns
      type: object
    GeminiTTSCreateTaskData:
      additionalProperties: false
      description: The created task.
      properties:
        taskId:
          description: Task ID (32 hex digits), used to query the task.
          type: string
      required:
        - taskId
      type: object
    GeminiTTSSpeaker:
      additionalProperties: false
      description: One speaker.
      properties:
        speaker_id:
          description: >-
            Required speaker ID in the `Speaker N` format (N a positive integer,
            e.g. `Speaker 1`, `Speaker 2`), unique in the request;
            `dialogue_turns` refers to it.
          pattern: ^Speaker [1-9][0-9]*$
          type: string
        voice_name:
          default: Fola
          description: >-
            Preset voice, case-sensitive, default `Fola`. Mutually exclusive
            with `replica`: send only one of them for a speaker; omit this field
            when cloning a voice. The 70 voices are grouped by use case below.


            **Allowed values (by use case):**

            - Tutor: `Bodi`, `Lumi`, `Sadaltager`, `Sola`, `Sulafat`, `Varo`,
            `Zephyr`

            - Commercial voiceover: `Koda`, `Kore`, `Nika`, `Tavi`, `Zeno`

            - Instructional: `Algenib`, `Despina`, `Erinome`, `Kira`, `Ludo`,
            `Mako`, `Rasalgethi`, `Rina`

            - Podcast: `Alnilam`, `Brio`, `Jori`, `Laomedeia`, `Rami`, `Veda`

            - Storyteller: `Achird`, `Enzo`, `Riko`, `Sami`, `Zali`,
            `Zubenelgenubi`

            - Digital assistant: `Algieba`, `Aoede`, `Autonoe`, `Callirrhoe`,
            `Enceladus`, `Gero`, `Iapetus`, `Neno`, `Olin`, `Tari`, `Umbriel`

            - Call center: `Achernar`, `Charon`, `Daro`, `Fola` (default),
            `Hali`, `Milo`, `Puck`

            - Concierge: `Arlo`, `Cleo`, `Fenrir`, `Finn`, `Leda`, `Lora`,
            `Orus`

            - Tech support: `Enya`, `Jett`, `Knox`, `Nyla`, `Sadachbia`,
            `Vindemiatrix`

            - Professional: `Cruz`, `Elio`, `Gacrux`, `Pulcherrima`, `Schedar`,
            `Tova`, `Zuri`
          enum:
            - Bodi
            - Lumi
            - Sadaltager
            - Sola
            - Sulafat
            - Varo
            - Zephyr
            - Koda
            - Kore
            - Nika
            - Tavi
            - Zeno
            - Algenib
            - Despina
            - Erinome
            - Kira
            - Ludo
            - Mako
            - Rasalgethi
            - Rina
            - Alnilam
            - Brio
            - Jori
            - Laomedeia
            - Rami
            - Veda
            - Achird
            - Enzo
            - Riko
            - Sami
            - Zali
            - Zubenelgenubi
            - Algieba
            - Aoede
            - Autonoe
            - Callirrhoe
            - Enceladus
            - Gero
            - Iapetus
            - Neno
            - Olin
            - Tari
            - Umbriel
            - Achernar
            - Charon
            - Daro
            - Fola
            - Hali
            - Milo
            - Puck
            - Arlo
            - Cleo
            - Fenrir
            - Finn
            - Leda
            - Lora
            - Orus
            - Enya
            - Jett
            - Knox
            - Nyla
            - Sadachbia
            - Vindemiatrix
            - Cruz
            - Elio
            - Gacrux
            - Pulcherrima
            - Schedar
            - Tova
            - Zuri
          type: string
        replica:
          $ref: '#/components/schemas/GeminiTTSReplica'
          description: >-
            Optional voice clone settings, mutually exclusive with `voice_name`.
            The task clones the speaker's voice from two recordings for this
            task only (it is not saved as a reusable voice); usable in one- and
            two-speaker requests.
      required:
        - speaker_id
      type: object
    GeminiTTSDialogueTurn:
      additionalProperties: false
      description: One line.
      properties:
        speaker_id:
          description: >-
            Required speaker of the line; must be a `speaker_id` declared in
            `speakers`.
          pattern: ^Speaker [1-9][0-9]*$
          type: string
        text:
          description: >-
            Required line, up to 10,000 characters, read verbatim. It may
            contain audio tags in angle brackets, e.g. `Hello there. <laugh>
            That works.`. Official tags: `<argh>`, `<breath>`, `<cackle>`,
            `<cheer>`, `<chuckle>`, `<chuckles>`, `<cough>`, `<cry>`,
            `<exhales>`, `<gasp>`, `<giggle>`, `<groan>`, `<growl>`, `<grr>`,
            `<grunt>`, `<heavy breath>`, `<hiss>`, `<laugh>`, `<laughter>`,
            `<long pause>`, `<moan>`, `<pant>`, `<pff>`, `<phew>`, `<scream>`,
            `<short pause>`, `<shout>`, `<shriek>`, `<sigh>`, `<sighs>`,
            `<sneeze>`, `<snicker>`, `<snort>`, `<sob>`, `<throat-clearing>`,
            `<tsk>`, `<whimper>`, `<whispering>`, `<whispers>`, `<yawn>`.
          maxLength: 10000
          minLength: 1
          type: string
        style:
          description: >-
            Optional speaking style of the line: describe tone, emotion and pace
            freely; different lines of the same speaker may differ. Example:
            Speak like a tired night-shift radio host, slow and dry.
          type: string
      required:
        - speaker_id
        - text
      type: object
    GeminiTTSReplica:
      additionalProperties: false
      description: >-
        Voice clone recordings. Both must be of the same adult, made with the
        same microphone in the same room; AI-generated audio is rejected. WAV
        only (24 kHz, mono, 16-bit PCM recommended), up to 10 MB per file; the
        format is detected from the content.
      properties:
        source_audio_url:
          description: >-
            Required URL of the reference recording (a directly downloadable
            `http` / `https` link). Record 10–30 seconds of natural speech in a
            quiet room: no echo, no background music, one voice only, in the
            language you will generate.
          format: uri
          type: string
        consent_audio_url:
          description: >-
            Required URL of the consent recording (a directly downloadable
            `http` / `https` link). The same person as in the reference
            recording must read verbatim: I am the owner of this voice and I
            consent to Google using this voice to create a synthetic voice
            model. (versions in other supported languages are accepted). Trim
            silence and noise at the start and end.
          format: uri
          type: string
      required:
        - source_audio_url
        - consent_audio_url
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        API Key created in the DreamTo console, sent as `Authorization: Bearer
        <API Key>`.
      scheme: bearer
      type: http

````

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