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

# Wan 2.7 — 视频编辑

> 使用 Wan 2.7，通过文本提示词和可选的参考图片编辑现有视频片段。

|           |                              |
| --------- | ---------------------------- |
| **模型 ID** | `alibaba/wan-2-7-video-edit` |
| **系列**    | `wan-2-7-novita`             |
| **任务**    | `video-edit`                 |
| **模态**    | 视频                           |
| **上游**    | Alibaba Wan 2.7              |

<Note>
  **`duration` 从输入片段的起始处开始截取。** 允许的
  范围是 `[2, 10]`；请选择一个 `≤ 输入视频长度` 的值，否则上游
  会以 "failed to exec task" 拒绝该任务。上游的 "不截取"
  哨兵值（`duration: 0`）在 VibeToken 上被有意禁用了 ——
  它会对任意长度的输出按 \$0 计费，因此我们将
  `duration` 固定为一个明确的值。
</Note>

## Endpoint

```http theme={null}
POST https://vibetoken.cn/v1/videos/generations
```

异步 —— 返回 `{id, status: "pending"}`；轮询
`GET /v1/videos/generations/{id}` 直到 `success` 或 `failed`。

## Parameters

<ParamField body="prompt" type="string" required>
  描述编辑内容的文本指令。最多 5000 个字符。
</ParamField>

<ParamField body="video_urls" type="string[]" required>
  恰好一个输入视频 URL（HTTPS, MP4）。
</ParamField>

<ParamField body="image_urls" type="string[]">
  最多 3 个参考图片 URL，用于引导编辑方向。
</ParamField>

<ParamField body="resolution" type="&#x22;720P&#x22; | &#x22;1080P&#x22;" default="&#x22;1080P&#x22;">
  输出分辨率。决定每秒的费率（$0.10/s 对比 $0.15/s）。
</ParamField>

<ParamField body="duration" type="integer" default="5">
  生成片段的时长（秒）。范围 `[2, 10]`。从输入的起始处
  截取。不得超过输入视频的长度，否则上游会拒绝该
  任务。
</ParamField>

<ParamField body="ratio" type="&#x22;16:9&#x22; | &#x22;9:16&#x22; | &#x22;1:1&#x22; | &#x22;4:3&#x22; | &#x22;3:4&#x22;">
  输出宽高比。若省略，则使用输入片段的宽高比。
</ParamField>

<ParamField body="audio_setting" type="&#x22;auto&#x22; | &#x22;origin&#x22;" default="&#x22;auto&#x22;">
  `auto` 让模型合成一条新的音轨；`origin` 保留
  输入片段的音频。
</ParamField>

<ParamField body="negative_prompt" type="string">
  用于引导模型避开的内容。最多 500 个字符。
</ParamField>

<ParamField body="prompt_extend" type="boolean" default="true">
  模型是否应在生成前扩展提示词。
</ParamField>

<ParamField body="watermark" type="boolean" default="false">
  是否在输出上叠加上游水印。
</ParamField>

<ParamField body="seed" type="integer">
  随机数生成器的初始化种子。范围 `[0, 2147483647]`。
</ParamField>

## Example

```bash theme={null}
curl https://vibetoken.cn/v1/videos/generations \
  -H "Authorization: Bearer $VIBETOKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "alibaba/wan-2-7-video-edit",
    "prompt": "restyle as a watercolor painting, keep the camera move",
    "video_urls": ["https://example.com/source.mp4"],
    "resolution": "1080P",
    "duration": 5,
    "audio_setting": "origin"
  }'
```

```json theme={null}
{ "id": "wan_ve_001…", "status": "pending", "model": "alibaba/wan-2-7-video-edit" }
```

轮询直到进入终态：

```bash theme={null}
curl https://vibetoken.cn/v1/videos/generations/wan_ve_001… \
  -H "Authorization: Bearer $VIBETOKEN_API_KEY"
```

```json theme={null}
{
  "id": "wan_ve_001…",
  "status": "success",
  "data": [{ "url": "https://…mp4" }]
}
```

## Reference
