API DocsAI Model APIsVideosWan 2.6

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.

Generate a smooth video from a text prompt. Supports multi-shot narrative, custom audio, and auto dubbing. Up to 15 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 a text prompt.

The request header must include X-DashScope-Async: enable.

Request Body

Content-Type: application/json

Example:

{
  "model": "wan2.6-t2v",
  "input": {
    "prompt": "An epic yet adorable scene. A tiny cute cartoon kitten general in finely detailed golden armor and a slightly oversized helmet stands bravely on a cliff. He rides a small but heroic warhorse and says: \"Qinghai Changyun An Xueshan, Gucheng Yaowang Yumen Guan. Huangsha Baizhan Chuan Jinjia, Bupo Loulan Zhong Bu Huan.\" Below the cliff, an endless army of mice charges forward with makeshift weapons. A dramatic large-scale battle inspired by ancient Chinese war epics. Over distant snowy mountains, the sky is heavy with dark clouds. The overall mood blends cuteness with grandeur in a humorous, epic way.",
    "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250923/hbiayh/%E4%BB%8E%E5%86%9B%E8%A1%8C.mp3"
  },
  "parameters": {
    "size": "1280*720",
    "prompt_extend": true,
    "duration": 10,
    "shot_type": "multi"
  }
}

Properties:

NameTypeRequiredDescription
modelstringYesModel name. Available values: wan2.6-t2v, wan2.6-t2v-us
inputobjectYesBasic input such as the prompt and audio
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.audio_urlstringNoAudio file URL used to drive video generation. 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). See details below
parameters.prompt_extendbooleanNoWhether to enable smart prompt rewriting. See details below
parameters.shot_typestringNoShot type. single (default) for a single continuous shot; multi for multiple shots. See details below
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 audio.

promptstring(Required)

Text prompt describing elements and visual traits of the generated video.

Supports Chinese and English. Each Chinese character or letter counts as one character; excess is truncated.

  • wan2.6-t2v, wan2.6-t2v-us: maximum 1500 characters.

Example: A kitten runs under the moonlight.

audio_urlstring(Optional)

Audio file URL. The model uses this audio to generate the video.

  • With audio: The model uses this audio as the driving source.
  • Without audio: The model auto-generates matching background music or sound effects based on the video content.

Supported input formats:

  1. Public URL: HTTP or HTTPS. Example: https://help-static-aliyun-doc.aliyuncs.com/xxx.mp3
  2. Temporary URL: OSS protocol; obtain via temporary file URL upload. Example: oss://dashscope-instant/xxx/xxx.mp3

Audio limits:

  • Format: wav, mp3
  • Duration: 3–30s
  • File size: Max 15MB
  • Overflow handling: If the audio is longer than duration (e.g. 5 seconds), only the first 5 seconds are kept and the rest is discarded. If the audio is shorter than the video duration, the remaining part is silent. For example, with 3s audio and 5s video, the first 3 seconds have sound and the last 2 seconds are silent

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-t2v, wan2.6-t2v-us: 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-t2v: integer in [2, 15]. Default: 5
  • wan2.6-t2v-us: 5 or 10. Default: 5

Example: 5

prompt_extendboolean(Optional)

Whether to enable smart prompt rewriting. Improves short prompts but increases latency.

  • true: default, enable rewriting
  • false: disable rewriting

When using multi-shot (shot_type: "multi"), this must be set to true.

shot_typestring(Optional)

Specifies whether the video is a single continuous shot or multiple switching shots.

  • single: default, single continuous shot
  • multi: multiple shots

Effective only when prompt_extend is true.

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.

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-t2v",
  "input": {
    "prompt": "An epic yet adorable scene. A tiny cute cartoon kitten general in finely detailed golden armor and a slightly oversized helmet stands bravely on a cliff. He rides a small but heroic warhorse and says: \"Qinghai Changyun An Xueshan, Gucheng Yaowang Yumen Guan. Huangsha Baizhan Chuan Jinjia, Bupo Loulan Zhong Bu Huan.\" Below the cliff, an endless army of mice charges forward with makeshift weapons. A dramatic large-scale battle inspired by ancient Chinese war epics. Over distant snowy mountains, the sky is heavy with dark clouds. The overall mood blends cuteness with grandeur in a humorous, epic way.",
    "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250923/hbiayh/%E4%BB%8E%E5%86%9B%E8%A1%8C.mp3"
  },
  "parameters": {
    "size": "1280*720",
    "prompt_extend": true,
    "duration": 10,
    "shot_type": "multi"
  }
}'

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-09-29 14:18:52.331",
    "scheduled_time": "2025-09-29 14:18:59.290",
    "end_time": "2025-09-29 14:23:39.407",
    "orig_prompt": "An epic yet adorable scene. A tiny cute cartoon kitten general stands bravely on a cliff.",
    "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
  },
  "usage": {
    "duration": 10,
    "size": "1280*720",
    "input_video_duration": 0,
    "output_video_duration": 10,
    "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. Polling flow: PENDINGRUNNINGSUCCEEDED / FAILED. First queries are usually PENDING or RUNNING; when status becomes SUCCEEDED, the response includes the video URL; if FAILED, check the error and retry; if CANCELED, the task was canceled and must be resubmitted; if UNKNOWN, the task does not exist or its status is unknown (e.g. invalid task_id or past the 24-hour validity window)
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; downloadable MP4 (H.264)
output.orig_promptstringOriginal input prompt corresponding to request parameter prompt
output.actual_promptstringWhen prompt_extend=true, the system rewrites the input prompt and this field returns the optimized prompt actually used for generation; if prompt_extend=false, this field is omitted. Note: wan2.6 models never return this field regardless of prompt_extend
output.codestringError code; returned only on failure
output.messagestringError message; returned only on failure
usageobjectOutput statistics; counted only for successful results
usage.video_durationintegerReturned only for wan2.5 and earlier models; used for billing. Generated video duration in seconds. Enum: 5, 10
usage.durationfloatReturned only for wan2.6 models; used for billing. Total video duration where duration = input_video_duration + output_video_duration
usage.input_video_durationintegerReturned only for wan2.6 models. Always 0
usage.output_video_durationintegerReturned only for wan2.6 models. Output video duration in seconds; equals request parameter duration
usage.SRintegerReturned only for wan2.6 models. Output resolution tier. Example: 720
usage.sizestringReturned only for wan2.6 models. Output resolution in width*height format. Example: 1920*1080
usage.video_ratiostringReturned only for wan2.5 and earlier models. Output resolution in width*height format. Example: 832*480
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":"..."}
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
Audio URL unreachableEnsure audio_url is publicly accessible and not expired
Audio file out of specFollow audio limits in Request Body (format, duration, size)
Invalid parameter combination (e.g. size not in list, duration out of range)Follow Request Body rules
Multi-shot without prompt rewritingWhen using shot_type: "multi", set prompt_extend: true

When a task FAILED, AutoRouter automatically refunds to your account. Check refund records on the logs page.

On this page