Video Generation
HiAPI supports multiple video generation models for text-to-video and image-to-video tasks.
Available Models
Section titled “Available Models”| Model | Provider | Max Duration | Resolution | Credits |
|---|---|---|---|---|
| Sora | OpenAI | 60s | — | 100 |
| Kling | Kuaishou | — | — | 80 |
| Seedance 1.5 Pro | ByteDance | 12s | 1080p | Dynamic |
| Wan 2.7 T2V | Alibaba | 15s | 1080p | 100 |
| Wan 2.7 I2V | Alibaba | 15s | 1080p | 100 |
Text-to-Video
Section titled “Text-to-Video”curl -X POST https://api.hiapi.ai/v1/videos \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.7-t2v", "prompt": "A Shiba Inu chasing butterflies under cherry blossoms", "size": "1920*1080", "seconds": 5 }'import requests
response = requests.post( "https://api.hiapi.ai/v1/videos", headers={ "Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json" }, json={ "model": "wan2.7-t2v", "prompt": "A Shiba Inu chasing butterflies under cherry blossoms", "size": "1920*1080", "seconds": 5 })
task_id = response.json()["data"]["task_id"]print(f"Task created: {task_id}")Image-to-Video
Section titled “Image-to-Video”Animate a still image into a video using Wan 2.7 I2V:
curl -X POST https://api.hiapi.ai/v1/videos \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "wan2.7-i2v", "prompt": "The scene comes alive with gentle wind", "input_image": "https://example.com/photo.jpg", "seconds": 5 }'Async Task Pattern
Section titled “Async Task Pattern”Video generation is asynchronous. The API returns a task_id — poll for the result:
import timeimport requests
# 1. Submit taskresponse = requests.post( "https://api.hiapi.ai/v1/videos", headers={"Authorization": "Bearer YOUR_API_KEY", "Content-Type": "application/json"}, json={"model": "wan2.7-t2v", "prompt": "sunset timelapse", "seconds": 5})task_id = response.json()["data"]["task_id"]
# 2. Poll for resultwhile True: result = requests.get( f"https://api.hiapi.ai/v1/videos/{task_id}", headers={"Authorization": "Bearer YOUR_API_KEY"} ).json() if result["data"]["status"] == "completed": print("Video URL:", result["data"]["url"]) break time.sleep(5)Video Parameters
Section titled “Video Parameters”| Parameter | Values | Models |
|---|---|---|
seconds | 3, 5, 8, 10, 12, 15 | Wan 2.7, Seedance |
size | 1920*1080, 1080*1920, 1280*720 | Wan 2.7 |
duration | 5, 10 | Sora, Kling |