> ## 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 PixVerse video generation task: `model` picks the model, the generation parameters 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/pixverse-v6-text-to-video.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: >-
    PixVerse V6 text-to-video: one prompt becomes a 1–15 second video at up to
    1080p, with multi-shot and native audio.
  title: PixVerse V6 Text to Video
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: PixVerse V6 Text to Video
paths:
  /api/v1/jobs/createTask:
    post:
      tags:
        - PixVerse V6 Text to Video
      summary: Create task
      description: >-
        Creates a PixVerse video generation task: `model` picks the model, the
        generation parameters 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: pixverseCreateTask
      requestBody:
        content:
          application/json:
            examples:
              Text to video:
                description: 720p, 5 seconds, 16:9, no audio.
                summary: Text to video
                value:
                  model: pixverse-v6/text-to-video
                  input:
                    prompt: >-
                      A cinematic sunrise lights a misty mountain lake; the
                      camera skims slowly over the water as a flock of birds
                      crosses the sky
                    aspect_ratio: '16:9'
                    quality: 720p
                    duration: 5
              Multi-shot film with audio:
                description: >-
                  `generate_multi_clip_switch: true` turns one prompt into a
                  multi-shot video and `generate_audio_switch: true` adds sound;
                  1080p, 12 seconds.
                summary: Multi-shot film with audio
                value:
                  model: pixverse-v6/text-to-video
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    prompt: >-
                      An old fisherman heads out at dawn: wide shot of the pier
                      as he unties the rope; close-up of the bow cutting through
                      waves; finally he looks at the rising sun and smiles.
                      Sounds of waves and gulls
                    aspect_ratio: '16:9'
                    quality: 1080p
                    duration: 12
                    generate_audio_switch: true
                    generate_multi_clip_switch: true
              Quick vertical draft:
                description: >-
                  360p, 3 seconds, 9:16 with a fixed `seed` to compare prompts
                  cheaply before rendering at a higher resolution.
                summary: Quick vertical draft
                value:
                  model: pixverse-v6/text-to-video
                  input:
                    prompt: >-
                      A shiba inu wearing sunglasses surfs at the beach on a
                      sunny day
                    aspect_ratio: '9:16'
                    quality: 360p
                    duration: 3
                    seed: 123456
            schema:
              $ref: >-
                #/components/schemas/PixVerseCreateTaskRequestPixVerseV6TextToVideoInput
        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: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                Invalid request (422):
                  description: The request is invalid; no task is created or charged.
                  summary: Invalid request (422)
                  value:
                    code: 422
                    msg: input.duration must be between 1 and 15.
                    data: null
                Unauthorized (401):
                  description: Missing or invalid API Key.
                  summary: Unauthorized (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/PixVerseCreateTaskResponse'
          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:
    PixVerseCreateTaskRequestPixVerseV6TextToVideoInput:
      additionalProperties: false
      description: Request body of createTask.
      properties:
        model:
          default: pixverse-v6/text-to-video
          description: |-
            Model name; it decides the fields of `input`.

            **Allowed values:**
            - `pixverse-v6/text-to-video`: PixVerse V6 text-to-video
          enum:
            - pixverse-v6/text-to-video
          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.
          type: string
        input:
          $ref: '#/components/schemas/PixVerseV6TextToVideoInput'
          description: Generation parameters; the fields depend on `model`.
      required:
        - model
        - input
      type: object
    PixVerseCreateTaskResponse:
      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/PixVerseCreateTaskData'
          description: The task on success; `null` on error.
      required:
        - code
        - msg
        - data
      type: object
    PixVerseV6TextToVideoInput:
      additionalProperties: false
      description: Generation parameters of `pixverse-v6/text-to-video`.
      properties:
        prompt:
          description: >-
            Prompt, required, 3–5,000 characters. Describe the subject, action,
            scene, camera movement and style; the more specific, the closer the
            result. With audio on you can write dialogue and sound effects.
          maxLength: 5000
          minLength: 3
          type: string
        aspect_ratio:
          description: |-
            Required aspect ratio of the output video.

            **Allowed values:**
            - `16:9`: Landscape widescreen, for film and horizontal video
            - `4:3`: Classic landscape
            - `1:1`: Square
            - `3:4`: Classic portrait
            - `9:16`: Full-screen portrait, for mobile short video
            - `2:3`: Portrait poster ratio
            - `3:2`: Landscape photo ratio
            - `21:9`: Ultra-wide cinema
          enum:
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
            - '2:3'
            - '3:2'
            - '21:9'
          type: string
        quality:
          description: >-
            Required output resolution, case-insensitive (`720P` equals `720p`).
            Higher resolutions cost more per second.


            **Allowed values:**

            - `360p`: 360p, the lowest price, for quick previews and prompt
            tuning

            - `540p`: 540p

            - `720p`: 720p HD

            - `1080p`: 1080p Full HD, the highest quality
          enum:
            - 360p
            - 540p
            - 720p
            - 1080p
          type: string
        duration:
          description: >-
            Required video duration in seconds, an integer from `1` to `15`;
            billed per second.
          format: int64
          maximum: 15
          minimum: 1
          type: integer
        generate_audio_switch:
          default: false
          description: >-
            Whether to generate audio that matches the picture (dialogue, sound
            effects and music); default `false`. With audio the with-audio price
            applies.
          type: boolean
        generate_multi_clip_switch:
          default: false
          description: >-
            Whether to generate a multi-shot video; default `false` (single
            shot). With it on the model cuts between shots following the prompt;
            the price is unchanged.
          type: boolean
        seed:
          description: >-
            Random seed, `0`–`2147483647`; random when omitted. The same
            parameters and seed help reproduce a result.
          format: int64
          maximum: 2147483647
          minimum: 0
          type: integer
      required:
        - prompt
        - aspect_ratio
        - quality
        - duration
      type: object
    PixVerseCreateTaskData:
      additionalProperties: false
      description: The created task.
      properties:
        taskId:
          description: >-
            Task ID (32 hex digits), used to query the task and to extend its
            video.
          type: string
      required:
        - taskId
      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.