Image-to-Video
Supports first-frame, first-and-last-frame, and video continuation. Async task API: submit a request, receive a task_id, then poll for status to get the result.
Supports multimodal input (text / image / audio / video) for three tasks: first-frame video, first-and-last-frame video, and video continuation. 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 media assets and an optional text prompt.
The request header must include X-DashScope-Async: enable.
Request Body
Content-Type: application/json
Example:
{
"model": "wan2.7-i2v-2026-04-25",
"input": {
"prompt": "An urban fantasy art scene. A dynamic graffiti character. A boy painted in spray paint comes alive from a concrete wall. He raps in English at high speed while striking a classic, energetic hip-hop pose. The scene is set under a city railway bridge at night. Light comes from a lone street lamp, creating a cinematic atmosphere full of high energy and incredible detail. The audio is entirely rap, with no other dialogue or noise.",
"media": [
{
"type": "first_frame",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
},
{
"type": "driving_audio",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
}
]
},
"parameters": {
"resolution": "720P",
"duration": 10,
"prompt_extend": true,
"watermark": true
}
}Properties:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name. Available values: wan2.7-i2v, wan2.7-i2v-2026-04-25 |
input | object | Yes | Basic input such as the prompt and media assets |
input.prompt | string | No | Text prompt describing elements and visual traits of the generated video. Supports Chinese and English; each character counts as one; excess is truncated. Maximum 5,000 characters |
input.negative_prompt | string | No | Negative prompt describing content to avoid. Supports Chinese and English. Maximum 500 characters; excess is truncated |
input.media | array | Yes | Media asset list for reference materials (image, audio, and video). See details below |
input.media[].type | string | Yes | Media type. Available values: first_frame, last_frame, driving_audio, first_clip. Each type may appear at most once in media |
input.media[].url | string | Yes | Media asset URL. Assets include images, audio, and video. See details below |
parameters | object | No | Video processing parameters such as resolution, duration, and prompt rewriting |
parameters.resolution | string | No | Resolution tier controlling clarity (total pixels); affects billing. The model scales to a nearby total-pixel target; keep the aspect ratio close to the input asset (first frame or first clip). Available values: 720P, 1080P (default) |
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.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 media assets.
Media asset list for the reference materials needed for video generation (images, audio, and video). Each array element is a media object with type and url fields.
Responses
200: Task created successfully
Content-Type: application/json
400: Bad request / invalid parameters
Content-Type: application/json
429: Rate limit exceeded
Content-Type: application/json
Request Example
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.7-i2v-2026-04-25",
"input": {
"prompt": "An urban fantasy art scene. A dynamic graffiti character. A boy painted in spray paint comes alive from a concrete wall. He raps in English at high speed while striking a classic, energetic hip-hop pose. The scene is set under a city railway bridge at night. Light comes from a lone street lamp, creating a cinematic atmosphere full of high energy and incredible detail. The audio is entirely rap, with no other dialogue or noise.",
"media": [
{
"type": "first_frame",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
},
{
"type": "driving_audio",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
}
]
},
"parameters": {
"resolution": "720P",
"duration": 10,
"prompt_extend": true,
"watermark": true
}
}'Response Example
{
"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 (queued), RUNNING (processing), SUCCEEDED (success), FAILED (failed), CANCELED (canceled), UNKNOWN (missing or unknown) |
request_id | string | Unique request ID for tracing and troubleshooting |
code | string | Error code. Returned only when the request fails |
message | string | Error message. Returned only when the request fails |
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. Queries are valid for 24 hours.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
Authorization | string | Yes | Request 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: Bad request / invalid parameters
Content-Type: application/json
429: Rate limit exceeded
Content-Type: application/json
Request Example
curl -X GET "https://api.autorouter.top/api/v1/tasks/{task_id}" \
-H "Authorization: Bearer sk-xxxxxx"Response Example
{
"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 character...",
"video_url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.mp4?Expires=xxx"
},
"usage": {
"duration": 15,
"input_video_duration": 0,
"output_video_duration": 15,
"video_count": 1,
"SR": 720
}
}Response fields:
| Name | Type | Description |
|---|---|---|
output | object | Task output |
output.task_id | string | Task ID. Valid for queries for 24 hours |
output.task_status | string | Task status. Enum: PENDING (queued), RUNNING (processing), SUCCEEDED (success), FAILED (failed), CANCELED (canceled), UNKNOWN (missing or unknown). Typical poll flow: PENDING → RUNNING → SUCCEEDED / FAILED |
output.submit_time | string | Task submission time, format YYYY-MM-DD HH:mm:ss.SSS |
output.scheduled_time | string | Task execution time, format YYYY-MM-DD HH:mm:ss.SSS |
output.end_time | string | Task 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 the request prompt |
output.code | string | Error code. Returned only when the task fails |
output.message | string | Error message. Returned only when the task fails |
usage | object | Output statistics. Returned only on success |
usage.input_video_duration | integer | Input video duration in seconds. 0 when not using video continuation |
usage.output_video_duration | integer | Output video duration in seconds |
usage.duration | integer | Total billed video duration in seconds: input_video_duration + output_video_duration |
usage.SR | integer | Resolution tier of the output video. Example: 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 (pre-submit validation, no billing)
AutoRouter validates required fields before submitting upstream:
| Scenario | Response |
|---|---|
Missing input.media or illegal media combination | {"code":"InvalidParameter","message":"...","request_id":"..."} |
| Unknown model | {"code":"InvalidParameter","message":"unknown model: ...","request_id":"..."} |
HTTP 401 / 403 Auth Errors
401 Unauthorized: API Key invalid or expired403 Forbidden: API Key has no access to this model (check token's model allowlist)
HTTP 402 Insufficient Balance
Returns insufficient user quota. Top up at the AutoRouter console.
Task FAILED Status
The task was accepted but upstream generation failed (output.task_status == "FAILED"). See output.code / output.message for details:
| Reason | Suggested Action |
|---|---|
| Content moderation | Adjust prompt to avoid sensitive content |
| Media URL unreachable | Ensure image/audio/video URLs are publicly accessible and not expired |
| Media file out of spec | Follow image, audio, and video limits in Request Body |
| Illegal media combination | Use only the documented valid media combinations |
| Illegal parameter combo | Follow the Request Body specification |
When a task enters FAILED, AutoRouter automatically refunds the billed quota. Check refund records in the logs page.
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, audio). Async task API: submit a request, receive a task_id, then poll for status to get the result.