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

# Wan 2.7 — Video Edit

> Edit an existing video clip with a text prompt and optional reference images using Wan 2.7.

|              |                              |
| ------------ | ---------------------------- |
| **Model ID** | `alibaba/wan-2-7-video-edit` |
| **Family**   | `wan-2-7-novita`             |
| **Task**     | `video-edit`                 |
| **Modality** | Video                        |
| **Upstream** | Alibaba Wan 2.7              |

<Note>
  **`duration` truncates from the start of the input clip.** Allowed
  range is `[2, 10]`; pick a value `≤ input video length` or upstream
  rejects the job with "failed to exec task". The upstream's "no truncation"
  sentinel (`duration: 0`) is intentionally disabled on RouterBase —
  it billed \$0 against an arbitrary-length output, so we pin
  `duration` to an explicit value.
</Note>

## Endpoint

```http theme={null}
POST https://routerbase.com/v1/videos/generations
```

Async — returns `{id, status: "pending"}`; poll
`GET /v1/videos/generations/{id}` until `success` or `failed`.

## Parameters

<ParamField body="prompt" type="string" required>
  Text instruction describing the edit. Max 5000 characters.
</ParamField>

<ParamField body="video_urls" type="string[]" required>
  Exactly one input-video URL (HTTPS, MP4).
</ParamField>

<ParamField body="image_urls" type="string[]">
  Up to 3 reference image URLs to bias the edit.
</ParamField>

<ParamField body="resolution" type="&#x22;720P&#x22; | &#x22;1080P&#x22;" default="&#x22;1080P&#x22;">
  Output resolution. Drives the per-second rate ($0.10/s vs $0.15/s).
</ParamField>

<ParamField body="duration" type="integer" default="5">
  Length of the generated clip in seconds. Range `[2, 10]`. Truncates
  from the start of the input. Must not exceed the input video's
  length or upstream will reject the job.
</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;">
  Output aspect ratio. If omitted, the input clip's aspect ratio is
  used.
</ParamField>

<ParamField body="audio_setting" type="&#x22;auto&#x22; | &#x22;origin&#x22;" default="&#x22;auto&#x22;">
  `auto` lets the model synthesize a new audio track; `origin` keeps
  the input clip's audio.
</ParamField>

<ParamField body="negative_prompt" type="string">
  Content to steer the model away from. Max 500 characters.
</ParamField>

<ParamField body="prompt_extend" type="boolean" default="true">
  Whether the model should expand the prompt before generation.
</ParamField>

<ParamField body="watermark" type="boolean" default="false">
  Whether to overlay an upstream watermark on the output.
</ParamField>

<ParamField body="seed" type="integer">
  Random-generator initialiser. Range `[0, 2147483647]`.
</ParamField>

## Example

```bash theme={null}
curl https://routerbase.com/v1/videos/generations \
  -H "Authorization: Bearer $ROUTERBASE_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" }
```

Poll until terminal:

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

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

## Reference
