Skip to content

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.

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

PropertyValue
MethodPOST
Path/v1/video/generations
Base URLhttps://open.dieyuyun.com
ProtocolOpenAI-compatible

Authentication

All requests must include your API key in the header:

http
Authorization: Bearer YOUR_API_KEY

Request Fields

FieldTypeRequiredDefaultDescription
modelstringYesModel identifier, e.g. wanx2.1-t2v-turbo
promptstringYesVideo content description
sizestringNo1280x720Video resolution: 1280x720, 720x1280, 960x960, or 1920x1080
durationintegerNo5Video duration in seconds: 5 or 10
imagestringNoReference image URL for image-to-video mode
seedintegerNoRandom 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

  1. Bilingual prompts: Wanx handles both Chinese and English prompts well
  2. Style keywords: Add style descriptors like "ink painting", "cyberpunk", or "cinematic" to enhance visual style
  3. Camera descriptions: Specify camera movements (e.g., "aerial shot", "dolly zoom", "slow motion") for more predictable results
  4. Seed reproducibility: Use the seed parameter to reproduce identical results for A/B testing
  5. Image-to-video: Provide a first-frame reference image for precise control over the starting composition

Rate Limits

LimitValue
Requests/min10 RPM
Daily requests200/day
Concurrent tasks3

Need higher limits? Submit a ticket in the Console.