> ## Documentation Index
> Fetch the complete documentation index at: https://docs.powertokens.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 万相2.7-文生视频

> 提交一个异步的阿里云万相 `wan2.7-t2v` 文生视频任务。

提交任务后，请通过 `GET /ali/api/v1/tasks/{task_id}` 查询任务状态。



## OpenAPI

````yaml api-reference/zh-Hans/zmodelVideo/ali/api/wan2.7-t2v.json POST /ali/api/v1/services/aigc/video-generation/video-synthesis
openapi: 3.0.1
info:
  title: 万相2.7-文生视频
  version: 1.0.0
  description: >-
    阿里云万相 `wan2.7-t2v` 文生视频能力文档。平台统一接口端点为
    `/ali/api/v1/services/aigc/video-generation/video-synthesis`，用于创建异步视频生成任务。
  license:
    name: Project License
    url: https://github.com/QuantumNous/new-api/blob/main/LICENSE
servers:
  - url: https://api.powertokens.ai
    description: baze平台 API 服务端点
security: []
tags:
  - name: Wan 2.7 Video
    description: 阿里云万相 wan2.7-t2v 文生视频能力
paths:
  /ali/api/v1/services/aigc/video-generation/video-synthesis:
    post:
      tags:
        - Wan 2.7 Video
      summary: 创建 wan2.7-t2v 文生视频任务
      description: |-
        提交一个异步的阿里云万相 `wan2.7-t2v` 文生视频任务。

        提交任务后，请通过 `GET /ali/api/v1/tasks/{task_id}` 查询任务状态。
      operationId: aliWan27T2VCreate
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
          description: 请求内容类型。此参数必须设置为application/json。
        - name: X-DashScope-Async
          in: header
          required: true
          schema:
            type: string
          description: 异步处理配置参数。HTTP请求只支持异步，必须设置为enable。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Wan27T2VRequest'
            examples:
              多镜头叙事:
                summary: 多镜头叙事
                value:
                  model: wan2.7-t2v
                  input:
                    prompt: >-
                      一段紧张刺激的侦探追查故事，展现电影级叙事能力。第1个镜头[0-3秒]
                      全景：雨夜的纽约街头，霓虹灯闪烁，一位身穿黑色风衣的侦探快步行走。 第2个镜头[3-6秒]
                      中景：侦探进入一栋老旧建筑，雨水打湿了他的外套，门在他身后缓缓关闭。 第3个镜头[6-9秒]
                      特写：侦探的眼神坚毅专注，远处传来警笛声，他微微皱眉思考。 第4个镜头[9-12秒]
                      中景：侦探在昏暗走廊中小心前行，手电筒照亮前方。 第5个镜头[12-15秒]
                      特写：侦探发现关键线索，脸上露出恍然大悟的表情。
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    prompt_extend: true
                    watermark: true
                    duration: 15
              传入音频文件:
                summary: 传入音频文件
                value:
                  model: wan2.7-t2v
                  input:
                    prompt: >-
                      一幅史诗级可爱的场景。一只小巧可爱的卡通小猫将军，身穿细节精致的金色盔甲，头戴一个稍大的头盔，勇敢地站在悬崖上。他骑着一匹虽小但英勇的战马，说：”青海长云暗雪山，孤城遥望玉门关。黄沙百战穿金甲，不破楼兰终不还。“。悬崖下方，一支由老鼠组成的、数量庞大、无穷无尽的军队正带着临时制作的武器向前冲锋。这是一个戏剧性的、大规模的战斗场景，灵感来自中国古代的战争史诗。远处的雪山上空，天空乌云密布。整体氛围是“可爱”与“霸气”的搞笑和史诗般的融合。
                    audio_url: >-
                      https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250923/hbiayh/%E4%BB%8E%E5%86%9B%E8%A1%8C.mp3
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    prompt_extend: true
                    duration: 10
              自动配音:
                summary: 自动配音
                value:
                  model: wan2.7-t2v
                  input:
                    prompt: >-
                      一幅史诗级可爱的场景。一只小巧可爱的卡通小猫将军，身穿细节精致的金色盔甲，头戴一个稍大的头盔，勇敢地站在悬崖上。他骑着一匹虽小但英勇的战马，说：”青海长云暗雪山，孤城遥望玉门关。黄沙百战穿金甲，不破楼兰终不还。“。悬崖下方，一支由老鼠组成的、数量庞大、无穷无尽的军队正带着临时制作的武器向前冲锋。这是一个戏剧性的、大规模的战斗场景，灵感来自中国古代的战争史诗。远处的雪山上空，天空乌云密布。整体氛围是“可爱”与“霸气”的搞笑和史诗般的融合。
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
                    prompt_extend: true
                    duration: 10
              使用反向提示词:
                summary: 使用反向提示词
                value:
                  model: wan2.7-t2v
                  input:
                    prompt: 一只小猫在月光下奔跑
                    negative_prompt: 花朵
                  parameters:
                    resolution: 720P
                    ratio: '16:9'
      responses:
        '200':
          description: 提交成功，返回视频任务对象。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
              example:
                output:
                  task_status: PENDING
                  task_id: 0385dc79-5ff8-4d82-bcb6-xxxxxx
                request_id: 4909100c-7b5a-9f92-bfe5-xxxxxx
        '400':
          description: 请求参数不合法。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 鉴权失败，例如未提供令牌或令牌无效。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 触发速率限制或账户额度不足。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 服务端处理请求时发生内部错误。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    Wan27T2VRequest:
      type: object
      required:
        - model
        - input
      properties:
        model:
          type: string
          enum:
            - wan2.7-t2v
          description: 模型名称。
        input:
          $ref: '#/components/schemas/Wan27T2VInput'
        parameters:
          $ref: '#/components/schemas/Wan27T2VParameters'
    VideoTaskResponse:
      type: object
      properties:
        output:
          type: object
          properties:
            task_id:
              type: string
              description: 任务ID。查询有效期24小时。
            task_status:
              type: string
              description: |-
                任务状态。

                枚举值

                PENDING：任务排队中

                RUNNING：任务处理中

                SUCCEEDED：任务执行成功

                FAILED：任务执行失败

                CANCELED：任务已取消

                UNKNOWN：任务不存在或状态未知
        request_id:
          type: string
          description: 请求唯一标识。可用于请求明细溯源和问题排查。
        code:
          type: string
          description: 请求失败的错误码。请求成功时不会返回此参数。
        message:
          type: string
          description: 请求失败的详细信息。请求成功时不会返回此参数。
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: 错误码。
        message:
          type: string
          description: 错误信息。
        request_id:
          type: string
          description: 请求 ID。
    Wan27T2VInput:
      type: object
      required:
        - prompt
      properties:
        prompt:
          type: string
          description: >-
            文本提示词。用来描述生成视频中期望包含的元素和视觉特点。支持中英文，每个汉字/字母占一个字符，超过部分会自动截断。长度限制因模型版本而异：

            - `wan2.7-t2v`：不超过5000个字符。
          maxLength: 5000
        negative_prompt:
          type: string
          description: >-
            反向提示词，用来描述不希望在视频画面中看到的内容，可以对视频画面进行限制。支持中英文，长度不超过500个字符，超过部分会自动截断。示例值：低分辨率、错误、最差质量、低质量、残缺、多余的手指、比例不良等。
          maxLength: 500
        audio_url:
          type: string
          description: >-
            音频文件URL，模型将使用该音频生成视频。


            支持的输入格式：

            - 公网URL：支持 HTTP 和 HTTPS 协议，示例值
            `https://help-static-aliyun-doc.aliyuncs.com/xxx.mp3`。

            - 临时URL：支持OSS协议，必须通过上传文件获取临时 URL，示例值
            `oss://dashscope-instant/xxx/xxx.mp3`。


            音频限制：

            - 格式：wav、mp3。

            - 时长：2～30s。

            - 文件大小：不超过15MB。

            - 超限处理：若音频长度超过 duration
            值（如5秒），自动截取前5秒，其余部分丢弃。若音频长度不足视频时长，超出音频长度部分为无声视频。例如，音频为3秒，视频时长为5秒，输出视频前3秒有声，后2秒无声。
    Wan27T2VParameters:
      type: object
      properties:
        resolution:
          type: string
          enum:
            - 720P
            - 1080P
          description: |-
            重要：resolution 直接影响费用，请在调用前确认模型价格。

            生成视频的分辨率档位，用于控制视频的清晰度（总像素）。

            `wan2.7-t2v`：可选值：`720P`、`1080P`。默认值为 `1080P`。
          default: 1080P
        ratio:
          type: string
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
          description: |-
            生成视频的宽高比。
            - `16:9`（默认值）
            - `9:16`
            - `1:1`
            - `4:3`
            - `3:4`

            不同宽高比对应的输出视频分辨率（宽*高）见下方表格：

            **720P：**
            - `16:9` → 1280*720
            - `9:16` → 720*1280
            - `1:1` → 960*960
            - `4:3` → 1104*832
            - `3:4` → 832*1104

            **1080P：**
            - `16:9` → 1920*1080
            - `9:16` → 1080*1920
            - `1:1` → 1440*1440
            - `4:3` → 1648*1248
            - `3:4` → 1248*1648
          default: '16:9'
        duration:
          type: integer
          description: |-
            重要：duration 直接影响费用，按秒计费，请在调用前确认模型价格。

            生成视频的时长，单位为秒。
            - `wan2.7-t2v`：取值为 [2, 15] 之间的整数。默认值为5。
          minimum: 2
          maximum: 15
          default: 5
        prompt_extend:
          type: boolean
          description: >-
            是否开启 prompt 智能改写。开启后使用大模型对输入 prompt 进行智能改写。对于较短的 prompt
            生成效果提升明显，但会增加耗时。`true`（默认值）：开启智能改写。`false`：不开启智能改写。
          default: true
        watermark:
          type: boolean
          description: 是否添加水印标识，水印位于视频右下角，文案固定为 "AI生成"。`false`（默认值）：不添加水印。`true`：添加水印。
          default: false
        seed:
          type: integer
          description: >-
            随机数种子，取值范围为 [0, 2147483647]。未指定时，系统自动生成随机种子。若需提升生成结果的可复现性，建议固定 seed
            值。请注意，由于模型生成具有概率性，即使使用相同 seed，也不能保证每次生成结果完全一致。
          minimum: 0
          maximum: 2147483647
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '在请求头中传入 `Authorization: Bearer <token>`。'

````