> ## 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-reference-to-video.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: >-
    PixVerse V6 reference-to-video (Fusion): blend 1–7 subject or background
    reference images into a video, referring to them as @name in the prompt.
  title: PixVerse V6 Reference to Video
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: PixVerse V6 Reference to Video
paths:
  /api/v1/jobs/createTask:
    post:
      tags:
        - PixVerse V6 Reference 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:
              Subject and background:
                description: >-
                  `type` marks subjects and backgrounds; name them with
                  `ref_name` and refer to them as `@name` in the prompt.
                summary: Subject and background
                value:
                  model: pixverse-v6/reference-to-video
                  input:
                    prompt: >-
                      @dog rolls over on the sofa in @room, then jumps down and
                      runs toward the camera
                    image_references:
                      - image_url: https://your-cdn.example.com/dog.png
                        type: subject
                        ref_name: dog
                      - image_url: https://your-cdn.example.com/room.png
                        type: background
                        ref_name: room
                    aspect_ratio: '16:9'
                    quality: 720p
                    duration: 5
              Several subjects:
                description: >-
                  Up to 7 reference images; people, products and other subjects
                  keep their look in one scene, with sound.
                summary: Several subjects
                value:
                  model: pixverse-v6/reference-to-video
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    prompt: >-
                      @anna and @leo clink glasses in @cafe; @anna raises @cup
                      and says with a smile: "Cheers!"
                    image_references:
                      - image_url: https://your-cdn.example.com/anna.png
                        type: subject
                        ref_name: anna
                      - image_url: https://your-cdn.example.com/leo.png
                        type: subject
                        ref_name: leo
                      - image_url: https://your-cdn.example.com/cup.png
                        type: subject
                        ref_name: cup
                      - image_url: https://your-cdn.example.com/cafe.png
                        type: background
                        ref_name: cafe
                    aspect_ratio: '9:16'
                    quality: 1080p
                    duration: 8
                    generate_audio_switch: true
            schema:
              $ref: >-
                #/components/schemas/PixVerseCreateTaskRequestPixVerseV6ReferenceToVideoInput
        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:
    PixVerseCreateTaskRequestPixVerseV6ReferenceToVideoInput:
      additionalProperties: false
      description: Request body of createTask.
      properties:
        model:
          default: pixverse-v6/reference-to-video
          description: >-
            Model name; it decides the fields of `input`.


            **Allowed values:**

            - `pixverse-v6/reference-to-video`: PixVerse V6 reference-to-video
            (Fusion)
          enum:
            - pixverse-v6/reference-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/PixVerseV6ReferenceToVideoInput'
          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
    PixVerseV6ReferenceToVideoInput:
      additionalProperties: false
      description: Generation parameters of `pixverse-v6/reference-to-video`.
      properties:
        prompt:
          description: >-
            Prompt, required, 3–5,000 characters. Refer to the images named in
            `image_references` as `@ref_name`, e.g. `@dog rolls over on the sofa
            in @room`.
          maxLength: 5000
          minLength: 3
          type: string
        image_references:
          description: >-
            Fusion reference images, 1–7. Mark each as a subject or background
            and optionally name it to refer to it as `@ref_name` in the prompt;
            names must be unique in the list.
          items:
            $ref: '#/components/schemas/PixVerseImageReference'
          maxItems: 7
          minItems: 1
          type: array
        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
        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
        - image_references
        - 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
    PixVerseImageReference:
      additionalProperties: false
      description: One reference image.
      properties:
        image_url:
          description: >-
            Reference image URL, required: a public `http` / `https` URL (JPG,
            JPEG, PNG or WebP).
          type: string
        type:
          default: subject
          description: >-
            Reference image type; default `subject`.


            **Allowed values:**

            - `subject`: Subject: a person, animal, product or other object
            whose look is kept in the video (default)

            - `background`: Background: an image used as the scene or
            environment
          enum:
            - subject
            - background
          type: string
        ref_name:
          description: >-
            Name of the reference image, up to 30 characters and unique in the
            list; refer to the image as `@name` in the prompt.
          maxLength: 30
          type: string
      required:
        - image_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.