Reference-to-Video
Generate character-consistent video from multimodal references (image, video). Async task API: submit a request, receive a task_id, then poll for status to get the result.
Supports multimodal input (image, video). Use a person or object as the main character to generate single-character performance or multi-character interaction videos. Up to 10 seconds and 1080P resolution.
This is an async task-based API: submit a request to receive a task_id, poll for status, then download the video when complete.
Base URL
https://api.autorouter.top— Production
Authentication
BearerAuth: http (bearer)
Authenticate using a Bearer Token.
Format: Authorization: Bearer sk-xxxxxx
Endpoints
POST /api/v1/services/aigc/video-generation/video-synthesis
Create Video Generation Task
Create a video generation task from reference images and reference videos.
The request header must include X-DashScope-Async: enable.
Request Body
Content-Type: application/json
Example:
{
"model": "wan2.6-r2v-flash",
"input": {
"prompt": "Character2 sits on a chair by the window, holding character3, and plays a gentle American country ballad next to character4. Character1 says to Character2: \"That sounds nice\"",
"reference_urls": [
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/hfugmr/wan-r2v-role1.mp4",
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4",
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png",
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"
]
},
"parameters": {
"size": "1280*720",
"duration": 10,
"audio": true,
"shot_type": "multi",
"watermark": true
}
}Properties:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name. Available values: wan2.6-r2v, wan2.6-r2v-flash |
input | object | Yes | Basic input such as the prompt and reference assets |
input.prompt | string | Yes | Text prompt describing elements and visual traits of the generated video. See details below |
input.negative_prompt | string | No | Negative prompt describing content to avoid. Supports Chinese and English. Maximum 500 characters; excess is truncated |
input.reference_urls | array[string] | Yes | Array of reference file URLs. Supports videos and images. See details below |
parameters | object | No | Video processing parameters such as resolution, duration, and shot type |
parameters.size | string | No | Output video resolution in width*height format (e.g. 1280*720); affects billing. See details below |
parameters.duration | integer | No | Video duration in seconds (billed per second). Integer in [2, 10]. Default: 5 |
parameters.shot_type | string | No | Shot type. single (default) for a single continuous shot; multi for multiple shots. Takes priority over the prompt |
parameters.audio | boolean | No | Whether to generate audio. Supported only by wan2.6-r2v-flash. true (default) with audio; false silent. Pricing differs for audio vs silent |
parameters.watermark | boolean | No | Whether to add a watermark (fixed text "AI生成" in the bottom-right corner). false (default) does not add it; true adds it |
parameters.seed | integer | No | Random seed in [0, 2147483647]. Auto-generated if omitted. A fixed seed improves reproducibility but does not guarantee identical results |
inputobject(Required)
Basic input such as the prompt and reference assets.
Text prompt describing elements and visual traits of the generated video.
Supports Chinese and English. Each Chinese character, letter, or punctuation counts as one character; excess is truncated.
wan2.6-r2v,wan2.6-r2v-flash: maximum 1500 characters.
Character references: Reference roles with identifiers such as character1 and character2. Each reference (video or image) must contain only a single character. The model recognizes roles only through these identifiers. When multiple references are provided, role order follows the reference_urls array: the 1st URL is character1, the 2nd is character2, and so on.
Example: character1 happily watches a movie on the sofa.
Array of uploaded reference file URLs. Supports videos and images. Used to extract character appearance and voice (if available) for consistent generation.
Each URL may point to one image or one video:
- Images: 0–5
- Videos: 0–3
- Total limit: images + videos ≤ 5
When multiple references are provided, array order defines character order. Each reference file must contain only one subject character.
parametersobject(Optional)
Video processing parameters such as resolution, duration, and shot type.
Output video resolution in width*height format. Must be a concrete value (e.g. 1280*720), not 1:1 or 720P. Affects billing.
Default and available values depend on model:
wan2.6-r2v-flash,wan2.6-r2v: default1920*1080(1080P). Available resolutions: all 720P and 1080P options below.
720P tier:
| Resolution | Aspect ratio |
|---|---|
1280*720 | 16:9 |
720*1280 | 9:16 |
960*960 | 1:1 |
1088*832 | 4:3 |
832*1088 | 3:4 |
1080P tier:
| Resolution | Aspect ratio |
|---|---|
1920*1080 | 16:9 |
1080*1920 | 9:16 |
1440*1440 | 1:1 |
1632*1248 | 4:3 |
1248*1632 | 3:4 |
Output video duration in seconds (billed per second).
wan2.6-r2v-flash,wan2.6-r2v: integer in[2, 10]. Default:5
Example: 5
Specifies whether the video is a single continuous shot or multiple switching shots.
Priority: shot_type > prompt. For example, if shot_type is single, the model still outputs a single-shot video even if the prompt asks for multi-shot.
single: default, single continuous shotmulti: multiple shots
Use this when you need strict narrative control (e.g. single shot for product demos, multi-shot for short stories).
Whether to generate audio. Supported only by wan2.6-r2v-flash. Pricing differs for audio vs silent.
true: default, output with audiofalse: silent video. When generating silent video, you must explicitly setparameters.audio = false
Responses
200: Task created successfully
Content-Type: application/json
400: Invalid request parameters
Content-Type: application/json
429: Rate limit exceeded
Content-Type: application/json
Request Examples
curl -X POST "https://api.autorouter.top/api/v1/services/aigc/video-generation/video-synthesis" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxx" \
-H "X-DashScope-Async: enable" \
-d '{
"model": "wan2.6-r2v-flash",
"input": {
"prompt": "Character2 sits on a chair by the window, holding character3, and plays a gentle American country ballad next to character4. Character1 says to Character2: \"That sounds nice\"",
"reference_urls": [
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/hfugmr/wan-r2v-role1.mp4",
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4",
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png",
"https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"
]
},
"parameters": {
"size": "1280*720",
"duration": 10,
"audio": true,
"shot_type": "multi",
"watermark": true
}
}'Response Examples
{
"output": {
"task_status": "PENDING",
"task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
},
"request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}Response fields:
| Name | Type | Description |
|---|---|---|
output | object | Task output |
output.task_id | string | Task ID for polling status; valid for 24 hours |
output.task_status | string | Task status. Enum: PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN |
request_id | string | Unique request ID for tracing and troubleshooting |
code | string | Error code; returned only on failure |
message | string | Error message; returned only on failure |
GET /api/v1/tasks/{task_id}
Query Task Result by ID
Query task status and result using the task_id returned when creating the task. Query validity is 24 hours.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Authentication. Format: Bearer sk-xxxxxx |
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | Task ID |
Responses
200: Task queried successfully
Content-Type: application/json
400: Invalid request parameters
Content-Type: application/json
429: Rate limit exceeded
Content-Type: application/json
Request Examples
curl -X GET "https://api.autorouter.top/api/v1/tasks/{task_id}" \
-H "Authorization: Bearer sk-xxxxxx"Response Examples
{
"request_id": "caa62a12-8841-41a6-8af2-xxxxxx",
"output": {
"task_id": "eff1443c-ccab-4676-aad3-xxxxxx",
"task_status": "SUCCEEDED",
"submit_time": "2025-12-16 00:25:59.869",
"scheduled_time": "2025-12-16 00:25:59.900",
"end_time": "2025-12-16 00:30:35.396",
"orig_prompt": "character1 happily watches a movie on the sofa",
"video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
},
"usage": {
"duration": 10.0,
"size": "1280*720",
"input_video_duration": 5,
"output_video_duration": 5,
"video_count": 1,
"SR": 720
}
}Response fields:
| Name | Type | Description |
|---|---|---|
output | object | Task output |
output.task_id | string | Task ID; query validity 24 hours |
output.task_status | string | Task status. Enum: PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN. Typical flow while polling: PENDING → RUNNING → SUCCEEDED / FAILED |
output.submit_time | string | Submit time, format YYYY-MM-DD HH:mm:ss.SSS |
output.scheduled_time | string | Scheduled execution time, format YYYY-MM-DD HH:mm:ss.SSS |
output.end_time | string | Completion time, format YYYY-MM-DD HH:mm:ss.SSS |
output.video_url | string | Video download URL; returned only when task_status is SUCCEEDED. Link valid for 24 hours; video is MP4 (H.264) |
output.orig_prompt | string | Original prompt corresponding to request parameter prompt |
output.code | string | Error code; returned only on failure |
output.message | string | Error message; returned only on failure |
usage | object | Output statistics; returned only on success |
usage.input_video_duration | integer | Input reference video duration in seconds |
usage.output_video_duration | integer | Output video duration in seconds |
usage.duration | float | Billable total duration in seconds: input_video_duration + output_video_duration |
usage.SR | integer | Output resolution tier. Example: 720 |
usage.size | string | Output resolution in width*height format. Example: 1280*720 |
usage.video_count | integer | Number of output videos; always 1 |
request_id | string | Unique request ID for tracing and troubleshooting |
Error Handling
HTTP 400 Parameter Errors (blocked before submit; no charge)
AutoRouter validates required fields before forwarding upstream:
| Scenario | Response |
|---|---|
Missing input.prompt | {"code":"InvalidParameter","message":"...","request_id":"..."} |
Missing input.reference_urls or invalid asset count/combination | {"code":"InvalidParameter","message":"...","request_id":"..."} |
| Unknown model name | {"code":"InvalidParameter","message":"unknown model: ...","request_id":"..."} |
HTTP 401 / 403 Auth Errors
401 Unauthorized: Invalid or expired API Key403 Forbidden: API Key not allowed for this model (check token model whitelist)
HTTP 402 Insufficient Quota
Returns insufficient user quota. Please top up in the AutoRouter console.
Task FAILED Status
The task was submitted but upstream generation failed (output.task_status == "FAILED"). See output.code / output.message for details:
| Cause | Suggestion |
|---|---|
| Content moderation failed | Adjust the prompt; avoid sensitive content |
| Media URL unreachable | Ensure image/video URLs are publicly accessible and not expired |
| Media file out of spec | Follow image/video limits in Request Body |
| Too many assets | Images + videos ≤ 5; max 3 videos, max 5 images |
| Invalid parameter combination (e.g. size not in list, duration out of range) | Follow Request Body rules |
| Silent video without disabling audio | For silent output with wan2.6-r2v-flash, set parameters.audio = false |
When a task FAILED, AutoRouter automatically refunds to your account. Check refund records on the logs page.
Image-to-Video
Generate smooth video from a first-frame image and text prompt. Async task API: submit a request, receive a task_id, then poll for status to get the result.
Text-to-Video
Generate video from a text prompt. Async task API: submit a request, receive a task_id, then poll for status to get the result.