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

# 创建任务

> 创建 PixVerse 视频生成任务：`model` 选择模型，生成参数放在 `input` 中，可选 `callBackUrl` 接收完成回调。成功后返回 `data.taskId`，任务在后台异步执行，用查询任务接口轮询结果。所有响应的 HTTP 状态码都是 200，以 `code` 判断结果。



## OpenAPI

````yaml /openapi/zh/pixverse-v6-max-image-to-video.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: PixVerse V6 Max 图生视频：以一张图片为首帧生成 1 ~ 15 秒、最高 1080p 的视频，可同步生成原生音频。
  title: PixVerse V6 Max 图生视频
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: PixVerse V6 Max 图生视频
paths:
  /api/v1/jobs/createTask:
    post:
      tags:
        - PixVerse V6 Max 图生视频
      summary: 创建任务
      description: >-
        创建 PixVerse 视频生成任务：`model` 选择模型，生成参数放在 `input` 中，可选 `callBackUrl`
        接收完成回调。成功后返回 `data.taskId`，任务在后台异步执行，用查询任务接口轮询结果。所有响应的 HTTP 状态码都是 200，以
        `code` 判断结果。
      operationId: pixverseCreateTask
      requestBody:
        content:
          application/json:
            examples:
              图生视频:
                description: '`image_urls` 传 1 张图片作为首帧，画面比例跟随图片。'
                summary: 图生视频
                value:
                  model: pixverse-v6-max/image-to-video
                  input:
                    prompt: 女孩转过身对着镜头微笑，发丝被微风吹起，镜头缓慢推近
                    image_urls:
                      - https://your-cdn.example.com/first-frame.jpg
                    quality: 720p
                    duration: 5
              有声商品广告:
                description: 1080p、10 秒，同步生成旁白和音效，完成后回调。
                summary: 有声商品广告
                value:
                  model: pixverse-v6-max/image-to-video
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    prompt: 香水瓶在黑色大理石台面上缓慢旋转，金色光线扫过瓶身，水珠滑落；旁白低声说：“为夜晚而生。”
                    image_urls:
                      - https://your-cdn.example.com/perfume.png
                    quality: 1080p
                    duration: 10
                    generate_audio_switch: true
                    seed: 42
            schema:
              $ref: >-
                #/components/schemas/PixVerseCreateTaskRequestPixVerseV6MaxImageToVideoInput
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                创建成功:
                  description: '`data.taskId` 为任务 ID。'
                  summary: 创建成功
                  value:
                    code: 200
                    msg: success
                    data:
                      taskId: 7d3f0a9c41e85b2f6a1c9e04b8d27f53
                参数错误（422）:
                  description: 参数不合法，不建任务、不扣费。
                  summary: 参数错误（422）
                  value:
                    code: 422
                    msg: input.duration must be between 1 and 15.
                    data: null
                未授权（401）:
                  description: API Key 缺失或无效。
                  summary: 未授权（401）
                  value:
                    code: 401
                    msg: >-
                      Unauthorized - Authentication credentials are missing or
                      invalid
                    data: null
                余额不足（402）:
                  description: 余额不足以支付本次任务。
                  summary: 余额不足（402）
                  value:
                    code: 402
                    msg: >-
                      Insufficient Credits - Account does not have enough
                      credits to perform the operation
                    data: null
                请求过于频繁（429）:
                  description: 超过频率限制，请稍后重试。
                  summary: 请求过于频繁（429）
                  value:
                    code: 429
                    msg: >-
                      Rate Limited - Request limit has been exceeded for this
                      resource
                    data: null
                服务器错误（500）:
                  description: 服务暂时不可用，可稍后重试，不扣费。
                  summary: 服务器错误（500）
                  value:
                    code: 500
                    msg: >-
                      Server Error - An unexpected error occurred while
                      processing the request
                    data: null
              schema:
                $ref: '#/components/schemas/PixVerseCreateTaskResponse'
          description: >-
            HTTP 状态码始终为 200。`code` 为 `200` 时创建成功，`data.taskId` 为任务 ID；其他 `code`
            为错误，`msg` 为原因，`data` 为 `null`。
          headers:
            X-Request-Id:
              description: 本次请求的 ID，排查问题时请提供。
              schema:
                type: string
components:
  schemas:
    PixVerseCreateTaskRequestPixVerseV6MaxImageToVideoInput:
      additionalProperties: false
      description: 创建任务的请求体。
      properties:
        model:
          default: pixverse-v6-max/image-to-video
          description: |-
            模型名称，决定 `input` 的字段。

            **可选值：**
            - `pixverse-v6-max/image-to-video`：PixVerse V6 Max 图生视频
          enum:
            - pixverse-v6-max/image-to-video
          type: string
        callBackUrl:
          description: >-
            可选，任务完成（成功或失败）后接收回调的地址，须为公网可访问的 `http` / `https`
            地址；推荐生产环境使用，也可以只轮询查询任务接口。回调格式和签名见“任务完成回调”。
          type: string
        input:
          $ref: '#/components/schemas/PixVerseV6MaxImageToVideoInput'
          description: 生成参数，字段由 `model` 决定。
      required:
        - model
        - input
      type: object
    PixVerseCreateTaskResponse:
      additionalProperties: false
      description: 创建任务的响应。HTTP 状态码始终为 200。
      properties:
        code:
          description: |-
            结果代码：
            - `200`：成功
            - `401`：API Key 缺失或无效
            - `402`：余额不足
            - `404`：模型不存在或未开通
            - `405`：请求方法错误
            - `422`：参数错误，`msg` 为原因，不建任务、不扣费
            - `429`：请求过于频繁，请稍后重试
            - `455`：服务维护中
            - `500`：服务器错误，可稍后重试
            - `501`：生成失败
            - `505`：功能已停用
          format: int64
          type: integer
        msg:
          description: 结果说明：成功时为 `success`，错误时为英文原因。
          type: string
        data:
          $ref: '#/components/schemas/PixVerseCreateTaskData'
          description: 成功时为任务信息；错误时为 `null`。
      required:
        - code
        - msg
        - data
      type: object
    PixVerseV6MaxImageToVideoInput:
      additionalProperties: false
      description: '`pixverse-v6-max/image-to-video` 的生成参数。'
      properties:
        prompt:
          description: 提示词，必填，1 ~ 5000 个字符。描述首帧图片之后发生的动作、镜头运动和氛围。
          maxLength: 5000
          minLength: 1
          type: string
        image_urls:
          description: >-
            首帧图片，恰好 1 张。支持 JPG、JPEG、PNG、WebP，单张不超过 20 MB、宽高不超过 10000 像素，须为公网可访问的
            `http` / `https` 地址。输出视频的画面比例跟随图片。
          items:
            type: string
          maxItems: 1
          minItems: 1
          type: array
        quality:
          description: |-
            必填，输出视频的分辨率，不区分大小写（`720P` 等同 `720p`）。分辨率越高单价越高。

            **可选值：**
            - `360p`：360p，价格最低，适合快速预览和调试提示词
            - `540p`：540p
            - `720p`：720p 高清
            - `1080p`：1080p 全高清，画质最高
          enum:
            - 360p
            - 540p
            - 720p
            - 1080p
          type: string
        duration:
          description: 必填，视频时长（秒），`1` ~ `15` 的整数，按秒计费。
          format: int64
          maximum: 15
          minimum: 1
          type: integer
        generate_audio_switch:
          default: false
          description: 是否同步生成与画面匹配的音频（对白、音效和音乐），默认 `false`。开启后按有音频的单价计费。
          type: boolean
        seed:
          description: 随机种子，`0` ~ `2147483647`；不传时随机。相同参数和种子有助于复现结果。
          format: int64
          maximum: 2147483647
          minimum: 0
          type: integer
      required:
        - prompt
        - image_urls
        - quality
        - duration
      type: object
    PixVerseCreateTaskData:
      additionalProperties: false
      description: 新建的任务。
      properties:
        taskId:
          description: 任务 ID（32 位十六进制），用于查询任务和续写。
          type: string
      required:
        - taskId
      type: object
  securitySchemes:
    bearerAuth:
      description: 'DreamTo 控制台创建的 API Key，格式 `Authorization: Bearer <API Key>`。'
      scheme: bearer
      type: http

````

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