Alibaba Wan 2.7 Video Edit API Documentation
Playground
Try it on WaveSpeedAI!WAN 2.7 Video Edit performs prompt-driven video editing with multi-image reference support, supporting 720p/1080p output. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
Wan 2.7 Video Edit performs prompt-driven editing on existing videos with optional multi-image reference support. Upload a source video, describe the desired edits in natural language, and optionally provide reference images to guide the target style or element appearance — the model applies precise, context-aware edits while preserving motion and temporal consistency throughout the clip.
- Need to extend a video? Try Wan 2.7 Video Extend
- Need to generate from an image? Try Wan 2.7 Image-to-Video
Why Choose This?
-
Natural-language video editing Describe your edit in plain text — swap colors, change objects, alter styles — without manual masking or keyframing.
-
Multi-image reference support Upload 1 to 9 reference images to guide the target element, style, or appearance in the edited output.
-
Audio control Choose between auto mode (model decides) or origin to preserve the original audio track.
-
Negative prompt support Specify what to avoid in the edit for more precise control over the output.
-
Prompt expansion Enable enable_prompt_expansion to let the model automatically enrich and optimize your prompt before generation.
-
Resolution options Generate at 720p or 1080p to match your delivery requirements.
Parameters
| Parameter | Required | Description |
|---|---|---|
| video | Yes | Source video to edit (URL or file upload). |
| prompt | Yes | Text description of the desired edits. |
| images | No | Reference images to guide editing (1–9 images). Click Add Item for more. |
| negative_prompt | No | Elements to exclude from the edited video. |
| resolution | No | Output resolution: 720p (default) or 1080p. |
| duration | No | Output duration in seconds. Default 0 = same as input video. Set 2–10 to trim from the start to the specified length. |
| audio_setting | No | Audio mode: auto (default, model decides) or origin (keep original audio). |
| enable_prompt_expansion | No | Enable automatic prompt optimization before generation. Default: off. |
| seed | No | Random seed for reproducible results. Use -1 for a random seed. |
How to Use
- Upload your video — provide the source clip to edit via URL or drag-and-drop.
- Write your prompt — describe exactly what should change (e.g., “Change the motorcycle’s color to blue.”).
- Add reference images (optional) — upload images to guide the look of elements or styles in the edit.
- Add negative prompt (optional) — specify elements you want to exclude from the output.
- Select resolution — 720p for standard output, 1080p for higher-quality results.
- Set duration (optional) — leave at 0 to match the input video length, or set 2–10 to trim.
- Set audio_setting (optional) — choose auto or origin to preserve original audio.
- Enable prompt expansion (optional) — let the model automatically enrich your prompt.
- Set seed (optional) — fix the seed to reproduce a specific result in future runs.
- Submit — generate, preview, and download your edited video.
Pricing
Both the input video and output video are billed by duration.
| Duration | 720p | 1080p |
|---|---|---|
| 2s | $0.40 | $0.60 |
| 3s | $0.60 | $0.90 |
| 4s | $0.80 | $1.20 |
| 5s | $1.00 | $1.50 |
| 6s | $1.20 | $1.80 |
| 7s | $1.40 | $2.10 |
| 8s | $1.60 | $2.40 |
| 9s | $1.80 | $2.70 |
| 10s | $2.00 | $3.00 |
Billing Rules
- Both the input video and output video are billed.
- 720p: $0.10 per second for input and $0.10 per second for output.
- 1080p: $0.15 per second for input and $0.15 per second for output.
- Minimum billed duration: 2 seconds.
- Maximum billed duration: 10 seconds.
- When
durationis0, billing uses the input video duration, rounded up to a whole second and limited to 2–10 seconds. - Failed requests are not billed.
Best Use Cases
- Color & Style Changes — Swap object colors, materials, or visual styles across the entire clip.
- Object Replacement — Replace specific elements in the video with different objects or variants.
- Scene Adjustments — Change background mood, lighting, or environment without reshooting.
- E-commerce — Edit product videos to showcase different variants or settings from a single source clip.
- Content Iteration — Rapidly test multiple edit directions on the same source footage.
Pro Tips
- Be specific and descriptive in your prompt — the more detail you provide, the more accurate the edit.
- Upload reference images when you want the model to match a specific target appearance or style.
- Use negative_prompt to prevent edits from bleeding into areas you want to preserve.
- Enable prompt expansion for shorter or less detailed prompts to get richer output automatically.
- Use 720p to test your edit direction before committing to a 1080p final render.
Notes
- Both video and prompt are required fields; all other parameters are optional.
- Billed duration is clamped between 2 and 10 seconds regardless of actual video length.
- Ensure video and image URLs are publicly accessible if using links rather than direct uploads.
- Please ensure your content complies with usage policies.
Related Models
- Wan 2.7 Video Extend — Extend existing videos with last frame control.
- Wan 2.7 Image-to-Video — Animate a reference image into a cinematic video clip.
- Wan 2.7 Text-to-Video — Generate video from text prompts without existing footage.
Authentication
For authentication details, please refer to the Authentication Guide.
API Endpoints
Submit Task & Query Result
set -euo pipefail
export WAVESPEED_API_KEY="your-api-key"
REQUEST_BODY=$(cat <<'JSON'
{
"prompt": "A cinematic ocean wave at sunrise, highly detailed",
"video": "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4",
"resolution": "720p",
"duration": 0,
"audio_setting": "auto",
"enable_prompt_expansion": false,
"seed": -1
}
JSON
)
# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
-X POST "https://api.wavespeed.ai/api/v3/alibaba/wan-2.7/video-edit" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
-H "Content-Type: application/json" \
-d "${REQUEST_BODY}")
TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
printf 'Submission response did not contain a prediction id
' >&2
exit 1
fi
RESULT_URL=$(printf '%s' "${TASK}" | jq -r '.urls.get // empty')
if [ -z "${RESULT_URL}" ]; then RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"; fi
# 2. Poll until the prediction finishes.
while true; do
RESPONSE=$(curl --silent --show-error --fail-with-body \
"${RESULT_URL}" \
-H "Authorization: Bearer ${WAVESPEED_API_KEY}")
RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')
case "${STATUS}" in
completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
failed|cancelled|timeout) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
created|processing) sleep 2 ;;
*) printf 'Unexpected status: %s
' "${STATUS}" >&2; exit 1 ;;
esac
doneParameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| prompt | string | Yes | - | The positive prompt for the generation. | |
| video | string | Yes | - | The source video to edit. | |
| images | array<string> | No | - | 0 ~ 3 items | List of reference images for video editing (0-3 images, optional). |
| negative_prompt | string | No | - | The negative prompt for the generation. | |
| resolution | string | No | 720p | 720p, 1080p | The resolution of the generated video. |
| duration | integer | No | 0 | 0 ~ 10 | Duration of the output video in seconds. 0 means use input video length (max 10s). Set 2-10 to trim from 0s to specified length. |
| audio_setting | string | No | auto | auto, origin | Audio setting. 'auto' (default): model decides based on prompt content. 'origin': keep original audio from input video. |
| enable_prompt_expansion | boolean | No | false | - | If set to true, the prompt optimizer will be enabled. |
| seed | integer | No | -1 | - | The random seed to use for the generation. -1 means a random seed will be used. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Output values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.urls.get | string | URL to retrieve the prediction result |
| data.status | string | Status of the task: created, processing, completed, or failed |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction |
| data.model | string | Model ID used for the prediction |
| data.outputs | array<string | object> | Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model. |
| data.urls | object | Object containing related API endpoints |
| data.urls.get | string | URL to poll for the prediction result |
| data.status | string | Status: created, processing, completed, or failed |
| data.created_at | string | ISO timestamp of when the request was created |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |