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

# Wan 2.7 VideoEdit

> 萬相 2.7 VideoEdit 通過自然語言編輯一個源影片，可搭配最多四張參考圖片；不是純文生影片模型。

<link rel="alternate" hrefLang="en" href="https://mixroute.ai/docs/model-api/alibaba/wan2.7-videoedit" />

<link rel="alternate" hrefLang="zh-Hans" href="https://mixroute.ai/docs/zh-hans/model-api/alibaba/wan2.7-videoedit" />

<link rel="alternate" hrefLang="zh-Hant" href="https://mixroute.ai/docs/zh-hant/model-api/alibaba/wan2.7-videoedit" />

<link rel="alternate" hrefLang="ja" href="https://mixroute.ai/docs/ja/model-api/alibaba/wan2.7-videoedit" />

<link rel="alternate" hrefLang="x-default" href="https://mixroute.ai/docs/model-api/alibaba/wan2.7-videoedit" />

萬相 2.7 VideoEdit 通過自然語言編輯一個源影片，可搭配最多四張參考圖片；不是純文生影片模型。

使用完整模型 ID `wan2.7-videoedit` 呼叫 MixRoute 影片生成介面。

## 模型規格

| 專案 | 說明 |
| - | - |
| 型別 | 影片編輯 |
| 解析度 | 720P / 1080P |
| 時長（秒） | 2-10 |
| 輸出 | MP4 / 30 fps |
| 請求 | `model` + `metadata.input` + `metadata.parameters` |

完整欄位、素材限制、預設值及輪詢流程見 [通義萬相介面](/docs/zh-hant/api-reference/endpoint/wan)。不要跨版本複用輸入和輸出尺寸欄位。

## 請求示例

設定 MIXROUTE\_API\_KEY，並將媒體佔位值替換為可訪問的檔案。

```bash theme={null}
curl --request POST "https://api.mixroute.ai/v1/video/generations" \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "wan2.7-videoedit",
  "metadata": {
    "input": {
      "prompt": "Change the mug color to blue while preserving the original motion and white tabletop.",
      "media": [
        {
          "type": "video",
          "url": "https://example.com/source.mp4"
        }
      ]
    },
    "parameters": {
      "resolution": "720P",
      "duration": 2,
      "watermark": false
    }
  }
}'
```

### Python

```python theme={null}
import json
import os
import requests

payload = json.loads(r'''
{
  "model": "wan2.7-videoedit",
  "metadata": {
    "input": {
      "prompt": "Change the mug color to blue while preserving the original motion and white tabletop.",
      "media": [
        {
          "type": "video",
          "url": "https://example.com/source.mp4"
        }
      ]
    },
    "parameters": {
      "resolution": "720P",
      "duration": 2,
      "watermark": false
    }
  }
}
''')
response = requests.post(
    "https://api.mixroute.ai/v1/video/generations",
    headers={"Authorization": "Bearer " + os.environ["MIXROUTE_API_KEY"]},
    json=payload,
    timeout=120,
)
response.raise_for_status()
result = response.json()
task_id = result.get("task_id") or result.get("id")
if not task_id:
    raise RuntimeError(result.get("message") or result)
print(task_id)
```

儲存提交返回的 MixRoute 任務 ID，通過 [查詢影片任務](/docs/zh-hant/api-reference/endpoint/query-video-task) 輪詢至 SUCCESS 或 FAILURE。成功後讀取 data.result\_url，上游原始結果與 usage 位於 data.data。


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