API DocsAI Model APIsVideosWan 2.6

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.

Generate a smooth video from a first-frame image and a text prompt. Supports auto soundtrack, custom audio input, and multi-shot storytelling. 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 first-frame image and text prompt.

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

Request Body

Content-Type: application/json

Example:

{
  "model": "wan2.6-i2v-flash",
  "input": {
    "prompt": "An urban fantasy art scene. A dynamic graffiti art character — a teenage boy painted in spray paint — comes alive from a concrete wall. He raps in rapid-fire English while striking a classic, energetic hip-hop pose. The scene is set under a railway bridge at night. Light comes from a lone street lamp, creating a cinematic atmosphere full of high energy and striking detail. The audio consists entirely of his rap, with no other dialogue or noise.",
    "img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png",
    "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
  },
  "parameters": {
    "resolution": "720P",
    "prompt_extend": true,
    "duration": 10,
    "shot_type": "multi",
    "watermark": true
  }
}

Properties:

NameTypeRequiredDescription
modelstringYesModel name. Available values: wan2.6-i2v, wan2.6-i2v-flash
inputobjectYesBasic input such as the prompt and first-frame image
input.promptstringNoText 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.img_urlstringYesFirst-frame image URL or Base64-encoded data. See details below
input.audio_urlstringNoAudio file URL used to drive video generation. See details below
parametersobjectNoVideo processing parameters such as resolution, duration, and shot type
parameters.resolutionstringNoResolution tier controlling video clarity (total pixels); affects billing. See details below
parameters.durationintegerNoVideo duration in seconds (billed per second). Integer in [2, 15]. Default: 5
parameters.prompt_extendbooleanNoWhether to enable smart prompt rewriting. Improves short prompts but increases latency. true (default) enables it; false disables it
parameters.shot_typestringNoShot type. Supported only by wan2.6 series, and only when prompt_extend=true. 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-i2v-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 first-frame image.

promptstring(Optional)

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-i2v, wan2.6-i2v-flash: maximum 1500 characters.

Example: A kitten running on the grass.

img_urlstring(Required)

First-frame image URL or Base64-encoded data. The model generates video based on this image; the output aspect ratio will try to match the input image.

Image constraints:

  • Format: JPEG, JPG, PNG (no transparency), BMP, WEBP
  • Resolution: Width and height must be in [240, 8000] pixels
  • File size: Maximum 20MB

audio_urlstring(Optional)

Audio file URL used to drive video generation (e.g. lip sync, background music).

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

Audio constraints:

  • Format: wav, mp3
  • Duration: 3s–30s
  • File size: Maximum 15MB
  • Overflow handling: If audio is longer than duration, only the first duration seconds are used. If audio is shorter than the video, the remainder is silent. Example: 3s audio with 5s video → first 3s with audio, last 2s silent.

parametersobject(Optional)

Video processing parameters such as resolution, duration, and shot type.

resolutionstring(Optional)

Resolution tier controlling video clarity (total pixels). Affects billing.

The model scales to a nearby total pixel count for the selected tier. The output aspect ratio will try to match the input image img_url.

  • wan2.6-i2v-flash, wan2.6-i2v: available values 720P, 1080P. Default: 1080P.

Example: 720P

durationinteger(Optional)

Output video duration in seconds (billed per second).

  • wan2.6-i2v-flash, wan2.6-i2v: integer in [2, 15]. Default: 5

Example: 5

prompt_extendboolean(Optional)

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

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

Note: For wan2.6 models, actual_prompt is never returned in the query result, regardless of prompt_extend.

shot_typestring(Optional)

Shot type: a single continuous shot or multiple cuts. Supported only by the wan2.6 series.

Takes effect only when prompt_extend=true.

Priority: shot_type > prompt. If shot_type is single, the model outputs a single-shot video even if the prompt asks for multi-shot.

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

To enable multi-shot storytelling, set both prompt_extend=true and shot_type=multi.

Use this parameter 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-i2v-flash. Pricing differs for audio vs silent.

Priority: audio > audio_url. When audio=false, the output is silent even if audio_url is provided, and billing uses the silent rate.

  • true: default; output with audio
  • false: silent output. To generate a 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 limited

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-i2v-flash",
  "input": {
    "prompt": "An urban fantasy art scene. A dynamic graffiti art character — a teenage boy painted in spray paint — comes alive from a concrete wall. He raps in rapid-fire English while striking a classic, energetic hip-hop pose. The scene is set under a railway bridge at night. Light comes from a lone street lamp, creating a cinematic atmosphere full of high energy and striking detail. The audio consists entirely of his rap, with no other dialogue or noise.",
    "img_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png",
    "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
  },
  "parameters": {
    "resolution": "720P",
    "prompt_extend": true,
    "duration": 10,
    "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 status queries; 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: 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 limited

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": "2ca1c497-f9e0-449d-9a3f-xxxxxx",
  "output": {
    "task_id": "af6efbc0-4bef-4194-8246-xxxxxx",
    "task_status": "SUCCEEDED",
    "submit_time": "2025-09-25 11:07:28.590",
    "scheduled_time": "2025-09-25 11:07:35.349",
    "end_time": "2025-09-25 11:17:11.650",
    "orig_prompt": "An urban fantasy art scene. A dynamic graffiti art character — a teenage boy painted in spray paint — comes alive from a concrete wall. He raps in rapid-fire English while striking a classic, energetic hip-hop pose. The scene is set under a railway bridge at night. Light comes from a lone street lamp, creating a cinematic atmosphere full of high energy and striking detail. The audio consists entirely of his rap, with no other dialogue or noise.",
    "video_url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.mp4?Expires=xxx"
  },
  "usage": {
    "duration": 10,
    "input_video_duration": 0,
    "output_video_duration": 10,
    "video_count": 1,
    "SR": 720,
    "audio": true
  }
}

Response fields:

NameTypeDescription
outputobjectTask output
output.task_idstringTask ID; valid for 24 hours
output.task_statusstringTask status. Enum: PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN. Typical flow: PENDINGRUNNINGSUCCEEDED / FAILED
output.submit_timestringSubmit time, format YYYY-MM-DD HH:mm:ss.SSS
output.scheduled_timestringExecution start 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. Valid for 24 hours; MP4 (H.264)
output.orig_promptstringOriginal prompt from the request
output.codestringError code; returned only on failure
output.messagestringError message; returned only on failure
usageobjectUsage stats; returned only on success
usage.input_video_durationintegerInput video duration in seconds. Always 0 for image-to-video (no video input)
usage.output_video_durationintegerOutput video duration in seconds; equals request duration
usage.durationintegerBillable total duration in seconds: input_video_duration + output_video_duration
usage.SRintegerOutput resolution tier. Example: 720
usage.video_countintegerNumber of output videos; always 1
usage.audiobooleanWhether the output has audio. Returned only for wan2.6-i2v-flash
request_idstringUnique request ID for tracing and troubleshooting

Error Handling

HTTP 400 Invalid Parameters (blocked before upstream; no charge)

AutoRouter validates required fields before submitting upstream:

ScenarioResponse
Missing input.img_url{"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 model whitelist)

HTTP 402 Insufficient Balance

Returns insufficient user quota. Top up in the AutoRouter console.

Task FAILED Status

The task was accepted but upstream generation failed (output.task_status == "FAILED"). See output.code / output.message:

CauseSuggestion
Content moderation failedAdjust the prompt; avoid sensitive content
Image / audio URL unreachableEnsure URLs are publicly accessible and not expired
Media does not meet specsSee image and audio constraints in Request Body
Invalid parameter combo (e.g. resolution not allowed, duration out of range)Follow Request Body rules
Multi-shot not appliedEnsure both prompt_extend=true and shot_type=multi
Silent video without explicit audio=falseFor wan2.6-i2v-flash, set parameters.audio = false for silent output

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

On this page