Video edit: create an edit task from a video + reference images + instruction
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data @- <<EOF
{
"model": "wan2.7-videoedit",
"input": {
"prompt": "Replace the girl's outfit in the video with the outfit in the image",
"media": [
{
"type": "video",
"url": "https://your-cdn.com/source.mp4"
},
{
"type": "reference_image",
"url": "https://your-cdn.com/new-clothes.png"
}
]
}
}
EOF{
"output": {
"task_id": "3b216861-6a5f-441d-a438-602ab2c0d103",
"task_status": "PENDING"
},
"request_id": "..."
}Wan2.7 Video Generation (Alibaba)
Wan2.7 Video Edit API Reference
Wan2.7-videoedit video edit API reference and live playground: input video + reference images + natural-language instruction for local/global edits like outfit swap and background swap.
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
Video edit: create an edit task from a video + reference images + instruction
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data @- <<EOF
{
"model": "wan2.7-videoedit",
"input": {
"prompt": "Replace the girl's outfit in the video with the outfit in the image",
"media": [
{
"type": "video",
"url": "https://your-cdn.com/source.mp4"
},
{
"type": "reference_image",
"url": "https://your-cdn.com/new-clothes.png"
}
]
}
}
EOF{
"output": {
"task_id": "3b216861-6a5f-441d-a438-602ab2c0d103",
"task_status": "PENDING"
},
"request_id": "..."
}Documentation Index
Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
Use this file to discover all available pages before exploring further.
The Playground on the right lets you debug directly: put
Bearer sk-your-api-key in Authorization, fill in model / input.media / parameters, and send the request. A successful submission returns a task_id; see below for polling and download.This page is the creation endpoint for
wan2.7-videoedit (video edit): give a video + 1-5 reference images + a natural-language edit instruction to edit video elements, such as swapping outfits or backgrounds. Note the model name has no hyphen (videoedit). For the full async flow, see the Wan Overview.input.mediamust contain both avideo(the video being edited) and at least onereference_image(the reference asset, ≤5).- The model name is
wan2.7-videoedit(no hyphen), different from HappyHorse’shappyhorse-1.0-video-edit(with hyphens), so don’t mix them up. - Creation requests go to
/wan/api/v1/...withX-DashScope-Async: enable; do not use/v1/videos.
Code examples
curl -X POST "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis" \
-H "X-DashScope-Async: enable" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-videoedit",
"input": {
"prompt": "Replace the girl's outfit in the video with the outfit in the image",
"media": [
{"type": "video", "url": "https://your-cdn.com/source.mp4"},
{"type": "reference_image", "url": "https://your-cdn.com/new-clothes.png"}
]
},
"parameters": {"resolution": "720P", "prompt_extend": true, "watermark": true}
}'
Parameter and media quick reference
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
model | string | ✓ | — | Fixed wan2.7-videoedit |
input.prompt | string | ✓ | — | Natural-language edit instruction |
input.media | array | ✓ | — | See the media table below |
parameters.resolution | string | 720P | 720P / 1080P | |
parameters.prompt_extend | bool | true | Smart rewriting | |
parameters.watermark | bool | false | ”AI generated” watermark |
media[] values
type | Required | Count | Notes |
|---|---|---|---|
video | ✓ | 1 | The source video being edited |
reference_image | ✓ | 1-5 | Reference asset (new outfit, new background, etc.) |
The video edit output duration follows the input video, not the
duration parameter, so this capability usually does not pass duration.Response format
{
"output": { "task_id": "3b216861-6a5f-441d-a438-602ab2c0d103", "task_status": "PENDING" },
"request_id": "..."
}
After submitting, poll
GET /v1/tasks/{task_id} until completed, then download the mp4 from result_url (no Authorization header, expires in 24 hours). For the full loop, see Wan Overview · Async call flow.Authorizations
The API Key obtained from the APIYI console
Headers
Async processing switch; must be set to enable
Available options:
enable Body
application/json
Was this page helpful?
⌘I