Skip to main content

Video generation

Generate short videos from text with Wan2.1 T2V 1.3B via POST /v1/video/generations. Unlike the other endpoints, video is asynchronous — the initial request returns a job ID; poll until the video is ready.

Submit a job

curl https://api.ecohash.com/v1/video/generations \
-H "Authorization: Bearer eco_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan21-t2v-1-3b",
"prompt": "a red balloon floating over a mountain at dawn",
"num_frames": 33,
"fps": 16,
"num_inference_steps": 50,
"guidance_scale": 5.0
}'

Response:

{
"id": "vid_abc123",
"object": "video.job",
"status": "queued",
"created": 1776391234,
"model": "wan21-t2v-1-3b"
}

Poll for completion

curl https://api.ecohash.com/v1/video/generations/vid_abc123 \
-H "Authorization: Bearer eco_YOUR_KEY"

Response progression:

{ "id": "vid_abc123", "status": "queued", ... }
// then:
{ "id": "vid_abc123", "status": "processing", ... }
// then:
{
"id": "vid_abc123",
"status": "completed",
"video_url": "https://ecolink-videos.s3.us-west-1.amazonaws.com/vid_abc123.mp4",
"duration_seconds": 2.0625,
"created": 1776391234,
"completed_at": 1776391312
}

Video URLs expire after 24 hours. Download and persist the bytes if you need them longer.

Parameters

ParameterTypeDefaultNotes
modelstringRequired. "wan21-t2v-1-3b"
promptstringRequired
num_framesinteger33Frames to generate — 33 frames at 16 fps ≈ 2 seconds
fpsinteger16Playback frame rate
num_inference_stepsinteger50More steps = higher quality, slower. Range 20–80
guidance_scalefloat5.0How closely to follow the prompt (higher = more literal)
seedintegerrandomDeterministic output when set

Python

import time, requests

API = "https://api.ecohash.com"
HEADERS = {"Authorization": "Bearer eco_..."}

# Submit
job = requests.post(f"{API}/v1/video/generations", headers=HEADERS, json={
"model": "wan21-t2v-1-3b",
"prompt": "a paper airplane gliding through a library",
"num_frames": 33,
"fps": 16,
}).json()

# Poll
while True:
time.sleep(10)
job = requests.get(f"{API}/v1/video/generations/{job['id']}", headers=HEADERS).json()
print(job["status"])
if job["status"] in ("completed", "failed"):
break

if job["status"] == "completed":
video_bytes = requests.get(job["video_url"]).content
open("out.mp4", "wb").write(video_bytes)

Timing

Video generation is the slowest platform model:

  • ~30–60 seconds wait in the queue (shorter when there's no queue)
  • ~60–120 seconds of GPU time to generate
  • Total: typically 1–3 minutes end-to-end

For interactive apps, show a progress indicator; don't expect sub-minute turnaround.

Limits

  • Max 5 concurrent jobs per account (pending or processing)
  • Max num_frames = 81 (≈5 seconds at 16 fps)
  • No image inputs — text-to-video only in v1

Billing

Video generation bills per second of generated video. A 2-second clip costs roughly 2 × the per-second rate.