curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6-flash",
"image_urls": ["https://example.com/photo.jpg"],
"prompt": "The person comes alive and smiles",
"resolution": "1080p",
"duration": 5,
"audio": true
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6-flash",
"prompt": "The character is watching a movie on the couch",
"metadata": {
"reference_urls": ["https://cdn.example.com/ref-character.mp4"]
},
"resolution": "1080p",
"duration": 5,
"audio": true
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "wan2.6-flash",
"image_urls": ["https://example.com/photo.jpg"],
"prompt": "The person comes alive and smiles",
"resolution": "1080p",
"duration": 5,
"audio": True
}
)
task = response.json()
print(f"Task ID: {task['id']}")
print(f"Status: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'wan2.6-flash',
image_urls: ['https://example.com/photo.jpg'],
prompt: 'The person comes alive and smiles',
resolution: '1080p',
duration: 5,
audio: true
})
});
const task = await response.json();
console.log(`Task ID: ${task.id}`);
console.log(`Status: ${task.status}`);
{
"id": "video_01K2ABJPQ9A0Z6JZ3V8M9W6PZ",
"object": "generation.task",
"model": "wan2.6-flash",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
Wan2.6
Wan2.6 Flash Video Generation
Generate videos using Alibaba Cloud Wan2.6 Flash model — faster image-to-video and reference video generation
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6-flash",
"image_urls": ["https://example.com/photo.jpg"],
"prompt": "The person comes alive and smiles",
"resolution": "1080p",
"duration": 5,
"audio": true
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6-flash",
"prompt": "The character is watching a movie on the couch",
"metadata": {
"reference_urls": ["https://cdn.example.com/ref-character.mp4"]
},
"resolution": "1080p",
"duration": 5,
"audio": true
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "wan2.6-flash",
"image_urls": ["https://example.com/photo.jpg"],
"prompt": "The person comes alive and smiles",
"resolution": "1080p",
"duration": 5,
"audio": True
}
)
task = response.json()
print(f"Task ID: {task['id']}")
print(f"Status: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'wan2.6-flash',
image_urls: ['https://example.com/photo.jpg'],
prompt: 'The person comes alive and smiles',
resolution: '1080p',
duration: 5,
audio: true
})
});
const task = await response.json();
console.log(`Task ID: ${task.id}`);
console.log(`Status: ${task.status}`);
{
"id": "video_01K2ABJPQ9A0Z6JZ3V8M9W6PZ",
"object": "generation.task",
"model": "wan2.6-flash",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
Note for users in mainland China: Please use
https://toapis.cn as the API endpoint (Base URL). Replace https://toapis.com with https://toapis.cn in the examples in this document.- Alibaba Cloud Wanxiang Flash (accelerated) video generation model
- Supports two modes: Image-to-Video and Reference Video (r2v)
- Text-only generation is not supported — you must provide an image or reference video URLs
- Supports 720p/1080p resolution; audio on/off option affects billing
- Faster generation speed — ideal for quick previews and iteration
Image or reference video URL is required: You must provide either
image_urls (image-to-video) or metadata.reference_urls (reference video). Sending a prompt-only request will return an error.Routing Logic
The server automatically selects the upstream model based on your request parameters:| Parameters Provided | Upstream Mode |
|---|---|
metadata.reference_urls (video URLs) | Reference Video Flash (r2v-flash) |
image_urls (image) | Image-to-Video Flash (i2v-flash) |
prompt only | ❌ Returns error |
Authentication
string
required
All endpoints require Bearer Token authenticationGet your API Key from the API Key Management PageAdd to request header:
Authorization: Bearer YOUR_API_KEY
Request Parameters
string
required
Video generation model name, fixed as
wan2.6-flashstring[]
Reference image URL array for image-to-video mode (only supports 1 image)Required if
metadata.reference_urls is not provided⚠️ URL format only (base64 no longer supported)- Publicly accessible image URL (http:// or https://)
- You can use the Upload Image API to upload local images and get URLs
["https://example.com/image.jpg"]string
Video content description (optional)Describe the expected motion or style to guide the modelExample:
"The person comes alive and smiles at the camera"string
default:"1080p"
Video resolutionAvailable values:
720p- Standard definition1080p- High definition (default)
1080pDifferent resolutions have different prices — refer to the model marketplace for details.integer
default:"5"
Video duration (seconds)Supported values:
5, 10, 15Default: 5boolean
default:"true"
Whether to generate audio in the video
true- Generate video with audio (default)false- Generate silent video
trueboolean
Add an Alibaba Cloud watermark to the generated video
object
Extended parameters
Show Show metadata fields
Show Show metadata fields
string[]
Reference Video (r2v) mode — array of reference video URLsWhen provided, the server routes to the reference video Flash upstream model (wan2.6-r2v-flash). The model uses these videos to generate new content with consistent characters or scenes.
- Each entry must be a publicly accessible video URL (http:// or https://)
["https://cdn.example.com/ref-character.mp4"]Note: Cannot be combined with image_urlsAudio vs Silent Pricing
| Mode | 720p Unit Price | 1080p Unit Price |
|---|---|---|
With audio (audio: true) | ¥0.3 / second | ¥0.5 / second |
Silent (audio: false) | ¥0.15 / second | ¥0.25 / second |
Response
string
Unique task identifier for status queries
string
Object type, always
generation.taskstring
Model name used
string
Task status
queued- Queued for processingin_progress- Processingcompleted- Successfully completedfailed- Failed
integer
Task progress percentage (0-100)
integer
Task creation timestamp (Unix timestamp)
object
Task metadata
Usage Scenarios
Scenario 1: Image-to-Video (with audio)
{
"model": "wan2.6-flash",
"image_urls": ["https://example.com/photo.jpg"],
"prompt": "The person comes alive and smiles",
"resolution": "1080p",
"duration": 5,
"audio": true
}
Scenario 2: Image-to-Video (silent, lower cost)
{
"model": "wan2.6-flash",
"image_urls": ["https://example.com/photo.jpg"],
"resolution": "720p",
"duration": 5,
"audio": false
}
Scenario 3: Reference Video (r2v-flash)
{
"model": "wan2.6-flash",
"prompt": "The character is watching a movie on the couch",
"metadata": {
"reference_urls": ["https://cdn.example.com/ref-character.mp4"]
},
"resolution": "1080p",
"duration": 5,
"audio": true
}
Querying Task ResultsVideo generation is an asynchronous task. After submission, a
task_id is returned. Use the Get Video Task Status interface to query generation progress and results.curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6-flash",
"image_urls": ["https://example.com/photo.jpg"],
"prompt": "The person comes alive and smiles",
"resolution": "1080p",
"duration": 5,
"audio": true
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6-flash",
"prompt": "The character is watching a movie on the couch",
"metadata": {
"reference_urls": ["https://cdn.example.com/ref-character.mp4"]
},
"resolution": "1080p",
"duration": 5,
"audio": true
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
json={
"model": "wan2.6-flash",
"image_urls": ["https://example.com/photo.jpg"],
"prompt": "The person comes alive and smiles",
"resolution": "1080p",
"duration": 5,
"audio": True
}
)
task = response.json()
print(f"Task ID: {task['id']}")
print(f"Status: {task['status']}")
const response = await fetch('https://toapis.com/v1/videos/generations', {
method: 'POST',
headers: {
'Authorization': 'Bearer your-ToAPIs-key',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model: 'wan2.6-flash',
image_urls: ['https://example.com/photo.jpg'],
prompt: 'The person comes alive and smiles',
resolution: '1080p',
duration: 5,
audio: true
})
});
const task = await response.json();
console.log(`Task ID: ${task.id}`);
console.log(`Status: ${task.status}`);
{
"id": "video_01K2ABJPQ9A0Z6JZ3V8M9W6PZ",
"object": "generation.task",
"model": "wan2.6-flash",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}