视频生成
HiAPI 中文文档当前维护 7 个在线视频模型,涵盖文生视频和图生视频。实时价格请查看定价页。
| 模型 | 提供商 | 类型 | 主要特点 |
|---|---|---|---|
| HappyHorse 1.0 | 阿里巴巴 | 文生视频 | 短视频、广告分镜、社媒素材,3–15 秒按秒计费 |
| Kling 3.0 | 快手 | 文生视频 | 电影感镜头、强动作表现 |
| Seedance 1.0 Pro | 字节跳动 | 文生视频 | 性价比更高,适合批量生成 |
| Seedance 1.5 Pro | 字节跳动 | 文生视频 | 1080P、原生音频、叙事镜头 |
| Seedance 2.0 | 字节跳动 | 文生视频 / 图生视频 | 高动态表现,适合统一工作流 |
| Wan 2.7 T2V | 阿里巴巴 | 文生视频 | 横竖屏短片、通用视频生成 |
| 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-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" })
video_id = response.json()["id"]print(f"Task created: {video_id}")使用 Wan 2.7 I2V 或 Seedance 2.0 将静态图片转为视频:
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_reference": "https://example.com/photo.jpg", "seconds": "5" }'异步任务模式
Section titled “异步任务模式”视频生成是异步的。API 返回顶层 id,需要轮询获取结果:
import timeimport requests
# 1. 提交任务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": "sunset timelapse", "seconds": "5"})video_id = response.json()["id"]
# 2. 轮询结果while True: result = requests.get( f"https://api.hiapi.ai/v1/videos/{video_id}", headers={"Authorization": "Bearer YOUR_API_KEY"} ).json() if result["status"] == "completed": print("视频 URL:", result.get("metadata", {}).get("url")) break time.sleep(5)| 参数 | 可选值 | 适用模型 |
|---|---|---|
seconds | 3, 5, 8, 10, 12, 15 | Wan 2.7、Seedance、Kling |
size | 1920*1080, 1080*1920, 1280*720 | Wan 2.7、Seedance、Kling |
input_reference | 图片 URL | Wan 2.7 I2V、Seedance 2.0 |