Wan 3.0 Video Generation
Create and poll Wan 3.0 video tasks through either the ModelSell generic video format or the native Alibaba Cloud Model Studio format.
Wan 3.0 is an asynchronous video model for text-to-video, first-frame and first/last-frame generation, reference-based generation, video editing and extension, and generation from a file or public web page. ModelSell supports both its generic video format and the native Wan 3.0 request format.
The fields and limits on this page follow the official Alibaba Cloud Model Studio Wan 3.0 API reference. ModelSell-specific behavior, including public task IDs and generic-field conversion, is called out separately.
Supported Models
| Model | Description |
|---|---|
wan3.0-video-prime | Faster edition with the same capabilities as the standard edition |
wan3.0-video | Standard edition |
Wan 3.0 produces 30 fps video and supports output durations of up to 30 seconds.
Choose a Request Format
| Format | Create task | Poll task | Best for |
|---|---|---|---|
| ModelSell generic | POST /v1/video/generations | GET /v1/video/generations/{task_id} | Applications sharing one request shape across multiple video providers |
| Wan 3.0 native | POST /api/v1/services/aigc/video-generation/video-synthesis | GET /api/v1/tasks/{task_id} | Existing Model Studio integrations or applications that need every native Wan parameter |
Both formats use your ModelSell base URL and ModelSell API key:
export MODELSELL_BASE_URL="https://api.modelsell.com"
export MODELSELL_API_KEY="sk-..."For a proxy domain or test environment, replace only MODELSELL_BASE_URL and keep the paths unchanged. Do not use the upstream Alibaba Cloud URL containing {WorkspaceId} as the ModelSell client URL.
Server administrators should configure an Ali channel with the Model Studio API key. API clients select the model and do not send a channel type.
The same generic JSON is also accepted by POST /v1/videos, with polling at GET /v1/videos/{task_id}. This guide consistently uses /v1/video/generations; keep the create and poll path families paired.
ModelSell Generic Format
The generic format is designed for applications that switch among different video models. prompt is required by the generic endpoint.
Field Mapping
| Generic field | Native Wan 3.0 field | Notes |
|---|---|---|
model | model | Supports both Wan 3.0 models |
prompt | input.prompt | Required in the generic format |
image, or the first item in images[] | A first_frame item in input.media | Strict first frame |
The second item in images[] | A last_frame item in input.media | Strict last frame |
reference_images[].url | reference_image items in input.media | Up to 10 images |
video.url | A reference_video item in input.media | Up to five clips, 15 seconds total |
size | parameters.resolution | 480P, 720P, or 1080P; lowercase input is normalized |
seconds or duration | parameters.duration | seconds takes precedence |
metadata.input.media | Replaces all media shortcuts | Use for reference audio, files, links, or exact media typing |
metadata.parameters | parameters | Passes all native Wan generation parameters |
When metadata.input.media is non-empty, ModelSell does not merge in image, images[], reference_images, or video. Put every media item in metadata.input.media when combining multiple media types.
Text to Video
curl -X POST "$MODELSELL_BASE_URL/v1/video/generations" \
-H "Authorization: Bearer $MODELSELL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan3.0-video-prime",
"prompt": "A kitten runs across a rooftop under moonlight while city neon glows in the distance, cinematic lighting and smooth camera motion",
"size": "720P",
"duration": 5,
"metadata": {
"parameters": {
"ratio": "16:9",
"audio": true,
"seed": 7,
"prompt_extend": true,
"watermark": false
}
}
}'First and Last Frames
The first two entries in images[] map to first_frame and last_frame:
{
"model": "wan3.0-video",
"prompt": "A young woman changes from a smile to laughter as the camera moves closer and the background shifts from cool to warm light",
"images": [
"https://example.com/first-frame.png",
"https://example.com/last-frame.png"
],
"size": "480P",
"seconds": "5",
"metadata": {
"parameters": {
"ratio": "adaptive",
"audio": false,
"prompt_extend": true,
"watermark": false
}
}
}Reference Images and Video
{
"model": "wan3.0-video",
"prompt": "The person in Video 1 picks up the fan from Image 1 and slowly turns in the courtyard",
"reference_images": [
{
"url": "https://example.com/fan.png"
}
],
"video": {
"url": "https://example.com/character.mp4"
},
"duration": 5,
"metadata": {
"parameters": {
"resolution": "720P",
"ratio": "adaptive",
"audio": true,
"seed": 0,
"prompt_extend": false,
"watermark": false
}
}
}Full Native Media Support
The generic format has no dedicated shortcut for reference audio, files, or web pages. Use metadata.input.media to access every official media type. Explicit false and 0 values in metadata.parameters are preserved:
{
"model": "wan3.0-video",
"prompt": "Create a product video using the motion from Video 1, the outfit from Image 1, and the rhythm from Audio 1",
"metadata": {
"input": {
"media": [
{
"type": "reference_image",
"url": "https://example.com/outfit.png"
},
{
"type": "reference_video",
"url": "https://example.com/motion.mp4"
},
{
"type": "reference_audio",
"url": "https://example.com/music.mp3"
}
]
},
"parameters": {
"resolution": "1080P",
"ratio": "16:9",
"duration": 10,
"audio": true,
"seed": 0,
"prompt_extend": false,
"watermark": false
}
}
}For file-based generation, use {"type":"file","url":"https://example.com/product.pdf"}. For a public page, use {"type":"link","url":"https://example.com/article"}. file and link cannot appear together.
Generic Response and Polling
Store the public id or task_id returned by ModelSell:
{
"id": "task_xxxxxxxxxxxxxxxx",
"task_id": "task_xxxxxxxxxxxxxxxx",
"object": "video",
"status": "queued",
"model": "wan3.0-video-prime",
"progress": 0,
"created_at": 1787932800
}Poll with that same public task ID:
curl "$MODELSELL_BASE_URL/v1/video/generations/task_xxxxxxxxxxxxxxxx" \
-H "Authorization: Bearer $MODELSELL_API_KEY"On success, read the final video URL from metadata.url. Timing, prompt, and usage fields are also returned in metadata:
{
"id": "task_xxxxxxxxxxxxxxxx",
"task_id": "task_xxxxxxxxxxxxxxxx",
"object": "video",
"status": "completed",
"model": "wan3.0-video-prime",
"seconds": "5",
"video_url": "https://example.com/wan3-result.mp4",
"metadata": {
"url": "https://example.com/wan3-result.mp4",
"request_id": "request_xxxxxxxxxxxxxxxx",
"orig_prompt": "A kitten runs across a rooftop under moonlight",
"usage": {
"video_count": 1,
"duration": 5.0,
"input_video_duration": 0.0,
"output_video_duration": 5.0,
"fps": 30,
"SR": 720,
"ratio": "16:9"
}
}
}Generic task states are queued, in_progress, completed, and failed.
Wan 3.0 Native Format
The native endpoint keeps the official Model Studio request body, task states, and response fields. Existing native clients can change their base URL and API key to ModelSell.
The upstream API requires X-DashScope-Async: enable on task creation. ModelSell adds this header to the upstream request automatically, so clients may omit it. Existing official clients may keep it.
Create a Task
curl -X POST "$MODELSELL_BASE_URL/api/v1/services/aigc/video-generation/video-synthesis" \
-H "Authorization: Bearer $MODELSELL_API_KEY" \
-H "Content-Type: application/json" \
-H "X-DashScope-Async: enable" \
-d '{
"model": "wan3.0-video",
"input": {
"prompt": "The person in Video 1 wears the coat from Image 1 and walks through the street to the rhythm of Audio 1",
"media": [
{
"type": "reference_image",
"url": "https://example.com/coat.png"
},
{
"type": "reference_video",
"url": "https://example.com/walk.mp4"
},
{
"type": "reference_audio",
"url": "https://example.com/beat.mp3"
}
]
},
"parameters": {
"resolution": "720P",
"ratio": "adaptive",
"duration": 5,
"audio": true,
"seed": 0,
"prompt_extend": false,
"watermark": false
}
}'Provide at least one of input.prompt or input.media. The prompt limit is 20,000 characters; the upstream service truncates excess input.
Native Parameters
| Parameter | Type | Default | Values and behavior |
|---|---|---|---|
parameters.resolution | string | 1080P | 480P, 720P, or 1080P |
parameters.ratio | string | adaptive | adaptive, 16:9, 4:3, 1:1, 3:4, or 9:16 |
parameters.duration | integer | 5 | 2–30 without video input; input video duration plus output duration must not exceed 30; -1 enables smart duration |
parameters.audio | boolean | true | Whether the output includes an audio track |
parameters.seed | integer | Random | 0–2147483647; an explicit 0 is preserved |
parameters.prompt_extend | boolean | true | Enables prompt rewriting; an explicit false is preserved |
parameters.watermark | boolean | false | Adds a watermark; an explicit false is preserved |
Media Types and Limits
input.media[].type | Count and limits | Supported url form |
|---|---|---|
first_frame | Up to one image, used as the strict first frame | Public URL, temporary OSS URL, or Base64 Data URL |
last_frame | Up to one image, used as the strict last frame | Public URL, temporary OSS URL, or Base64 Data URL |
reference_image | Up to 10 images | Public URL, temporary OSS URL, or Base64 Data URL |
reference_video | Up to five clips; 1–15 seconds each and 15 seconds total | Public URL or temporary OSS URL |
reference_audio | Up to five clips; 1–15 seconds each and 15 seconds total | Public URL or temporary OSS URL |
file | Up to one file, 100 MB maximum | Public URL or temporary OSS URL |
link | Up to one public page that requires no login | Public HTTP/HTTPS URL |
first_frame and last_frame cannot be combined with reference_image, reference_video, reference_audio, file, or link. file and link are also mutually exclusive.
Images may be JPEG, JPG, PNG, BMP, or WEBP; PNG transparency is not supported. Each side must be between 240 and 8,000 pixels, the aspect ratio may not exceed 8:1, and the file may not exceed 20 MB. Reference video supports MP4 and MOV, each side between 240 and 4,096 pixels, an aspect ratio no greater than 8:1, and a 100 MB maximum size. Reference audio supports WAV and MP3 up to 15 MB.
file supports DOCX, DOC, XLSX, XLS, PPTX, PPT, PDF, TXT, KEY, PAGES, NUMBERS, and MD up to 100 MB. PDF, Word, PowerPoint, Keynote, and Pages-style documents are limited to 50 pages.
Submit Response
ModelSell preserves the native response and replaces only output.task_id with the public ModelSell task ID:
{
"output": {
"task_status": "PENDING",
"task_id": "task_xxxxxxxxxxxxxxxx"
},
"request_id": "request_xxxxxxxxxxxxxxxx"
}Native provider error fields are preserved when the upstream rejects a request:
{
"code": "InvalidParameter",
"message": "The request parameters are invalid.",
"request_id": "request_xxxxxxxxxxxxxxxx"
}Poll a Native Task
curl "$MODELSELL_BASE_URL/api/v1/tasks/task_xxxxxxxxxxxxxxxx" \
-H "Authorization: Bearer $MODELSELL_API_KEY"Native task states are PENDING, RUNNING, SUCCEEDED, FAILED, CANCELED, and UNKNOWN. On success, read the video URL from output.video_url. A successful response looks like this:
{
"request_id": "request_xxxxxxxxxxxxxxxx",
"output": {
"task_id": "task_xxxxxxxxxxxxxxxx",
"task_status": "SUCCEEDED",
"submit_time": "2026-08-06 10:01:35.452",
"scheduled_time": "2026-08-06 10:01:35.507",
"end_time": "2026-08-06 10:13:33.838",
"orig_prompt": "A kitten runs across a rooftop under moonlight",
"video_url": "https://example.com/wan3-result.mp4"
},
"usage": {
"video_count": 1,
"duration": 5.0,
"input_video_duration": 0.0,
"output_video_duration": 5.0,
"fps": 30,
"SR": 720,
"ratio": "16:9"
}
}Poll about every 15 seconds. Upstream task IDs and result URLs remain available for 24 hours, so download or copy successful results promptly. Always poll with the public task_id returned by ModelSell, not an upstream task ID found in server logs.
HappyHorse Video Integration
Previous Page
Native Video Generation
使用阿里云百炼 Wan 3.0 官方请求体创建异步视频任务。支持 `wan3.0-video-prime` 和 `wan3.0-video`,以及文生视频、首帧/首尾帧生视频、参考生视频、视频编辑、视频延长、参考文件和参考网页等模式。 请求 ModelSell 服务地址并使用 ModelSell API Key。阿里云上游要求的 `X-DashScope-Async: enable` 由 ModelSell 自动添加,已有官方客户端也可以继续发送该请求头。 响应保留 Wan 3.0 原生字段,但 `output.task_id` 是 ModelSell 公共任务 ID。后续通过 `GET /api/v1/tasks/{task_id}` 查询,不要使用上游任务 ID。