Wan 2.6 API
Complete API reference for Wan 2.6 video generation models by Alibaba.
Model Variants
This API supports two model variants:
Quick Comparison
Wan 2.6 Text to Video
Endpoint
POST /api/v1/video/task
Request Parameters
Required
Optional
Example Request
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'wan-2.6-text-to-video',
prompt: 'A cat playing with a ball of yarn',
duration: 5,
resolution: '1080p'
})
});
const { data } = await response.json();
const taskId = data.task_id;
Wan 2.6 Image to Video
Request Parameters
Required
Optional
Example Request
{
model_name: 'wan-2.6-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Gentle camera pan from left to right',
duration: 5,
resolution: '1080p'
}
Initial Response
Both models return a task_id for polling:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
Polling Response
Poll /api/v1/video/{taskId} to check status:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
Status Values
submitted: Task accepted and waiting to be processed
processing: Video generation in progress
succeed: Video generation completed
failed: Video generation failed
Processing Time
Typical processing time: 2-5 minutes depending on duration and resolution settings.
Longer videos (10-15 seconds) may take up to 8 minutes.
Best Practices
- Describe Scene & Motion: Include both scene content and camera movement in prompts
- Resolution Selection: Use 720p for faster processing, 1080p for highest quality
- Duration Planning: Longer videos cost more (per-second pricing)
- Audio Integration: Can add custom audio via
audio_url parameter
- Image Quality: For image-to-video, use high-quality input images for best results
Example Use Cases
Product Demo Video
{
model_name: 'wan-2.6-text-to-video',
prompt: 'Smooth 360-degree rotation of a luxury watch on a pedestal',
duration: 8,
resolution: '1080p'
}
Animated Portrait
{
model_name: 'wan-2.6-image-to-video',
image_url: 'portrait.jpg',
prompt: 'Subtle head movement, natural breathing, soft smile',
duration: 5,
resolution: '1080p'
}
Scene with Audio
{
model_name: 'wan-2.6-text-to-video',
prompt: 'Ocean waves crashing on a beach at sunset',
duration: 10,
resolution: '1080p',
audio_url: 'https://example.com/ocean-sounds.mp3'
}