API DocsAI Model APIsVideosWan 2.6

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:

NameTypeRequiredDescription
modelstringYesModel name. Available values: wan2.6-r2v, wan2.6-r2v-flash
inputobjectYesBasic input such as the prompt and reference assets
input.promptstringYesText prompt describing elements and visual traits of the generated video. See details below
input.negative_promptstringNoNegative prompt describing content to avoid. Supports Chinese and English. Maximum 500 characters; excess is truncated
input.reference_urlsarray[string]YesArray of reference file URLs. Supports videos and images. See details below
parametersobjectNoVideo processing parameters such as resolution, duration, and shot type
parameters.sizestringNoOutput video resolution in width*height format (e.g. 1280*720); affects billing. See details below
parameters.durationintegerNoVideo duration in seconds (billed per second). Integer in [2, 10]. Default: 5
parameters.shot_typestringNoShot type. single (default) for a single continuous shot; multi for multiple shots. Takes priority over the prompt
parameters.audiobooleanNoWhether to generate audio. Supported only by wan2.6-r2v-flash. true (default) with audio; false silent. Pricing differs for audio vs silent
parameters.watermarkbooleanNoWhether to add a watermark (fixed text "AI生成" in the bottom-right corner). false (default) does not add it; true adds it
parameters.seedintegerNoRandom 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.

promptstring(Required)

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.

reference_urlsarray[string](Required)

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.

sizestring(Optional)

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: default 1920*1080 (1080P). Available resolutions: all 720P and 1080P options below.

720P tier:

ResolutionAspect ratio
1280*72016:9
720*12809:16
960*9601:1
1088*8324:3
832*10883:4

1080P tier:

ResolutionAspect ratio
1920*108016:9
1080*19209:16
1440*14401:1
1632*12484:3
1248*16323:4
durationinteger(Optional)

Output video duration in seconds (billed per second).

  • wan2.6-r2v-flash, wan2.6-r2v: integer in [2, 10]. Default: 5

Example: 5

shot_typestring(Optional)

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 shot
  • multi: multiple shots

Use this when you need strict narrative control (e.g. single shot for product demos, multi-shot for short stories).

audioboolean(Optional)

Whether to generate audio. Supported only by wan2.6-r2v-flash. Pricing differs for audio vs silent.

  • true: default, output with audio
  • false: silent video. When generating silent video, you must explicitly set parameters.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:

NameTypeDescription
outputobjectTask output
output.task_idstringTask ID for polling status; valid for 24 hours
output.task_statusstringTask status. Enum: PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN
request_idstringUnique request ID for tracing and troubleshooting
codestringError code; returned only on failure
messagestringError 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

NameTypeRequiredDescription
AuthorizationstringYesAuthentication. Format: Bearer sk-xxxxxx

Path Parameters

NameTypeRequiredDescription
task_idstringYesTask 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:

NameTypeDescription
outputobjectTask output
output.task_idstringTask ID; query validity 24 hours
output.task_statusstringTask status. Enum: PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN. Typical flow while polling: PENDINGRUNNINGSUCCEEDED / FAILED
output.submit_timestringSubmit time, format YYYY-MM-DD HH:mm:ss.SSS
output.scheduled_timestringScheduled execution time, format YYYY-MM-DD HH:mm:ss.SSS
output.end_timestringCompletion time, format YYYY-MM-DD HH:mm:ss.SSS
output.video_urlstringVideo download URL; returned only when task_status is SUCCEEDED. Link valid for 24 hours; video is MP4 (H.264)
output.orig_promptstringOriginal prompt corresponding to request parameter prompt
output.codestringError code; returned only on failure
output.messagestringError message; returned only on failure
usageobjectOutput statistics; returned only on success
usage.input_video_durationintegerInput reference video duration in seconds
usage.output_video_durationintegerOutput video duration in seconds
usage.durationfloatBillable total duration in seconds: input_video_duration + output_video_duration
usage.SRintegerOutput resolution tier. Example: 720
usage.sizestringOutput resolution in width*height format. Example: 1280*720
usage.video_countintegerNumber of output videos; always 1
request_idstringUnique request ID for tracing and troubleshooting

Error Handling

HTTP 400 Parameter Errors (blocked before submit; no charge)

AutoRouter validates required fields before forwarding upstream:

ScenarioResponse
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 Key
  • 403 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:

CauseSuggestion
Content moderation failedAdjust the prompt; avoid sensitive content
Media URL unreachableEnsure image/video URLs are publicly accessible and not expired
Media file out of specFollow image/video limits in Request Body
Too many assetsImages + 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 audioFor 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.

On this page