Model Information
| Model ID | alibaba/wan-3.0/text-to-video |
| Category | Video |
| Endpoint | /api/v1/videos |
Create Task
POST https://mogu.io/api/v1/videosAuthentication: Authorization: Bearer <api-key>
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | ✓ | Model ID: alibaba/wan-3.0/text-to-video | |
| seed | number (-1..2147483647) | -1 | Random seed (-1 for random) | |
| prompt | string | ✓ | Describe the scene, subjects, motion and camera movement | |
| duration | number (2..30) | 5 | Output duration in whole seconds (2 to 30) | |
| resolution | enum: 480p | 720p | 1080p | "720p" | Output video resolution | |
| aspect_ratio | enum: 16:9 | 9:16 | 1:1 | 4:3 | 3:4 | "16:9" | Output aspect ratio | |
| enable_prompt_expansion | boolean | false | Enable automatic prompt expansion |
Code Examples
# Step 1: Create task
curl -X POST https://mogu.io/api/v1/videos \
-H "Authorization: Bearer <api-key>" \
-H "Content-Type: application/json" \
-d '{
"model": "alibaba/wan-3.0/text-to-video",
"seed": -1,
"prompt": "Your prompt here",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "16:9",
"enable_prompt_expansion": false
}'
# Step 2: Poll for result
curl https://mogu.io/api/v1/videos/{task-id} \
-H "Authorization: Bearer <api-key>"Response
Create Response (202)
{
"id": "task-uuid",
"status": "pending",
"polling_url": "/api/v1/videos/task-uuid"
}Poll: GET https://mogu.io/api/v1/videos/:id — Completed
{
"id": "task-uuid",
"status": "completed",
"output": {
"urls": [
"https://cdn.example.com/video.mp4"
]
},
"credit": 4000
}Poll every 3-5 seconds. Status values: pending → in_progress → completed | failed
Error Codes
| HTTP | Type | Description |
|---|---|---|
| 400 | invalid_request_error | Invalid parameters |
| 400 | content_moderation | Content blocked by safety system |
| 400 | input_too_large | Input exceeds model limit |
| 401 | auth_error | Invalid API key |
| 402 | insufficient_credits | Not enough credits |
| 429 | rate_limit_error | Too many requests |
| 502 | provider_error | Upstream error, retry later |
| 504 | timeout_error | Request timed out |