UlazAI developer docs

Developer documentation

Wan 2.6 Video Generation API

Generate cinematic multi-shot videos with native audio using Alibaba's Wan 2.6 AI model - supporting Text-to-Video, Image-to-Video, and Video-to-Video modes.

๐ŸŽฌ Multi-Mode: Wan 2.6 supports T2V, I2V, and V2V modes with up to 15-second videos and native audio generation!

โœจ Wan 2.6 Features

โœ… Text-to-Video generation

โœ… Image-to-Video animation

โœ… Video-to-Video transformation

โœ… 5s, 10s, or 15s video duration

โœ… 720p and 1080p resolution

โœ… Native audio with lip-sync

โœ… Stable characters across shots

โœ… Multi-shot storytelling

POST /wan26/upload/

Upload Image/Video File

Upload an image or video file to use with Image-to-Video or Video-to-Video modes. Returns a permanent URL that can be used in the generate endpoint.

Request Headers

Authorization: Bearer YOUR_API_KEY
Content-Type: multipart/form-data

Form Data Parameters

file * (file)

The image or video file to upload.

type (string)

image or video. Default: image

File Limits

๐Ÿ“ท Images: Max 10MB - JPG, PNG, WebP, GIF

๐ŸŽฌ Videos: Max 50MB - MP4, WebM, MOV, AVI

Success Response (200)

{
  "success": true,
  "url": "https://media.ulazai.com/wan26_images/u1_abc123.jpg",
  "filename": "wan26_images/u1_abc123.jpg"
}

Example Usage (cURL)

curl -X POST https://api.ulazai.com/wan26/upload/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@/path/to/image.jpg" \
  -F "type=image"
POST /wan26/generate/

Generate Wan 2.6 Video

Create a video using Wan 2.6 - supports text-to-video, image-to-video, and video-to-video modes.

Request Headers

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Request Body (Text-to-Video)

{
  "prompt": "A cinematic shot of a woman walking through a neon-lit Tokyo street at night",
  "mode": "text-to-video",
  "duration": "5",
  "resolution": "1080p"
}

Request Body (Image-to-Video)

{
  "prompt": "The character turns and smiles at the camera",
  "mode": "image-to-video",
  "image_url": "https://example.com/character.jpg",
  "duration": "5",
  "resolution": "1080p"
}

Request Body (Video-to-Video)

{
  "prompt": "Transform to anime style with vibrant colors",
  "mode": "video-to-video",
  "video_url": "https://example.com/source.mp4",
  "duration": "5",
  "resolution": "1080p"
}

Parameters

prompt * (string)

Description of the video. Max 5000 characters. Supports English and Chinese.

mode (string)

Generation mode: text-to-video, image-to-video, or video-to-video. Default: text-to-video

image_url (string)

Required for image-to-video mode. Public URL to the source image.

video_url (string)

Required for video-to-video mode. Public URL to the source video.

duration (string)

Video duration: "5", "10", or "15" seconds. Default: "5"

resolution (string)

Video resolution: "720p" or "1080p". Default: "1080p"

Success Response (202)

{
  "success": true,
  "generation_id": "abc12345-1234-1234-1234-123456789012",
  "task_id": "wan26_task_xyz789",
  "credits_used": 105,
  "message": "Video generation started. This may take a few minutes."
}
GET /wan26/status/{generation_id}/

Check Generation Status

Poll for the status of a Wan 2.6 video generation.

Processing Response

{
  "success": true,
  "status": "processing",
  "message": "Video is being generated..."
}

Completed Response

{
  "success": true,
  "status": "completed",
  "video_url": "https://cdn.example.com/videos/result.mp4",
  "all_urls": ["https://cdn.example.com/videos/result.mp4"]
}

Failed Response

{
  "success": true,
  "status": "failed",
  "error": "Content policy violation detected"
}

๐Ÿ’ฐ Credit Pricing

Duration 720p 1080p
5 seconds 70 credits 105 credits
10 seconds 140 credits 210 credits
15 seconds 210 credits 315 credits

Pricing applies to all modes (T2V, I2V, V2V). Failed generations are automatically refunded.

๐Ÿ“ Code Examples

Python

import requests
import time

API_KEY = "your_api_key"
BASE_URL = "https://ulazai.com"

# Generate video (Text-to-Video)
response = requests.post(
    f"{BASE_URL}/wan26/generate/",
    headers={
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    },
    json={
        "prompt": "A cinematic shot of a woman walking through Tokyo at night",
        "mode": "text-to-video",
        "duration": "5",
        "resolution": "1080p"
    }
)
result = response.json()
generation_id = result["generation_id"]

# Poll for status
while True:
    status_response = requests.get(
        f"{BASE_URL}/wan26/status/{generation_id}/",
        headers={"Authorization": f"Bearer {API_KEY}"}
    )
    status = status_response.json()
    
    if status["status"] == "completed":
        print(f"Video ready: {status['video_url']}")
        break
    elif status["status"] == "failed":
        print(f"Failed: {status['error']}")
        break
    
    time.sleep(5)

cURL

# Generate video
curl -X POST "https://ulazai.com/wan26/generate/" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A cinematic shot of a woman walking through Tokyo at night",
    "mode": "text-to-video",
    "duration": "5",
    "resolution": "1080p"
  }'

# Check status
curl "https://ulazai.com/wan26/status/GENERATION_ID/" \
  -H "Authorization: Bearer YOUR_API_KEY"