Video GenerationWan
Wan 2.5
Generate videos from text or images using the Alibaba Wan 2.5 model with audio sync, prompt expansion, and multi-resolution support.
POST /v2/videos/generate — model: "wan-2.5"
Combined text-to-video and image-to-video generation at 480p, 720p, or 1080p. Supports custom audio files for voice/music synchronization and automatic prompt optimization.
See Video Generation overview for common request fields, response format, and error codes.
Model-specific parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
wanParams.image | string | No | — | Image URL for image-to-video (omit for text-to-video) |
wanParams.duration | number | No | 5 | Video duration in seconds: 5 or 10 |
wanParams.resolution | string | No | "720p" | Video resolution: "480p", "720p", "1080p" |
wanParams.negative_prompt | string | No | — | Elements to avoid in the generated video |
wanParams.audio | string | No | — | Audio file URL (wav/mp3, 3–30s, ≤15 MB) for synchronization |
wanParams.enable_prompt_expansion | boolean | No | — | Enable automatic prompt optimization |
wanParams.seed | number | No | — | Random seed for reproducible generation |
Credit cost
| Variant | Credits |
|---|---|
480p-5s | 3 |
480p-10s | 5 |
720p-5s | 4 |
720p-10s | 7 |
1080p-5s | 6 |
1080p-10s | 10 |
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-2.5",
"wanParams": {
"duration": 10,
"resolution": "720p",
"enable_prompt_expansion": true
}
}'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-2.5",
"wanParams": {
"duration": 10,
"resolution": "720p",
"enable_prompt_expansion": True,
},
},
)
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-2.5",
wanParams: {
duration: 10,
resolution: "720p",
enable_prompt_expansion: true,
},
}),
});
console.log(await response.json());Image-to-video
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 and smiles at the camera",
"model": "wan-2.5",
"wanParams": {
"image": "https://example.com/portrait.jpg",
"duration": 5,
"resolution": "720p"
}
}'Try it
POST
/v2/videos/generateTry it