---
title: "wan2.7-video-edit API"
method: POST
path: "/v1/videos/generations"
tags: ["Video Generation"]
---

# wan2.7-video-edit API

`POST /v1/videos/generations`

- WAN2.7 (wan2.7-video-edit) model supports video editing for **instruction-based editing** and **video transfer** tasks
- **Required:** upload exactly 1 video (`video_urls`); optionally upload up to 4 reference images (`image_urls`)
- Two usage patterns:
  - **Instruction-only editing:** provide `video_urls` + `prompt` (e.g. style change, replacing clothing)
  - **Instruction + reference images:** provide `video_urls` + `image_urls` + `prompt` (e.g. region replacement using elements from reference images)
- Audio handling: controlled via `keep_original_sound` (`true` keeps original audio; `false` lets the model handle audio intelligently)
- Asynchronous processing mode, use the returned task ID to [query status](/en/api-manual/task-management/get-task-detail)
- Generated video links are valid for 24 hours, please save them promptly
- **Billing:** charged based on "input video duration + output video duration"; only successful generations are billed, failed tasks are free

## Request body

- Wan27VideoEditRequest
  - `model` 'wan2.7-video-edit', required — Model name, must be `wan2.7-video-edit`
  - `prompt` string — Text prompt describing the desired editing effect. Supports Chinese and English; each character/letter counts as 1, with overflow auto-truncated. Maximum length 5000 characters
  - `negative_prompt` string — Negative prompt describing what should not appear in the video. Supports both Chinese and English. Maximum length 500 characters; overflow is auto-truncated
  - `video_urls` string[], required — Source video URL array. **Exactly 1 video is required** **Video limits:** - Formats: mp4, mov - Duration: `2 ~ 10` seconds - Resolution: width and height in `[240, 4096]` pixels - Aspect ratio: 1:8 ~ 8:1 - File size: up to `100MB`
  - `image_urls` string[] — Reference image URL array, up to 4 images. Used for the "instruction + reference image" pattern, e.g. replacing clothing or props with elements from a reference image **Image limits:** - Formats: JPEG, JPG, PNG (transparency not supported), BMP, WEBP - Resolution: width and height in `[240, 8000]` pixels - Aspect ratio: 1:8 ~ 8:1 - File size: up to `20MB`
  - `keep_original_sound` boolean — Audio handling for the edited video. Default: `false` - `false`: Smart mode. The model decides based on `prompt` content — if the prompt mentions audio elements, it may regenerate audio; otherwise it may preserve the original audio of the input video - `true`: Force-preserve the original audio of the input video; do not regenerate
  - `quality` '720p' | '1080p' — Video quality, defaults to `720p` **Options:** - `720p`: Standard definition, standard price, this is the default - `1080p`: High definition, higher price
  - `aspect_ratio` '16:9' | '9:16' | '1:1' | '4:3' | '3:4' — Video aspect ratio (optional) **Behavior:** - Not provided: video is generated using an aspect ratio close to the input video - Provided: video is generated using the specified `aspect_ratio` **Output resolution per quality tier:** | Quality | 16:9 | 9:16 | 1:1 | 4:3 | 3:4 | | --- | --- | --- | --- | --- | --- | | 720p | 1280×720 | 720×1280 | 960×960 | 1104×832 | 832×1104 | | 1080p | 1920×1080 | 1080×1920 | 1440×1440 | 1648×1248 | 1248×1648 |
  - `duration` number — Video duration in seconds **Rules:** - Default `0`: keep the input video duration; **no truncation** (only set this field when you want to truncate the input video) - When set explicitly, range is `2 ~ 10`: the system truncates the input video starting at 0s up to the specified `duration`
  - `seed` integer — Random seed, defaults to random **Notes:** - Range: `1` ~ `2147483647` - Fixing the seed reduces variation when iterating on prompts and improves reproducibility
  - `prompt_extend` boolean — Whether to enable intelligent prompt rewriting. When enabled, a large model will optimize the prompt, which significantly improves results for simple or insufficiently descriptive prompts. **Note:** Default is `false`. Omitting the field or sending `false` will not trigger rewriting; explicitly send `true` to enable.
  - `callback_url` string, uri — HTTPS callback URL for task completion **Callback Timing:** - Triggered when task is completed, failed, or cancelled - Sent after billing confirmation **Security Restrictions:** - Only HTTPS protocol is supported - Callbacks to internal IP addresses are prohibited (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.) - URL length must not exceed `2048` characters **Callback Mechanism:** - Timeout: `10` seconds - Up to `3` retries after failure (retries at `1`/`2`/`4` seconds after failure) - Callback response format is consistent with the task query API response - 2xx status codes are considered successful, other status codes trigger retries

## Response `200`

Video task created successfully

- VideoGenerationResponse
  - `created` integer — Task creation timestamp
  - `id` string — Task ID
  - `model` string — Actual model name used
  - `object` 'video.generation.task' — Specific task type
  - `progress` integer — Task progress percentage (0-100)
  - `status` 'pending' | 'processing' | 'completed' | 'failed' — Task status
  - `task_info` VideoTaskInfo
    - `can_cancel` boolean — Whether the task can be cancelled
    - `estimated_time` integer — Estimated completion time (seconds)
  - `type` 'text' | 'image' | 'audio' | 'video' — Task output type
  - `usage` Usage — Usage and billing information
    - `billing_rule` 'per_call' | 'per_token' | 'per_second' — Billing rule
    - `credits_reserved` number — Estimated credits to be consumed
    - `user_group` 'default' | 'vip' — User group category

## Other responses

- `400` — Invalid request parameters
- `401` — Unauthenticated, invalid or expired token
- `402` — Insufficient quota, top-up required
- `403` — No access permission
- `429` — Rate limit exceeded
- `500` — Internal server error

---

[API](https://skmtc.dev/evolink/apis/get-credits-usage-api.md) · [All operations](https://skmtc.dev/evolink/apis/get-credits-usage-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/evolink/get-credits-usage-api/revisions/88edb0ec881f/schema)
