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:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name. Available values: wan2.6-i2v, wan2.6-i2v-flash |
input | object | Yes | Basic input such as the prompt and first-frame image |
input.prompt | string | No | 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.img_url | string | Yes | First-frame image URL or Base64-encoded data. See details below |
input.audio_url | string | No | Audio file URL used to drive video generation. See details below |
parameters | object | No | Video processing parameters such as resolution, duration, and shot type |
parameters.resolution | string | No | Resolution tier controlling video clarity (total pixels); affects billing. See details below |
parameters.duration | integer | No | Video duration in seconds (billed per second). Integer in [2, 15]. Default: 5 |
parameters.prompt_extend | boolean | No | Whether to enable smart prompt rewriting. Improves short prompts but increases latency. true (default) enables it; false disables it |
parameters.shot_type | string | No | Shot 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.audio | boolean | No | Whether to generate audio. Supported only by wan2.6-i2v-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 first-frame image.
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.
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 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 firstdurationseconds 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.
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 values720P,1080P. Default:1080P.
Example: 720P
Output video duration in seconds (billed per second).
wan2.6-i2v-flash,wan2.6-i2v: integer in[2, 15]. Default:5
Example: 5
Whether to enable smart prompt rewriting. Improves results for short prompts but increases latency.
true: default; enable rewritingfalse: disable rewriting
Note: For wan2.6 models, actual_prompt is never returned in the query result, regardless of prompt_extend.
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 shotmulti: 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).
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 audiofalse: silent output. To generate a 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 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:
| Name | Type | Description |
|---|---|---|
output | object | Task output |
output.task_id | string | Task ID for status queries; 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: 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 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:
| Name | Type | Description |
|---|---|---|
output | object | Task output |
output.task_id | string | Task ID; valid for 24 hours |
output.task_status | string | Task status. Enum: PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, UNKNOWN. Typical flow: PENDING → RUNNING → SUCCEEDED / FAILED |
output.submit_time | string | Submit time, format YYYY-MM-DD HH:mm:ss.SSS |
output.scheduled_time | string | Execution start 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. Valid for 24 hours; MP4 (H.264) |
output.orig_prompt | string | Original prompt from the request |
output.code | string | Error code; returned only on failure |
output.message | string | Error message; returned only on failure |
usage | object | Usage stats; returned only on success |
usage.input_video_duration | integer | Input video duration in seconds. Always 0 for image-to-video (no video input) |
usage.output_video_duration | integer | Output video duration in seconds; equals request duration |
usage.duration | integer | Billable total duration in seconds: input_video_duration + output_video_duration |
usage.SR | integer | Output resolution tier. Example: 720 |
usage.video_count | integer | Number of output videos; always 1 |
usage.audio | boolean | Whether the output has audio. Returned only for wan2.6-i2v-flash |
request_id | string | Unique request ID for tracing and troubleshooting |
Error Handling
HTTP 400 Invalid Parameters (blocked before upstream; no charge)
AutoRouter validates required fields before submitting upstream:
| Scenario | Response |
|---|---|
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 Key403 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:
| Cause | Suggestion |
|---|---|
| Content moderation failed | Adjust the prompt; avoid sensitive content |
| Image / audio URL unreachable | Ensure URLs are publicly accessible and not expired |
| Media does not meet specs | See 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 applied | Ensure both prompt_extend=true and shot_type=multi |
| Silent video without explicit audio=false | For 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.
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.
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.