Wan 3.0
Generate videos with Alibaba's all-in-one Wan 3.0 model — text, first/last-frame, multimodal references, document or webpage input, native audio, 2–30 s at up to 1080p.
POST /v2/videos/generate — model: "wan-3.0"
Alibaba's all-in-one video model: one model id covers text-to-video, first-and-last-frame image-to-video, reference-based generation (images, videos, and audio), and document / webpage-to-video. Single-pass clips of 2–30 seconds at 480p, 720p, or 1080p with a natively generated audio track.
The mode is selected automatically from the inputs:
- No media inputs → text-to-video.
image(optionallylast_frame) → image-to-video / first-and-last-frame.reference_images/reference_videos/reference_audios→ reference-based generation.documentorwebpage→ the model reads the file or page and turns it into a video.
Frame anchors (image / last_frame) are mutually exclusive with reference and document/webpage inputs, and document is mutually exclusive with webpage. prompt is optional when at least one media input is provided (up to 20,000 characters).
Reference-based generation and document/webpage input run on Alibaba Cloud infrastructure only; plain text-to-video also has automatic failover capacity.
See Video Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
wan30Params.image | string | No | — | First-frame image URL for I2V. Mutually exclusive with reference and document/webpage inputs. |
wan30Params.last_frame | string | No | — | Optional last-frame image URL for first-and-last-frame generation. Requires image. |
wan30Params.reference_images | string[] | No | — | Up to 10 reference image URLs for character / object / scene anchoring. |
wan30Params.reference_videos | string[] | No | — | Up to 5 reference video URLs (1–15 s each, ≤ 15 s combined; combined reference + output duration must stay ≤ 30 s). |
wan30Params.reference_audios | string[] | No | — | Up to 5 reference audio URLs (1–15 s each, ≤ 15 s combined) for voice / music anchoring. |
wan30Params.document | string | No | — | URL of a document (pdf, docx, pptx, xlsx, txt, md, …; ≤ 100 MB, ≤ 50 pages) to turn into a video. Mutually exclusive with webpage. |
wan30Params.webpage | string | No | — | URL of a publicly accessible web page to turn into a video. Mutually exclusive with document. |
wan30Params.resolution | string | No | "1080p" | Output resolution: "480p", "720p", or "1080p". |
wan30Params.aspect_ratio | string | No | "adaptive" | One of "adaptive", "16:9", "4:3", "1:1", "3:4", "9:16". "adaptive" lets the model pick from the inputs. |
wan30Params.duration | number | No | 5 | Video duration in seconds (integer, 2–30). |
wan30Params.audio_enabled | boolean | No | true | Include a natively generated audio track. Does not affect pricing. |
wan30Params.negative_prompt | string | No | — | Elements to avoid in the generated video. |
wan30Params.enable_prompt_expansion | boolean | No | — | Enable automatic prompt optimization. |
wan30Params.seed | number | No | — | Random seed for reproducible generation. |
Credit cost
Pricing is per second of generated video (credits = rate × duration). Reference inputs, document/webpage input, and audio generation are free — only the output seconds are billed.
| Variant | Credits / second |
|---|---|
480p | 6 |
720p | 13 |
1080p | 25 |
A 10-second clip at 1080p therefore costs 25 × 10 = 250 credits.
Example result
Once the job is COMPLETED, the result object on GET /v2/jobs/:id looks like:
{
"videoUrl": "https://cdn2.apiframe.ai/videos/b2c3d4e5-f6a7-8901-bcde-f23456789012.mp4"
}See Result format for field details.
Code examples
curl -X POST https://api.apiframe.ai/v2/videos/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cinematic slow-motion shot of a tiger running through tall grass at golden hour",
"model": "wan-3.0",
"wan30Params": {
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "16:9"
}
}'import requests
response = requests.post(
"https://api.apiframe.ai/v2/videos/generate",
headers={
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
json={
"prompt": "A cinematic slow-motion shot of a tiger running through tall grass at golden hour",
"model": "wan-3.0",
"wan30Params": {
"duration": 10,
"resolution": "1080p",
"aspect_ratio": "16:9",
},
},
)
print(response.json())const response = await fetch("https://api.apiframe.ai/v2/videos/generate", {
method: "POST",
headers: {
"X-API-Key": "afk_your_api_key_here",
"Content-Type": "application/json",
},
body: JSON.stringify({
prompt: "A cinematic slow-motion shot of a tiger running through tall grass at golden hour",
model: "wan-3.0",
wan30Params: {
duration: 10,
resolution: "1080p",
aspect_ratio: "16:9",
},
}),
});
console.log(await response.json());Image-to-video (with optional last frame)
curl -X POST https://api.apiframe.ai/v2/videos/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "The person turns to camera and smiles",
"model": "wan-3.0",
"wan30Params": {
"image": "https://example.com/start.jpg",
"last_frame": "https://example.com/end.jpg",
"duration": 5,
"resolution": "720p"
}
}'Reference-based generation
Anchor characters, objects, scenes, motion, or voices with up to 10 reference images, 5 reference videos, and 5 reference audio clips:
curl -X POST https://api.apiframe.ai/v2/videos/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "The character from the reference walks through a neon-lit street, speaking with the reference voice",
"model": "wan-3.0",
"wan30Params": {
"reference_images": ["https://example.com/character.png"],
"reference_audios": ["https://example.com/voice.mp3"],
"duration": 10,
"resolution": "1080p"
}
}'Document or webpage to video
Turn a slide deck, report, or web article into a narrated video. prompt is optional — add one to steer style and focus:
curl -X POST https://api.apiframe.ai/v2/videos/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Summarize the key points as an energetic product teaser",
"model": "wan-3.0",
"wan30Params": {
"document": "https://example.com/launch-deck.pdf",
"duration": 20,
"resolution": "1080p"
}
}'Or from a public web page:
curl -X POST https://api.apiframe.ai/v2/videos/generate \
-H "X-API-Key: afk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"model": "wan-3.0",
"wan30Params": {
"webpage": "https://example.com/blog/announcement",
"duration": 15
}
}'Try it
/v2/videos/generateTry it