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 fluent 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.7-t2v-2026-06-12",
"input": {
"prompt": "A tense detective chase story with cinematic storytelling. Shot 1 [0-3s] Wide: a rainy New York street at night, neon lights flickering, a detective in a black trench coat walking quickly. Shot 2 [3-6s] Medium: the detective enters an old building, rain soaking his coat, the door closing slowly behind him. Shot 3 [6-9s] Close-up: the detective's determined eyes, sirens in the distance, a slight frown as he thinks."
},
"parameters": {
"resolution": "720P",
"ratio": "16:9",
"prompt_extend": true,
"duration": 15
}
}Properties:
| Name | Type | Required | Description |
|---|---|---|---|
model | string | Yes | Model name. Available values: wan2.7-t2v, wan2.7-t2v-2026-06-12 |
input | object | Yes | Basic input such as the prompt |
input.prompt | string | Yes | 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. Control single/multi-shot via natural language (e.g. "generate a multi-shot video" or timestamped shot descriptions); shot_type is not needed |
input.negative_prompt | string | No | Negative prompt describing content to avoid. Supports Chinese and English. Maximum 500 characters; excess is truncated |
input.audio_url | string | No | Audio file URL used to generate the video. See details below |
parameters | object | No | Video processing parameters such as resolution, aspect ratio, and prompt rewriting |
parameters.resolution | string | No | Resolution tier controlling clarity (total pixels); affects billing. Available values: 720P, 1080P (default) |
parameters.ratio | string | No | Aspect ratio of the generated video. 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.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 audio.
Audio file URL. The model uses this audio to generate the video.
Supported input formats:
- Public URL:
- Supports HTTP and HTTPS.
- Example:
https://help-static-aliyun-doc.aliyuncs.com/xxx.mp3.
- Temporary URL:
- Supports the OSS protocol. Obtain it via uploading a file to get a temporary URL.
- Example:
oss://dashscope-instant/xxx/xxx.mp3.
Audio limits:
- Format: wav, mp3.
- Duration: 2–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, aspect ratio, and prompt rewriting.
Aspect ratio of the generated video.
16:9(default)9:161:14:33:4
See the table below for output resolutions (width × height) for each aspect ratio.
| Resolution tier | Aspect ratio | Output resolution (W*H) |
|---|---|---|
| 720P | 16:9 | 1280*720 |
| 9:16 | 720*1280 | |
| 1:1 | 960*960 | |
| 4:3 | 1104*832 | |
| 3:4 | 832*1104 | |
| 1080P | 16:9 | 1920*1080 |
| 9:16 | 1080*1920 | |
| 1:1 | 1440*1440 | |
| 4:3 | 1648*1248 | |
| 3:4 | 1248*1648 |
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-t2v-2026-06-12",
"input": {
"prompt": "A tense detective chase story with cinematic storytelling. Shot 1 [0-3s] Wide: a rainy New York street at night, neon lights flickering, a detective in a black trench coat walking quickly. Shot 2 [3-6s] Medium: the detective enters an old building, rain soaking his coat, the door closing slowly behind him. Shot 3 [6-9s] Close-up: the detective's determined eyes, sirens in the distance, a slight frown as he thinks."
},
"parameters": {
"resolution": "720P",
"ratio": "16:9",
"prompt_extend": true,
"duration": 15
}
}'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": "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": "A tense detective chase story with cinematic storytelling...",
"video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
},
"usage": {
"duration": 10,
"input_video_duration": 0,
"output_video_duration": 10,
"video_count": 1,
"ratio": "16:9",
"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.duration | float | Total output video duration for billing. duration = output_video_duration |
usage.input_video_duration | integer | Always 0 |
usage.output_video_duration | integer | Output video duration in seconds, equal to the request duration |
usage.SR | integer | Resolution tier of the generated video |
usage.ratio | string | Aspect ratio of the generated video |
usage.video_count | integer | Number of generated 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.prompt | {"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 |
| Audio URL unreachable or invalid format | Ensure audio_url is publicly accessible and format is wav/mp3 |
| 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.
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.
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.