Wanx 2.7 Video Generation
Wanx 2.7 is Alibaba's video generation model under the Tongyi series. It excels at producing diverse styles and natural motion, supporting both text-to-video and image-to-video modes — ideal for ad creatives, short-form video production, and more.
Try it Online
Quick Start
bash
curl -X POST https://open.dieyuyun.com/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wanx2.1-t2v-turbo",
"prompt": "A warrior practicing sword forms in a bamboo forest, slow motion, ink painting style",
"size": "1280x720",
"duration": 5
}'Endpoint
| Property | Value |
|---|---|
| Method | POST |
| Path | /v1/video/generations |
| Base URL | https://open.dieyuyun.com |
| Protocol | OpenAI-compatible |
Authentication
All requests must include your API key in the header:
http
Authorization: Bearer YOUR_API_KEYRequest Fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | Yes | — | Model identifier, e.g. wanx2.1-t2v-turbo |
| prompt | string | Yes | — | Video content description |
| size | string | No | 1280x720 | Video resolution: 1280x720, 720x1280, 960x960, or 1920x1080 |
| duration | integer | No | 5 | Video duration in seconds: 5 or 10 |
| image | string | No | — | Reference image URL for image-to-video mode |
| seed | integer | No | — | Random seed for reproducible results |
Request Examples
bash
curl -X POST https://open.dieyuyun.com/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wanx2.1-t2v-turbo",
"prompt": "Coffee pouring into a white ceramic cup from above, slow motion close-up, steam rising",
"size": "1280x720",
"duration": 5,
"seed": 42
}'python
import requests
response = requests.post(
"https://open.dieyuyun.com/v1/video/generations",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
json={
"model": "wanx2.1-t2v-turbo",
"prompt": "Coffee pouring into a white ceramic cup from above, slow motion close-up, steam rising",
"size": "1280x720",
"duration": 5,
"seed": 42
}
)
task = response.json()
task_id = task["task_id"]
print(f"Task created: {task_id}")javascript
const response = await fetch('https://open.dieyuyun.com/v1/video/generations', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'wanx2.1-t2v-turbo',
prompt: 'Coffee pouring into a white ceramic cup from above, slow motion close-up, steam rising',
size: '1280x720',
duration: 5,
seed: 42,
}),
})
const task = await response.json()
console.log('Task created:', task.task_id)Response Format
Video generation is asynchronous. Submit a task to receive a task ID, then poll for results.
Task Creation Response
json
{
"task_id": "task_wx789",
"status": "queued",
"progress": 0,
"created_at": "2025-01-15T10:30:00Z"
}Polling Task Status
bash
curl https://open.dieyuyun.com/v1/video/generations/task_wx789 \
-H "Authorization: Bearer YOUR_API_KEY"Completed Task Response
json
{
"task_id": "task_wx789",
"status": "completed",
"progress": 100,
"metadata": {
"url": "https://cdn.dieyuyun.com/videos/task_wx789.mp4",
"duration": 5,
"size": "1280x720",
"seed": 42
},
"completed_at": "2025-01-15T10:33:00Z"
}Polling Example
python
import time
import requests
# Submit task
resp = requests.post(
"https://open.dieyuyun.com/v1/video/generations",
headers={"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"},
json={"model": "wanx2.1-t2v-turbo", "prompt": "Ink painting style mountain landscape animation", "duration": 5}
)
task_id = resp.json()["task_id"]
# Poll for result
while True:
status = requests.get(
f"https://open.dieyuyun.com/v1/video/generations/{task_id}",
headers={"Authorization": "Bearer YOUR_API_KEY"}
).json()
if status["status"] == "completed":
print(f"Video URL: {status['metadata']['url']}")
break
elif status["status"] == "failed":
print("Generation failed")
break
time.sleep(5)Best Practices
- Bilingual prompts: Wanx handles both Chinese and English prompts well
- Style keywords: Add style descriptors like "ink painting", "cyberpunk", or "cinematic" to enhance visual style
- Camera descriptions: Specify camera movements (e.g., "aerial shot", "dolly zoom", "slow motion") for more predictable results
- Seed reproducibility: Use the
seedparameter to reproduce identical results for A/B testing - Image-to-video: Provide a first-frame reference image for precise control over the starting composition
Rate Limits
| Limit | Value |
|---|---|
| Requests/min | 10 RPM |
| Daily requests | 200/day |
| Concurrent tasks | 3 |
Need higher limits? Submit a ticket in the Console.