Documentation Index
Fetch the complete documentation index at: https://docs.laozhang.ai/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This page documents the Wan video generation API on LaoZhang. The API uses a DashScope-compatible asynchronous task flow: create a task, persist
task_id, poll task status, then download the MP4 from result_url after completion.Authentication
Create a dedicated token in Token Management:| Setting | Value |
|---|---|
| Console entry | Token Management → Create token |
| Group | Wan |
| Billing mode | Pay-as-you-go / pay-per-use |
| Header | Authorization: Bearer YOUR_API_KEY |
| Recommendation | Use a dedicated Wan token so task logs and billing records can be audited by model and task |
Flow
Create task
Send
POST /wan/api/v1/services/aigc/video-generation/video-synthesis with a JSON body. Set model to a Wan model ID, input.prompt to the prompt, and input.media[] for i2v, r2v, and video editing inputs.Poll status
Send
GET /v1/tasks/{task_id}. Client logic should branch on the top-level status field instead of upstream-specific nested fields.API Reference
Request Conventions
| Setting | Value |
|---|---|
| Base URL | https://api.laozhang.ai |
| Authentication | Authorization: Bearer YOUR_API_KEY |
| Create request format | application/json |
| Required create header | X-DashScope-Async: enable |
| Polling interval | 5-10 seconds recommended |
| Client timeout | 20 minutes recommended |
Endpoints
| Purpose | Method | Path |
|---|---|---|
| Create video task | POST | /wan/api/v1/services/aigc/video-generation/video-synthesis |
| Poll task status | GET | /v1/tasks/{task_id} |
| Download video | GET | result_url returned by a completed task |
Status Machine
| Status | Terminal | Client action |
|---|---|---|
submitted | No | Task accepted, continue polling |
in_progress | No | Generation is running, continue polling |
completed | Yes | Read result_url and download MP4 |
failed | Yes | Read error.message or fail_reason and stop polling |
Wan / DashScope progress is coarse-grained. It is normal for
progress to stay at 30% for a while and then jump to 100%.Models And Input Modes
| Model ID | Capability | Media input |
|---|---|---|
wan2.7-t2v | Text to video | Do not send media |
wan2.7-i2v | Image to video, optionally audio-driven | At least one first_frame; optional driving_audio |
wan2.7-r2v | Reference to video | One or more reference_image entries |
wan2.7-videoedit | Video editing | One video plus one or more reference_image entries |
wan2.6-t2v / wan2.6-i2v / wan2.6-r2v / wan2.6-r2v-flash | Wan 2.6 family | Same pattern as the matching Wan 2.7 capability |
happyhorse-1.0-t2v / happyhorse-1.0-i2v / happyhorse-1.0-r2v / happyhorse-1.0-video-edit | HappyHorse video models | Same pattern as the matching capability; media count depends on model limits |
Request Body
| Field | Type | Required | Notes |
|---|---|---|---|
model | string | Yes | Model ID, for example wan2.7-t2v |
input.prompt | string | Yes | Natural-language prompt |
input.media | array | Model-dependent | Omit for t2v; required for i2v, r2v, and video editing |
parameters.resolution | string | No | Common values: 480P, 720P, 1080P; use uppercase P |
parameters.duration | integer | No | Common values: 5 or 10; send an integer, not a string |
parameters.prompt_extend | boolean | No | Enables upstream prompt expansion |
parameters.watermark | boolean | No | Adds an AI-generated watermark |
parameters.seed | integer | No | Reproducibility seed; send an integer |
input.media[]
type | Purpose |
|---|---|
first_frame | First-frame image for image-to-video |
last_frame | Last-frame image, when supported by the selected model |
reference_image | Reference image for r2v or video editing |
driving_audio | Driving audio, commonly used with wan2.7-i2v |
video | Input video, commonly used with wan2.7-videoedit |
Environment Variables
Examples below use:Text To Video
Image To Video
Reference To Video
Video Editing
Poll And Download
status=completed and result_url. Client logic should rely on these top-level fields:
Minimal Python Client
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
未提供令牌 | Missing Authorization header | Send Authorization: Bearer $API_KEY |
Current group Wan has no available channels for model ... | Invalid model name or missing model route in the Wan group | Check the model ID or route configuration |
[InvalidParameter] Field required: input.media | Missing media for i2v/r2v/edit, or using the wrong /v1/videos endpoint | Use the Wan DashScope passthrough endpoint and send input.media[] |
任务不存在 | Wrong or expired task_id | Use the exact task_id returned by create |
| Download returns 403 | Signed result_url expired or extra auth header was sent | Re-poll the task for a fresh URL and download without Authorization |