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

# Wan 2.7 视频编辑

> Wan 2.7 视频编辑 API 根据文本和可选的参考图片改造现有视频，引导场景变化。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口获取结果。

使用 Wan 2.7 视频编辑，根据文本和可选的参考图片改造现有视频，引导场景变化。

## 模型

* **alibaba/wan-2.7/video-edit** - 根据文字指令编辑现有视频。

## 功能

* 根据文字指令编辑现有视频。
* 输出分辨率可选 `720p`、`1080p`。

## 时长选项

* **自动** - 默认 `duration: 0`。服务会检测源视频时长，检查其是否在 **2-10 秒**之间，然后向下取整到整秒。计费和输出生成使用相同的整秒时长。
* **指定输出时长** - 将 `duration` 设为 `2`、`3`、`4`、`5`、`6`、`7`、`8`、`9`、`10` 秒。
* 使用 `duration: 0` 时，源视频必须是可公开访问的 HTTP(S) 文件，且不超过 **100 MiB**。

## 高级参数

`model` 和可选的 `callback_url` 放在请求根级。所有工作流参数（包括输出选项）都放在 `input` 内。

只发送本工作流支持的 input 字段。不支持的 `input` 字段会在扣除积分前被拒绝。输入 URL 必须使用 HTTP(S)，带主机名，且不含内嵌凭证。图片输入也接受图片 Data URI 或原始 Base64。图片转换和媒体校验会在扣除积分前完成。

`duration` 和 `seed` 也接受整数字符串，如 `"5"`；小数（如 `5.0`）和小数字符串（如 `"5.0"`）会被拒绝。null 或空值会使用默认时长或省略种子。支持的布尔字段也接受 `0`/`1`，以及不区分大小写的字符串 `true`/`false`、`1`/`0`、`yes`/`no`、`y`/`n` 和 `on`/`off`；null 表示省略该字段。首尾空白会被去除，分辨率取值不区分大小写。

### 提示词

* `prompt`：必填。描述要做的修改。最多：**5,000 个 Unicode 字符**。
* 首尾空白会被去除。必须提供非空提示词。

### 参考图片 URL

* `reference_image_url`：可选。提供一张用于引导编辑的图片，可以是公开的 HTTP(S) URL、图片 Data URI 或原始 Base64。

### 源视频

* `video_url`：必填。提供源视频 URL，使用可公开访问的 HTTP(S) URL。

### 宽高比

* `aspect_ratio`：可选。可选值：`16:9`、`9:16`、`1:1`、`4:3`、`3:4`。默认：`16:9`。

### 分辨率

* `resolution`：可选。可选值：`720p`、`1080p`。默认：`720p`。

### 多镜头生成

* `multi_shots`：可选。启用多镜头生成。使用 `true` 或 `false`。

### 音频设置

* `audio_setting`：可选。以字符串形式提供音频设置。

### 种子

* `seed`：可选。设置生成种子。`0` 到 `2147483647` 的整数。

### 安全检查

* `enable_safety_checker`：可选。控制安全检查。使用 `true` 或 `false`。

## 定价

用量等于输出秒数乘以所选分辨率的费率。当前价格见[定价](https://vidgo.ai/apis/api-pricing)。

提交时扣除积分，任务失败后退还。


## OpenAPI

````yaml zh/api-manual/video-series/alibaba-wan-2-7-video-edit.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Wan 2.7 视频编辑
  description: 通过 Vidgo 统一提交 API 使用 Wan 2.7 视频编辑。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Video Series
      summary: Wan 2.7 视频编辑
      description: >-
        只发送本工作流列出的字段。包含其他工作流参数的请求会在扣除积分前被拒绝。


        提示词会去除首尾空白，最多 5,000 个 Unicode 字符。必须提供非空提示词。图片输入接受 HTTP(S) URL、图片 Data
        URI 或原始 Base64。转换和校验会在扣费前完成。其他媒体需要公开的 HTTP(S) URL。


        用量等于输出秒数乘以所选分辨率的费率。当前价格见[定价](https://vidgo.ai/apis/api-pricing)。


        duration=0（默认）时会检测源视频时长，检查其是否在 2 到 10
        秒之间，然后向下取整到整秒。计费和输出生成使用相同的整秒时长。显式指定 duration 时则以其作为输出时长。


        duration=0 时，需要检测时长的媒体必须是可公开访问的 HTTP(S) 文件，大小不超过 100 MiB。


        `duration` 和 `seed` 也接受整数字符串，如 `"5"`；小数（如 `5.0`）和小数字符串（如
        `"5.0"`）会被拒绝。null 或空值会使用默认时长或省略种子。支持的布尔字段也接受 `0`/`1`，以及不区分大小写的字符串
        `true`/`false`、`1`/`0`、`yes`/`no`、`y`/`n` 和 `on`/`off`；null
        表示省略该字段。首尾空白会被去除，分辨率取值不区分大小写。
      operationId: submit_alibaba_wan_2_7_video_edit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: true
              description: model 和 callback_url 放在根级。未知的根级字段会被忽略；不支持的 input 字段会被拒绝。
              properties:
                model:
                  type: string
                  example: alibaba/wan-2.7/video-edit
                input:
                  type: object
                  properties:
                    prompt:
                      type: string
                      maxLength: 5000
                      minLength: 1
                      description: 提示词。
                    reference_image_url:
                      type: string
                      minLength: 1
                      description: 参考图片 URL。
                    video_url:
                      type: string
                      format: uri
                      description: 视频 URL。
                    aspect_ratio:
                      type: string
                      enum:
                        - '16:9'
                        - '9:16'
                        - '1:1'
                        - '4:3'
                        - '3:4'
                      default: '16:9'
                      description: 宽高比。
                    resolution:
                      type: string
                      enum:
                        - 720p
                        - 1080p
                      default: 720p
                      description: 分辨率。
                    duration:
                      type: integer
                      default: 0
                      enum:
                        - 0
                        - 2
                        - 3
                        - 4
                        - 5
                        - 6
                        - 7
                        - 8
                        - 9
                        - 10
                      description: 时长。
                    multi_shots:
                      type: boolean
                      description: 多镜头。
                    audio_setting:
                      type: string
                      description: 音频设置。
                    seed:
                      type: integer
                      minimum: 0
                      maximum: 2147483647
                      description: 种子。
                    enable_safety_checker:
                      type: boolean
                      description: 启用安全检查。
                  additionalProperties: false
                  required:
                    - prompt
                    - video_url
                callback_url:
                  type: string
                  nullable: true
                  description: >-
                    可选的公开 HTTP(S) 地址，用于接收任务完成通知。建议使用 HTTPS。省略、设为 null
                    或空字符串即不发送回调。
            examples:
              basic:
                summary: 基础工作流
                value:
                  model: alibaba/wan-2.7/video-edit
                  input:
                    prompt: >-
                      A quiet forest under soft morning light, with natural
                      detail.
                    video_url: https://example.com/video.mp4
                    aspect_ratio: '16:9'
                    resolution: 720p
                    duration: 0
              callback:
                summary: 接收完成回调
                value:
                  model: alibaba/wan-2.7/video-edit
                  input:
                    prompt: >-
                      A quiet forest under soft morning light, with natural
                      detail.
                    video_url: https://example.com/video.mp4
                    aspect_ratio: '16:9'
                    resolution: 720p
                    duration: 0
                  callback_url: https://your-domain.com/callback
      responses:
        '200':
          description: 任务已提交
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - data
                properties:
                  code:
                    type: integer
                    enum:
                      - 200
                  data:
                    type: object
                    required:
                      - task_id
                      - status
                      - created_time
                    properties:
                      task_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - not_started
                          - running
                          - finished
                          - failed
                      created_time:
                        type: string
                        format: date-time
              example:
                code: 200
                data:
                  task_id: task-unified-example
                  status: running
                  created_time: '2026-09-10T08:00:00'
        '400':
          description: 输入无效、不支持的档位、媒体无法访问或积分不足
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '401':
          description: 凭证无效
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '403':
          description: 拒绝访问
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '404':
          description: 模型不存在或已停用
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '408':
          description: 请求超时
          content:
            text/plain:
              schema:
                type: string
              example: Request timeout
        '422':
          description: JSON 无效或请求体不是对象
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '429':
          description: 超出频率限制或 API Key 积分限额
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '500':
          description: 内部错误
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '502':
          description: 无法创建上游生成任务
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '503':
          description: 所请求的模型暂时不可用
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 使用 VIDGO_API_KEY。

````

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