API Reference
Wan Edit-Video
Create a text-to-video task and follow it through completion or failure.
01
Overview
Create an asynchronous text-to-video task with a supported model. Use the returned task ID to retrieve its state, or provide callback_url for terminal delivery.
Quick start
- Create an API key and set it as RUNAPI_API_KEY.
- Choose a supported model and send a POST request whose body matches that model's schema.
- Store the returned task ID, then poll until a terminal state or handle the terminal callback.
Endpoint
- Base URL
https://runapi.ai- API version
v1- Authentication
Authorization: Bearer YOUR_API_TOKEN
02
Supported models
Open a model page for current pricing, rate limits, and commercial-usage details.
03
JSON bodyRequest schema
Fields and allowed values depend on the selected model. When supplied, callback_url receives a terminal task delivery.
wan-2.6-edit-video17 fields
aspect_ratiostring
Optional
audioboolean
Optional
audio_settingstring
Optional
callback_urlstring
Optional
duration_secondsinteger
Optional
enable_prompt_expansionboolean
Optional
enable_safety_checkerboolean
Optional
modelstring
Optional
multi_shotsboolean
Optional
negative_promptstring
Optional
output_resolutionstring
Optional
Allowed values:
720p, 1080p
promptstring
Required
reference_image_urlstring
Optional
seedinteger
Optional
source_video_urlstring
Optional
source_video_urlsarray
Required
watermarkboolean
Optional
wan-2.6-flash-edit-video17 fields
aspect_ratiostring
Optional
audioboolean
Optional
audio_settingstring
Optional
callback_urlstring
Optional
duration_secondsinteger
Optional
enable_prompt_expansionboolean
Optional
enable_safety_checkerboolean
Optional
modelstring
Optional
multi_shotsboolean
Optional
negative_promptstring
Optional
output_resolutionstring
Optional
promptstring
Required
reference_image_urlstring
Optional
seedinteger
Optional
source_video_urlstring
Optional
source_video_urlsarray
Required
watermarkboolean
Optional
wan-2.7-edit-video17 fields
aspect_ratiostring
Optional
Allowed values:
16:9, 9:16, 1:1, 4:3, 3:4
audioboolean
Optional
audio_settingstring
Optional
callback_urlstring
Optional
duration_secondsinteger
Optional
enable_prompt_expansionboolean
Optional
enable_safety_checkerboolean
Optional
modelstring
Optional
multi_shotsboolean
Optional
negative_promptstring
Optional
output_resolutionstring
Optional
Allowed values:
720p, 1080p
promptstring
Optional
reference_image_urlstring
Optional
seedinteger
Optional
source_video_urlstring
Required
source_video_urlsarray
Optional
watermarkboolean
Optional
04
HTTP 202Create acceptance
POST /api/v1/wan/edit_video
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
05
HTTP 200Polling processing
GET /api/v1/wan/edit_video/:id
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
06
HTTP 200Polling completed
GET /api/v1/wan/edit_video/:id
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "completed",
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
07
HTTP 200Polling failed
GET /api/v1/wan/edit_video/:id
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"error": "Task processing failed.",
"id": "tsk_reference_demo",
"status": "failed"
}
08
HTTP 200Customer callback: completed
POST callback_url
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "completed",
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
09
HTTP 200Customer callback: failed
POST callback_url
JSON
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"error": {
"code": "generation_failed",
"message": "Task processing failed."
},
"id": "tsk_reference_demo",
"status": "failed"
}
10
HTTP 400Errors
JSON
{
"error": {
"code": "invalid_request",
"message": "A required request field is missing."
}
}
11
Generated Code Samples
Use cURL directly, or install an SDK for your language. Each sample submits the validated request shown in this reference.
CURL
curl -X POST https://runapi.ai/api/v1/wan/edit_video \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"model":"wan-2.6-edit-video","source_video_urls":["https://file.runapi.ai/source-video.mp4"],"prompt":"Replace the sky with a clear sunrise."}'
12