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

# 创建视频生成任务

> 创建异步视频生成任务：文生视频、图生视频（首帧 / 首尾帧）、全能参考生视频（图片 / 视频 / 音频 / 文档 / 网页）、视频编辑与延长。请求头必须带 `X-DashScope-Async: enable`。成功返回 `task_id`，再调用查询任务获取结果。参数错误返回 400，不建任务、不扣费；任务失败不扣费。



## OpenAPI

````yaml /openapi/zh/wan-3-0-spicy.json post /api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.1.0
info:
  description: >-
    万相 Wan 3.0 Spicy：Wan 3.0 视频模型的宽松审核线路。请求与响应和 Wan 3.0（DashScope
    协议）相同，创建文生视频、图生视频（首帧 / 首尾帧）、全能参考生视频、视频编辑与延长任务，并查询任务结果。
  title: 万相 Wan 3.0 Spicy 视频生成 API
  version: v1
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: Wan 3.0 Spicy
paths:
  /api/v1/services/aigc/video-generation/video-synthesis:
    post:
      tags:
        - Wan 3.0 Spicy
      summary: 创建视频生成任务
      description: >-
        创建异步视频生成任务：文生视频、图生视频（首帧 / 首尾帧）、全能参考生视频（图片 / 视频 / 音频 / 文档 /
        网页）、视频编辑与延长。请求头必须带 `X-DashScope-Async: enable`。成功返回
        `task_id`，再调用查询任务获取结果。参数错误返回 400，不建任务、不扣费；任务失败不扣费。
      operationId: wanCreateVideoSynthesisSpicy
      parameters:
        - description: 异步调用开关，必须为 `enable`；缺少时返回 403 `AccessDenied`。
          example: enable
          in: header
          name: X-DashScope-Async
          required: true
          schema:
            enum:
              - enable
            examples:
              - enable
            type: string
      requestBody:
        content:
          application/json:
            examples:
              文生视频:
                summary: 文生视频
                description: 只用提示词生成视频。
                value:
                  model: wan3.0-video-spicy
                  input:
                    prompt: 清晨的雨后街道，一只红色纸船顺着积水漂流，特写镜头，柔和晨光。
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    duration: 5
              图生视频（首帧）:
                summary: 图生视频（首帧）
                description: 图片严格作为视频第一帧，从这张图开始生成。
                value:
                  model: wan3.0-video-spicy
                  input:
                    prompt: 镜头缓慢推近，热气从拉面碗里升起。
                    media:
                      - type: first_frame
                        url: https://your-cdn.example.com/first-frame.jpg
                  parameters:
                    resolution: 1080P
                    duration: 5
              首尾帧:
                summary: 首尾帧
                description: 给定首帧与尾帧，生成两图之间的过渡视频。
                value:
                  model: wan3.0-video-spicy
                  input:
                    prompt: 人物从窗边走到门口，镜头跟随。
                    media:
                      - type: first_frame
                        url: https://your-cdn.example.com/first-frame.jpg
                      - type: last_frame
                        url: https://your-cdn.example.com/last-frame.jpg
                  parameters:
                    resolution: 720P
                    duration: 6
              全能参考（图 + 视频 + 音频）:
                summary: 全能参考（图 + 视频 + 音频）
                description: 参考图、参考视频、参考音频自由组合，在提示词里按序号指代。
                value:
                  model: wan3.0-video-spicy
                  input:
                    prompt: 图1中的人物站在视频1的场景里，用音频1的声音说：欢迎来到未来。
                    media:
                      - type: reference_image
                        url: https://your-cdn.example.com/person.png
                      - type: reference_video
                        url: https://your-cdn.example.com/scene.mp4
                      - type: reference_audio
                        url: https://your-cdn.example.com/voice.mp3
                  parameters:
                    resolution: 1080P
                    ratio: '16:9'
                    duration: 8
              视频编辑:
                summary: 视频编辑
                description: 以参考视频为基础，按提示词修改内容。
                value:
                  model: wan3.0-video-spicy
                  input:
                    prompt: 把视频1中的白天街景改成雨夜，霓虹灯倒映在湿漉漉的路面上，人物动作保持不变。
                    media:
                      - type: reference_video
                        url: https://your-cdn.example.com/source.mp4
                  parameters:
                    resolution: 720P
                    duration: 5
              视频延长:
                summary: 视频延长
                description: 沿参考视频的结尾继续生成。
                value:
                  model: wan3.0-video-spicy
                  input:
                    prompt: 延长视频：纸船继续向前漂流，最后漂出画面。
                    media:
                      - type: reference_video
                        url: https://your-cdn.example.com/source.mp4
                  parameters:
                    resolution: 720P
                    ratio: adaptive
                    duration: 5
              Pro · 4K:
                summary: Pro · 4K
                description: '`wan3.0-video-pro-spicy` 生成后超分，输出 1080P / 2K / 4K。'
                value:
                  model: wan3.0-video-pro-spicy
                  input:
                    prompt: 清晨的雨后街道，一只红色纸船顺着积水漂流，特写镜头，柔和晨光。
                  parameters:
                    resolution: 4K
                    ratio: '16:9'
                    duration: 5
            schema:
              $ref: '#/components/schemas/WanVideoSynthesisRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                example:
                  value:
                    output:
                      task_status: PENDING
                      task_id: 0385dc79-5ff8-4d82-bcb6-bc5ae0ed7a4f
                    request_id: req_3f9a1c2b7d4e5f60718293a4
              schema:
                $ref: '#/components/schemas/WanVideoCreateResponse'
          description: 任务已创建。
          headers:
            X-Request-Id:
              description: 请求 Id，联系支持时请提供。
              schema:
                type: string
        '400':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: InvalidParameter
                    message: >-
                      Input should be '1080P', '720P' or '480P':
                      parameters.resolution
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: 参数错误（`InvalidParameter`）。
        '401':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: InvalidApiKey
                    message: Invalid API-key provided.
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: 缺少或无效的 API Key（`InvalidApiKey`）。
        '402':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: Arrearage
                    message: >-
                      Access denied, please make sure your account is in good
                      standing.
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: 账户余额不足（`Arrearage`）。
        '403':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: AccessDenied
                    message: current user api does not support synchronous calls
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: '缺少 `X-DashScope-Async: enable` 请求头，或无权使用该模型（`AccessDenied`）。'
        '429':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: Throttling.RateQuota
                    message: Requests rate limit exceeded, please try again later.
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: 触发限流，稍后重试（`Throttling.RateQuota`）。
        '500':
          content:
            application/json:
              examples:
                example:
                  value:
                    request_id: req_3f9a1c2b7d4e5f60718293a4
                    code: InternalError
                    message: >-
                      An internal error has occured, please try again later or
                      contact service support.
              schema:
                $ref: '#/components/schemas/WanVideoErrorResponse'
          description: 服务端错误，稍后重试（`InternalError`）。
components:
  schemas:
    WanVideoSynthesisRequest:
      additionalProperties: false
      description: 创建视频生成任务的请求体。
      properties:
        model:
          default: wan3.0-video-spicy
          description: >-
            模型名称。四个型号请求格式相同：标准版和 Prime 版输出 480P / 720P / 1080P，Prime 端到端更快；Pro 和
            Prime Pro 在生成后再做一次超分辨率，输出 1080P / 2K / 4K。


            **可选值：**

            - `wan3.0-video-spicy`：标准版。

            - `wan3.0-video-prime-spicy`：Prime 高速版，能力与标准版相同，更快。

            - `wan3.0-video-pro-spicy`：Pro 超分版，输出 1080P / 2K / 4K。

            - `wan3.0-video-prime-pro-spicy`：Prime Pro，高速 + 超分，输出 1080P / 2K /
            4K。
          enum:
            - wan3.0-video-spicy
            - wan3.0-video-prime-spicy
            - wan3.0-video-pro-spicy
            - wan3.0-video-prime-pro-spicy
          type: string
        input:
          $ref: '#/components/schemas/WanVideoInput'
          description: 输入的提示词与素材。
        parameters:
          $ref: '#/components/schemas/WanVideoParameters'
          description: 生成参数，均可省略。
      required:
        - model
        - input
      type: object
    WanVideoCreateResponse:
      additionalProperties: false
      description: 创建任务的响应。
      properties:
        output:
          $ref: '#/components/schemas/WanVideoCreateOutput'
          description: 任务信息。
        request_id:
          description: 请求 Id。
          type: string
      required:
        - output
        - request_id
      type: object
    WanVideoErrorResponse:
      additionalProperties: false
      description: 错误响应。
      properties:
        request_id:
          description: 请求 Id，联系支持时请提供。
          type: string
        code:
          description: 错误码，如 `InvalidParameter`、`InvalidApiKey`。
          type: string
        message:
          description: 错误信息（英文）。
          type: string
      required:
        - request_id
        - code
        - message
      type: object
    WanVideoInput:
      additionalProperties: false
      description: 输入内容。`prompt` 与 `media` 至少填一项。
      properties:
        prompt:
          description: >-
            文本提示词，支持中英文，最多 20000 个字符，超出部分自动截断。全能参考模式下可用「图1」「视频1」「音频1」等指代 `media`
            中对应顺序的素材。
          type: string
        media:
          description: >-
            输入素材数组，每项包含 `type` 和 `url`。组合规则：不传为文生视频；`first_frame` / `last_frame`
            只能单独或一起使用，不能与其他类型混用（首尾帧模式不支持音频）；`reference_image` /
            `reference_video` / `reference_audio` 可自由组合；`file` 与 `link`
            二选一，可与参考素材组合；视频编辑与延长须包含 `reference_video`。
          items:
            $ref: '#/components/schemas/WanVideoMedia'
          type: array
      type: object
    WanVideoParameters:
      additionalProperties: false
      description: 生成参数。
      properties:
        resolution:
          default: 1080P
          description: >-
            输出分辨率档位，默认 `1080P`；决定计费单价。标准版和 Prime 版可选 `480P` / `720P` /
            `1080P`，Pro 和 Prime Pro 可选 `1080P` / `2K` / `4K`，型号不支持的档位返回 400。


            **可选值：**

            - `1080P`：1080P。

            - `720P`：720P（标准版、Prime）。

            - `480P`：480P（标准版、Prime）。

            - `2K`：2K（Pro、Prime Pro）。

            - `4K`：4K（Pro、Prime Pro）。
          enum:
            - 1080P
            - 720P
            - 480P
            - 2K
            - 4K
          type: string
        ratio:
          default: adaptive
          description: |-
            画面宽高比，默认 `adaptive`。视频延长时须为 `adaptive`。

            **可选值：**
            - `adaptive`：自适应：按输入素材或由模型决定。
            - `16:9`：16:9 横屏。
            - `4:3`：4:3 横屏。
            - `1:1`：1:1 方形。
            - `3:4`：3:4 竖屏。
            - `9:16`：9:16 竖屏。

            Spicy 线路不提供 `21:9`。
          enum:
            - adaptive
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
          type: string
        duration:
          default: 5
          description: >-
            输出视频时长（秒），默认 `5`。无视频输入时 `2` ~ `30`；有视频输入时，输入视频时长加输出时长不超过 30 秒；传 `-1`
            由模型自动决定时长。
          format: int64
          maximum: 30
          minimum: -1
          type: integer
        audio:
          default: true
          description: 是否生成音频，默认 `true`。开关同价。
          type: boolean
        seed:
          description: 随机种子，`-1` 或 `0` ~ `2147483647`；不传则随机。相同种子也不保证结果完全一致。
          format: int64
          maximum: 2147483647
          minimum: -1
          type: integer
        prompt_extend:
          default: true
          description: 是否开启提示词智能改写，默认 `true`，会增加耗时。使用 `file` 或 `link` 时必须为 `true`。
          type: boolean
        watermark:
          default: false
          description: Spicy 线路不加水印，这个字段不生效。
          type: boolean
      type: object
    WanVideoCreateOutput:
      additionalProperties: false
      description: 新建任务。
      properties:
        task_status:
          description: |-
            任务状态，新建时为 `PENDING`。

            **可选值：**
            - `PENDING`：排队中。
            - `RUNNING`：生成中。
            - `SUCCEEDED`：成功，从 `video_url` 下载视频。
            - `FAILED`：失败，从 `code` / `message` 读取原因，不扣费。
            - `CANCELED`：已取消，不扣费。
            - `UNKNOWN`：任务不存在、不属于当前账号，或已超过 24 小时查询有效期。
          enum:
            - PENDING
            - RUNNING
            - SUCCEEDED
            - FAILED
            - CANCELED
            - UNKNOWN
          type: string
        task_id:
          description: 任务 Id，用于查询任务，24 小时内有效。
          type: string
      required:
        - task_status
        - task_id
      type: object
    WanVideoMedia:
      additionalProperties: false
      description: 一个输入素材。
      properties:
        type:
          description: >-
            素材类型。


            **可选值：**

            - `first_frame`：首帧图片，严格作为视频第一帧，最多 1 张。

            - `last_frame`：尾帧图片，严格作为视频最后一帧，最多 1 张。

            - `reference_image`：参考图片，最多 10 张。JPEG / JPG / PNG（不含透明通道）/ BMP /
            WEBP，单边 240 ~ 8000 像素，宽高比 ≤ 8:1，≤ 20 MB。

            - `reference_video`：参考视频，最多 5 段。MP4 / MOV，每段 1 ~ 15 秒且总时长 ≤ 15 秒，≥
            16 fps，单边 240 ~ 4096 像素，≤ 100 MB。

            - `reference_audio`：参考音频，最多 5 段。WAV / MP3，每段 1 ~ 15 秒且总时长 ≤ 15 秒，≤
            15 MB。

            - `file`：文档，最多 1
            个：docx、doc、xlsx、xls、pptx、ppt、pdf、txt、key、pages、numbers、md，≤ 100
            MB（部分格式 ≤ 50 页）。不能与 `link` 同时使用。

            - `link`：网页链接，最多 1 个，仅支持无需登录的公开网页。不能与 `file` 同时使用。


            Spicy 线路按参考视频的实际时长计费：`reference_video` 请用公网可访问的 MP4 / MOV
            地址，读不到时长时返回 400、不扣费。
          enum:
            - first_frame
            - last_frame
            - reference_image
            - reference_video
            - reference_audio
            - file
            - link
          type: string
        url:
          description: >-
            素材地址：公网可访问的 `http(s)` 地址；图片（`first_frame` / `last_frame` /
            `reference_image`）也可传 Base64 数据 `data:{MIME};base64,{数据}`。
          minLength: 1
          type: string
      required:
        - type
        - url
      type: object
  securitySchemes:
    bearerAuth:
      description: '在请求头 `Authorization: Bearer <API Key>` 中携带 DreamTo API Key。'
      scheme: bearer
      type: http

````

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