curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6",
"prompt": "A cute cat running on grass",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6",
"prompt": "The cat starts running playfully",
"image_urls": ["https://example.com/cat.jpg"],
"resolution": "1080p",
"duration": 10
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6",
"prompt": "The character waves and smiles",
"metadata": {
"reference_urls": ["https://cdn.example.com/ref-character.mp4"]
},
"resolution": "1080p",
"duration": 5
}'
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",
"prompt": "A cute cat running on grass",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5
}
)
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',
prompt: 'A cute cat running on grass',
aspect_ratio: '16:9',
resolution: '1080p',
duration: 5
})
});
const task = await response.json();
console.log(`Task ID: ${task.id}`);
console.log(`Status: ${task.status}`);
{
"id": "video_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ",
"object": "generation.task",
"model": "wan2.6",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {
"aspect_ratio": "16:9"
}
}
Wan2.6
Wan2.6 비디오 생성
Generate high-quality videos using Alibaba Cloud Wan2.6 model — supports text-to-video, image-to-video and reference-video
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",
"prompt": "A cute cat running on grass",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6",
"prompt": "The cat starts running playfully",
"image_urls": ["https://example.com/cat.jpg"],
"resolution": "1080p",
"duration": 10
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6",
"prompt": "The character waves and smiles",
"metadata": {
"reference_urls": ["https://cdn.example.com/ref-character.mp4"]
},
"resolution": "1080p",
"duration": 5
}'
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",
"prompt": "A cute cat running on grass",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5
}
)
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',
prompt: 'A cute cat running on grass',
aspect_ratio: '16:9',
resolution: '1080p',
duration: 5
})
});
const task = await response.json();
console.log(`Task ID: ${task.id}`);
console.log(`Status: ${task.status}`);
{
"id": "video_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ",
"object": "generation.task",
"model": "wan2.6",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {
"aspect_ratio": "16:9"
}
}
중국 본토 사용자 안내: 중국 본토 사용자는
https://toapis.cn 를 API 엔드포인트(Base URL)로 사용해 주세요. 본 문서의 예시에서 https://toapis.com 을 https://toapis.cn 로 바꿔 주세요.- Alibaba Cloud Wanxiang video generation model
- Supports three modes: Text-to-Video, Image-to-Video, and Reference Video (r2v)
- Server automatically routes to the appropriate upstream model based on your request parameters
- Supports 720p/1080p resolution, 5/10/15 second duration
- Audio is always included in the generated output
Important Change: For better performance and cost control, we no longer support passing base64 image data directly in
image_urls. Please use the Upload 이미지 API first to upload images and get URLs, then call this endpoint.Routing Logic
The server automatically selects the upstream model based on what parameters you provide:| 파라미터 Provided | Upstream Mode |
|---|---|
metadata.reference_urls (video URLs) | Reference Video (r2v) |
image_urls (image) | Image-to-Video (i2v) |
prompt only | Text-to-Video (t2v) |
인증
string
필수
All endpoints require Bearer Token authenticationGet your API Key from the API Key Management PageAdd to request header:
Authorization: Bearer YOUR_API_KEY
요청 파라미터
string
필수
Video generation model name, fixed as
wan2.6string
필수
Video content description필수 for text-to-video mode; optional for image-to-video and reference video modes (describe expected motion or style)Example:
"A cute cat stretching in the sunshine"string[]
Reference image URL array for image-to-video mode (only supports 1 image)⚠️ URL format only (base64 no longer supported)
- Publicly accessible image URL (http:// or https://)
- You can use the Upload 이미지 API to upload local images and get URLs
["https://example.com/image.jpg"]Note: Cannot be combined with metadata.reference_urlsstring
기본값:"16:9"
Video aspect ratio (applies to text-to-video and reference video modes)Available values:
16:9- Landscape (default)9:16- Portrait1:1- Square4:3- Landscape3:4- Portrait
16:9Note: Not supported in image-to-video modestring
기본값:"1080p"
Video resolutionAvailable values:
720p- Standard definition1080p- High definition (default)
1080p480p is not supported. Billed per second; different resolutions have different prices — refer to the model marketplace for details.integer
기본값:"5"
Video duration (seconds)Supported values:
5, 10, 15Default: 5string
Negative prompt — describe content you do not want in the videoExample:
"blurry, low quality, deformed"integer
Random seed for reproducibilityExample:
12345boolean
기본값:"true"
Auto-extend promptWhen enabled, the system automatically optimizes and enriches your prompt. Enabled by default — set to
false to disable.boolean
Include audio in the generated videoNon-flash Wan2.6 models always include audio by default. Set to
true to explicitly enable.string
Shot type (applies to text-to-video and reference video modes)Available values:
single- Single continuous shotmulti- Multi-shot (cinematic cuts)
boolean
Add an Alibaba Cloud watermark to the generated video
object
Extended parameters
표시 Show metadata fields
표시 Show metadata fields
string[]
Reference Video (r2v) mode — array of reference video URLsWhen provided, the server routes to the reference video upstream model (wan2.6-r2v). The model uses these videos to guide generation of consistent characters or scenes.
- Each entry must be a publicly accessible video URL (http:// or https://)
- Up to several reference videos are supported
["https://cdn.example.com/ref1.mp4"]Note: Cannot be combined with image_urlsResolution and Aspect Ratio Combinations
| Aspect Ratio | 설명 | 720p Size | 1080p Size |
|---|---|---|---|
| 16:9 | Landscape (default) | 1280×720 | 1920×1080 |
| 9:16 | Portrait | 720×1280 | 1080×1920 |
| 1:1 | Square | 960×960 | 1440×1440 |
| 4:3 | Landscape | 1088×832 | 1632×1248 |
| 3:4 | Portrait | 832×1088 | 1248×1632 |
응답
string
Unique task identifier for status queries
string
Object type, always
generation.taskstring
모델 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: Text-to-Video
{
"model": "wan2.6",
"prompt": "A cute cat running on grass, sunny day",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5
}
Scenario 2: Image-to-Video
{
"model": "wan2.6",
"prompt": "The cat starts running playfully",
"image_urls": ["https://example.com/cat.jpg"],
"resolution": "1080p",
"duration": 10
}
Scenario 3: Reference Video (r2v)
{
"model": "wan2.6",
"prompt": "The character waves and smiles at the camera",
"metadata": {
"reference_urls": ["https://cdn.example.com/ref-character.mp4"]
},
"shot_type": "single",
"resolution": "1080p",
"duration": 5
}
Scenario 4: Text-to-Video (Full 파라미터)
{
"model": "wan2.6",
"prompt": "A golden retriever runs through a field of sunflowers",
"negative_prompt": "blurry, low quality, deformed",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 10,
"seed": 12345,
"prompt_extend": true,
"shot_type": "multi",
"watermark": false
}
Querying Task ResultsVideo generation is an asynchronous task. After submission, a
task_id is returned. Use the Get Video Task 상태 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",
"prompt": "A cute cat running on grass",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6",
"prompt": "The cat starts running playfully",
"image_urls": ["https://example.com/cat.jpg"],
"resolution": "1080p",
"duration": 10
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "wan2.6",
"prompt": "The character waves and smiles",
"metadata": {
"reference_urls": ["https://cdn.example.com/ref-character.mp4"]
},
"resolution": "1080p",
"duration": 5
}'
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",
"prompt": "A cute cat running on grass",
"aspect_ratio": "16:9",
"resolution": "1080p",
"duration": 5
}
)
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',
prompt: 'A cute cat running on grass',
aspect_ratio: '16:9',
resolution: '1080p',
duration: 5
})
});
const task = await response.json();
console.log(`Task ID: ${task.id}`);
console.log(`Status: ${task.status}`);
{
"id": "video_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ",
"object": "generation.task",
"model": "wan2.6",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {
"aspect_ratio": "16:9"
}
}