Skip to main content

Unified Video API

Crazyrouter provides a unified video generation endpoint that supports multiple video models through the same API format.

Supported Models

ModelDescription
veo3.1-componentsGoogle Veo 3.1
veo3Google Veo 3
veo2Google Veo 2
grok-video-3xAI Grok Video
wan-ai/wan2.1-t2v-14bWan text-to-video
wan-ai/wan2.1-i2v-14b-720pWan image-to-video
seedance-liteDoubao Seedance

Create Video

POST /v1/video/create

Request Parameters

ParameterTypeRequiredDescription
modelstringYesModel name
promptstringYesVideo description prompt
aspect_ratiostringNoAspect ratio: 16:9, 9:16, 1:1
sizestringNoVideo size, e.g. 1280x720
imagesarrayNoReference image URL array (image-to-video)
durationintegerNoVideo duration (seconds)

Request Examples

curl -X POST https://crazyrouter.com/v1/video/create \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "veo3.1-components",
    "prompt": "A golden retriever running on the beach, slow motion, cinematic quality",
    "aspect_ratio": "16:9"
  }'

Create Response

{
  "id": "video_task_abc123",
  "status": "processing",
  "status_update_time": 1709123456
}

Image-to-Video

Pass reference images in the images parameter:
cURL
curl -X POST https://crazyrouter.com/v1/video/create \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "wan-ai/wan2.1-i2v-14b-720p",
    "prompt": "The person in the image starts smiling and waving",
    "images": ["https://example.com/portrait.jpg"],
    "aspect_ratio": "16:9"
  }'

Query Task

GET /v1/video/query?id={task_id}

Request Example

cURL
curl "https://crazyrouter.com/v1/video/query?id=video_task_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY"

Query Response (Processing)

{
  "id": "video_task_abc123",
  "status": "processing",
  "status_update_time": 1709123460
}

Query Response (Completed)

{
  "id": "video_task_abc123",
  "status": "completed",
  "status_update_time": 1709123520,
  "video_url": "https://crazyrouter.com/files/video_abc123.mp4"
}

Task Status

StatusDescription
processingProcessing
completedCompleted
failedFailed

Complete Workflow Example

Python
import requests
import time

API_KEY = "YOUR_API_KEY"
BASE_URL = "https://crazyrouter.com"
headers = {
    "Content-Type": "application/json",
    "Authorization": f"Bearer {API_KEY}"
}

# 1. Create video task
resp = requests.post(f"{BASE_URL}/v1/video/create", headers=headers, json={
    "model": "veo3.1-components",
    "prompt": "A golden retriever running on the beach, slow motion",
    "aspect_ratio": "16:9"
})
task_id = resp.json()["id"]
print(f"Task created: {task_id}")

# 2. Poll for status
while True:
    resp = requests.get(f"{BASE_URL}/v1/video/query?id={task_id}", headers=headers)
    result = resp.json()
    status = result["status"]
    print(f"Status: {status}")

    if status == "completed":
        print(f"Video URL: {result['video_url']}")
        break
    elif status == "failed":
        print("Video generation failed")
        break

    time.sleep(10)
Video generation typically takes 1-5 minutes. A polling interval of 10 seconds is recommended.