DocsAPI reference
Videos
POST /v1/videos — create video clips from text with Wan 2.2 on your own GPU as asynchronous jobs, then poll and download them.
HTTP
POST https://osarai.xyz/v1/videos
GET https://osarai.xyz/v1/videos/{id}
GET https://osarai.xyz/v1/videos/{id}/contentVideo generation takes minutes, so it runs as a job: you create it, poll its status, and download the file when it is done. Deploy one of:
| Model | GPU | Output |
|---|---|---|
Wan 2.2 TI2V-5B (wan2.2-ti2v-5b) | RTX 5090 | 720p, 5-second clips; good for drafts |
Wan 2.2 T2V-A14B (wan2.2-t2v-a14b) | RTX PRO 6000 | 480p and 720p, production quality |
1. Create a job
Terminal
curl "https://osarai.xyz/v1/videos" \
-H "Authorization: Bearer $OSARAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.2-ti2v-5b",
"prompt": "Gentle waves rolling onto a sandy beach at sunset, slow camera pan",
"size": "1280x720",
"seconds": "5"
}'| Field | Notes |
|---|---|
model | A video model id |
prompt | The scene and camera movement |
size | 1280x720 (landscape), 720x1280 (portrait) or 832x480 (fastest) |
seconds | Clip length, as a string |
JSON
{ "id": "video_7c1e4b2a", "object": "video", "status": "queued", "progress": 0, "model": "wan2.2-ti2v-5b" }2. Poll the status
Terminal
curl "https://osarai.xyz/v1/videos/video_7c1e4b2a" -H "Authorization: Bearer $OSARAI_API_KEY"status moves from queued to in_progress (with progress from 0 to 100) and ends as completed or failed. Poll every few seconds.
3. Download
Terminal
curl "https://osarai.xyz/v1/videos/video_7c1e4b2a/content" \
-H "Authorization: Bearer $OSARAI_API_KEY" \
--output waves.mp4The whole flow in Python
Python
import os, time, requests
base = "https://osarai.xyz/v1"
headers = {"Authorization": f"Bearer {os.environ['OSARAI_API_KEY']}"}
job = requests.post(f"{base}/videos", headers=headers, json={
"model": "wan2.2-ti2v-5b",
"prompt": "Gentle waves rolling onto a sandy beach at sunset, slow camera pan",
"size": "1280x720",
"seconds": "5",
}).json()
while job["status"] not in ("completed", "failed"):
time.sleep(5)
job = requests.get(f"{base}/videos/{job['id']}", headers=headers).json()
print(job["status"], job.get("progress", 0))
if job["status"] == "completed":
video = requests.get(f"{base}/videos/{job['id']}/content", headers=headers)
open("waves.mp4", "wb").write(video.content)Good to know
- Only the account that created a job can read it; another account's job id answers
404. - Videos live on the instance that made them. Download them before you stop the instance: afterwards the job answers
410 Gone. - Job ids are remembered for 48 hours.