> ## 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-image-to-video.json post /api/v1/jobs/createTask
openapi: 3.1.0
info:
  description: PixVerse V6 图生视频：以一张图片为首帧生成视频，或用 50 个 PixVerse 特效模板一键生成特效视频。
  title: PixVerse V6 图生视频
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: PixVerse V6 图生视频
paths:
  /api/v1/jobs/createTask:
    post:
      tags:
        - PixVerse V6 图生视频
      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/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/image-to-video
                  callBackUrl: https://your-domain.com/api/callback
                  input:
                    prompt: 厨师把牛排放上烧热的铁板，滋滋作响；切到特写，黄油融化；最后他抬头对镜头说：“开饭了。”
                    image_urls:
                      - https://your-cdn.example.com/chef.jpg
                    quality: 1080p
                    duration: 10
                    generate_audio_switch: true
                    generate_multi_clip_switch: true
              特效模板（单图）:
                description: >-
                  `template_id` 选择特效模板，时长由模板决定，不能传 `duration`；该模板（Crowd Focus）需要
                  1 张图片。
                summary: 特效模板（单图）
                value:
                  model: pixverse-v6/image-to-video
                  input:
                    prompt: 观众席上的镜头对准了我
                    image_urls:
                      - https://your-cdn.example.com/selfie.jpg
                    quality: 720p
                    template_id: '411174903569216'
              特效模板（双图）:
                description: >-
                  `effect_type` 为 2 的模板（Dive into the deep blue of love）需要 2
                  张图片。
                summary: 特效模板（双图）
                value:
                  model: pixverse-v6/image-to-video
                  input:
                    prompt: 两个人在深蓝色的海水中相拥
                    image_urls:
                      - https://your-cdn.example.com/person-a.jpg
                      - https://your-cdn.example.com/person-b.jpg
                    quality: 720p
                    template_id: '412736208886848'
            schema:
              $ref: >-
                #/components/schemas/PixVerseCreateTaskRequestPixVerseV6ImageToVideoInput
        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:
    PixVerseCreateTaskRequestPixVerseV6ImageToVideoInput:
      additionalProperties: false
      description: 创建任务的请求体。
      properties:
        model:
          default: pixverse-v6/image-to-video
          description: |-
            模型名称，决定 `input` 的字段。

            **可选值：**
            - `pixverse-v6/image-to-video`：PixVerse V6 图生视频（含特效模板）
          enum:
            - pixverse-v6/image-to-video
          type: string
        callBackUrl:
          description: >-
            可选，任务完成（成功或失败）后接收回调的地址，须为公网可访问的 `http` / `https`
            地址；推荐生产环境使用，也可以只轮询查询任务接口。回调格式和签名见“任务完成回调”。
          type: string
        input:
          $ref: '#/components/schemas/PixVerseV6ImageToVideoInput'
          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
    PixVerseV6ImageToVideoInput:
      additionalProperties: false
      description: '`pixverse-v6/image-to-video` 的生成参数。'
      properties:
        prompt:
          description: 提示词，必填，3 ~ 5000 个字符。描述画面主体、动作、场景、镜头运动和风格，越具体越接近预期；开启音频时可以写出台词和音效。
          maxLength: 5000
          minLength: 3
          type: string
        image_urls:
          description: >-
            图片地址。不传 `template_id` 时恰好 1 张，作为首帧；传 `template_id` 时按模板要求传 1 或 2
            张。支持 JPG、JPEG、PNG、WebP，单张不超过 20 MB、宽高不超过 10000 像素，须为公网可访问的 `http` /
            `https` 地址。输出视频的画面比例跟随图片。
          items:
            type: string
          maxItems: 2
          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` 的整数，按秒计费。不传 `template_id` 时必填；传 `template_id`
            时不能传（时长由模板决定）。
          format: int64
          maximum: 15
          minimum: 1
          type: integer
        generate_audio_switch:
          default: false
          description: 是否同步生成与画面匹配的音频（对白、音效和音乐），默认 `false`。开启后按有音频的单价计费。
          type: boolean
        generate_multi_clip_switch:
          default: false
          description: 是否生成多镜头视频，默认 `false`（单镜头）。开启后模型按提示词自动切换镜头，不影响价格。
          type: boolean
        seed:
          description: 随机种子，`0` ~ `2147483647`；不传时随机。相同参数和种子有助于复现结果。
          format: int64
          maximum: 2147483647
          minimum: 0
          type: integer
        template_id:
          description: >-
            PixVerse 特效模板 ID。传入后视频时长由模板决定，不能同时传 `duration`；`image_urls` 须按模板要求传
            1 或 2 张图片。不传时为首帧图生视频。


            **可选模板：**

            - `412736208886848`：Dive into the deep blue of love，让每一个吻都化作一场梦（2
            张图片）

            - `411563216524736`：Skyline Track Flag，坚定不移，接下来是城市级的入场特效（1 张图片）

            - `411316927927040`：Vibe Copines，和 tungtung 一起抓住这份氛围（1 张图片）

            - `411174903569216`：Crowd Focus，第一视角：镜头抓到你了——上传自拍或合影，成为全场焦点（1 张图片）

            - `410999246341952`：Poke my little cutie，捏一捏这个小家伙，看它可爱地生气（1 张图片）

            - `408891141511104`：Today is my birthday，我知道你不认识我，但今天是我的生日（1 张图片）

            - `410317363057408`：Mini Football Hero，把任意照片变成 Q
            版迷你足球英雄，在电影级超写实球场里与巨人球员同场竞技（1 张图片）

            - `410285445698304`：Magma Rise，浴火重生，以火攻火（1 张图片）

            - `410133101388544`：Cyber Armor: Reborn in the Rain，击碎风暴，唤醒体内的钢铁之躯（1
            张图片）

            - `409899296377728`：Product Landmark，上传商品，把它变成一座建筑（1 张图片）

            - `408897485909952`：Mini Football Pitch，上传商品，在里面打造一个迷你足球场（1 张图片）

            - `408869061406656`：A kick through the world，上传商品，让它在全球年度盛事之夜闪耀（1
            张图片）

            - `408661207662528`：Small Town Footballer，上传商品，享受胜利时刻（1 张图片）

            - `409767750265728`：Crowned God in One Battle，你意外成为了全场 MVP（1 张图片）

            - `409766559675264`：Thriller Dance Steps，上传照片，变身经典爆款舞蹈（1 张图片）

            - `409589071559552`：Dai Dai Dance，氛围应援舞模板，一张正面照即可加入舞池（1 张图片）

            - `407804339389760`：Fluffy Chef，上传商品，在毛绒厨房里下厨（1 张图片）

            - `407658863287616`：Summer Postcard，上传商品，加入夏日特辑（1 张图片）

            - `407474361215744`：Inhaled into Product Universe，上传商品，进入商品宇宙（1 张图片）

            - `407473438360320`：Fluffy Factory，上传商品，在毛绒工厂里把它做出来（1 张图片）

            - `407467702283008`：Surfing Summer，上传商品照片，开始冲浪（1 张图片）

            - `385844572217469`：Love Launcher，一镜到底的情人节时刻（1 张图片）

            - `406428904874432`：Kitty Shop，上传商品图，让可爱的猫咪变身你的街头小贩（1 张图片）

            - `406423682060736`：Courtyard Makeover Party，上传庭院照片，给它来一场魔法改造（1 张图片）

            - `406411724685760`：Ski Joy，上传宠物、玩具或商品照片，开启一场有趣的滑雪冒险（1 张图片）

            - `406372274350528`：Nail Lab，上传指甲照片，由专属美甲师为你打造精致美甲（1 张图片）

            - `406218913317312`：Rhythm Dash，踩准节拍，摘下桂冠，欢迎来到满分狂欢（1 张图片）

            - `406218479198656`：Screen Killer King，球场需要一位英雄，于是你冲破了屏幕（1 张图片）

            - `406064763308480`：Dynamic Football Poster，从自拍到球衣海报（支持单人和多人）（1 张图片）

            - `406413607395776`：Football Live King!，你打进精彩进球的瞬间，超级跑车礼物从天而降（1 张图片）

            - `405662117814720`：Trophy Breakthrough，上传照片，变身冠军球员，冲破屏幕赢得奖杯（1 张图片）

            - `406014934000064`：Post-match Sharp Comment，赛后话筒递到你面前，你会说什么？（1 张图片）

            - `405658369331648`：Stadium Legend，奔跑、庆祝，创造传奇足球时刻（1 张图片）

            - `405321470423488`：Step by Step，一步一步，自信闪耀（1 张图片）

            - `405175211454656`：Superstar Lobby，欢迎来到你的冠军赛季（1 张图片）

            - `404955806201792`：Post-match Sharp Comment
            2，轮到你接受赛后采访，你会如何评价这场比赛？（1 张图片）

            - `404820147974080`：Top of the World，高举奖杯，成为足球盛宴当之无愧的英雄（2 张图片）

            - `398980393937856`：The Last Hug，海啸来临前的最后一个拥抱（2 张图片）

            - `403916646846400`：My Future has Infinite
            Possibilities，拥抱无限潜能，点亮你的未来（1 张图片）

            - `403739217192896`：Apex Dance，平稳的节奏，颓废而凌乱的舞步（1 张图片）

            - `403560060358144`：Idol Ending Shot，一抬头就是百万直拍（1 张图片）

            - `403556618212098`：MotoGP Live，体验一个毫无编排的真实瞬间（1 张图片）

            - `398965022284579`：Knee Slide，用标志性的激情跪滑庆祝进球胜利（1 张图片）

            - `402201060373270`：Tunnel to Captain，在电影级的球场之旅中，从普通女孩蜕变为传奇足球队长（1
            张图片）

            - `403085292466285`：Golden Field Breaker，他不在名单上，却依然掌控全场（1 张图片）

            - `402061828030966`：Trophy Celebration，一直想要一座巨大的奖杯？在这里至少能以数字方式拥有它（1
            张图片）

            - `402888569901524`：Jump into the Crowd 2，跳入人群（1 张图片）

            - `402155676592228`：World Champion
            Lift，你是队长，高举胜利奖杯；人山人海、金色彩带，纯粹的胜利（1 张图片）

            - `402047865383360`：Sideline Ball
            Boy，以场边球童的独特视角感受比赛，像一位随时准备上场的年轻天才（1 张图片）

            - `402046136040202`：Epic Save，成为传奇门将，用惊艳的飞身扑救接住来球（1 张图片）
          type: string
      required:
        - prompt
        - image_urls
        - quality
      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.