The Wan2.7 - video editing model supports multimodal inputs (text, images, and videos) for instruction-based editing and video migration.
Availability
The model, endpoint URL, and API key must belong to the same region. Cross-region calls fail.
Select a model: Confirm model availability in your target region.
Select a URL: Choose the regional endpoint URL. Both HTTP and DashScope SDK URLs are supported.
Configure an API key: Get an API key for the region, and configure it as an environment variable.
The sample code in this topic applies to the Singapore region.
HTTP
Video editing tasks typically take 1 to 5 minutes, so the API uses asynchronous invocation: Create a task → Poll for results.
Step 1: Create a task
Singapore
POST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Beijing
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
After the task is created, use the returned
task_idto query the result. Thetask_idis valid for 24 hours. Do not create duplicate tasks. Instead, use polling to retrieve the result.For a beginner's tutorial, see Postman.
Request parameters | Video style modificationVideo editing |
Content-Type The content type of the request. Must be | |
Authorization The authentication credentials using a Model Studio API key. Example: | |
X-DashScope-Async Enables asynchronous processing. Must be Important Returns "current user api does not support synchronous calls" error if not included. | |
Request body | |
model The model name. Example: wan2.7-videoedit. | |
input The input information, such as the prompt. | |
parameters Video processing parameters such as resolution, duration, prompt rewriting, and watermark. |
Response parameters | Successful responseSave the Error responseTask creation failed. See error codes to resolve the issue. |
output The task output. | |
request_id Unique identifier for the request. Use for tracing and troubleshooting issues. | |
code The error code. Returned only when the request fails. See error codes for details. | |
message Detailed error message. Returned only when the request fails. See error codes for details. |
Step 2: Query the result
Singapore
GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id}
Beijing
GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
Polling suggestion: Video generation can take several minutes. Use a polling mechanism with a reasonable query interval, such as 15 seconds, to retrieve the result.
Task status transition: PENDING → RUNNING → SUCCEEDED or FAILED.
Result URL: After the task is successful, a video URL is returned. The URL is valid for 24 hours. After you retrieve the URL, you must immediately download and save the video to a permanent storage service, such as Object Storage Service (OSS).
task_id validity: 24 hours. After this period, you cannot query the result, and the API returns a task status of
UNKNOWN.
Request parameters | Query task resultReplace |
Request headers | |
Authorization The authentication credentials using a Model Studio API key. Example: | |
Path parameters | |
task_id The ID of the task to query. |
Response parameters | Task succeededVideo URLs are retained for only 24 hours and then automatically purged. Save generated videos promptly. Task failedWhen a task fails, Task query expiredThe |
output The task output. | |
usage Output statistics. Only successful tasks are counted. | |
request_id Unique identifier for the request. Use for tracing and troubleshooting issues. |
Billing and rate limiting
For free quota and billing, see Model invocation pricing.
For model rate limits, see Wan series.
Billing description:
Input images are free. Input and output videos are billed per second. Total billable duration = Input video duration + Output video duration.
Failed calls do not incur fees or consume the free quota for new users.
Limitations
Data validity: The
task_idandvideo_urlexpire after 24 hours and can no longer be queried or downloaded.Content moderation: Inputs (prompts, images) and output videos are subject to Content Moderation review. Violations result in an "IPInfringementSuspect" or "DataInspectionFailed" error. See Error messages.
Error codes
If a call fails, see Error messages.