基础地址:https://api-cn.ovj.red/v1/video | 认证:Authorization: Bearer sk-xxx
GET /v1/video/models
curl https://api-cn.ovj.red/v1/video/models \
-H "Authorization: Bearer sk-您的Token"
| 模型ID | 说明 |
|---|---|
wan2.7-t2v | 文生视频 |
wan2.7-i2v | 图生视频 |
POST /v1/video/generations
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 否 | 默认 wan2.7-t2v |
prompt | string | 是 | 视频内容描述 |
resolution | string | 否 | 480P / 720P / 1080P,默认720P |
curl -X POST https://api-cn.ovj.red/v1/video/generations \
-H "Authorization: Bearer sk-您的Token" \
-H "Content-Type: application/json" \
-d '{"model":"wan2.7-t2v","prompt":"一只橘猫在阳光下打滚","resolution":"720P"}'
GET /v1/video/result/{task_id}
curl https://api-cn.ovj.red/v1/video/result/e530a59d-xxx \
-H "Authorization: Bearer sk-您的Token"
| 状态 | 说明 |
|---|---|
pending | 排队中 |
processing | 生成中(1~3分钟) |
completed | 完成,返回 video_url(有效期1小时) |
failed | 失败,可重试 |
import requests, time
API_KEY = "sk-您的Token"
BASE = "https://api-cn.ovj.red/v1/video"
# 提交
resp = requests.post(f"{BASE}/generations",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"model": "wan2.7-t2v", "prompt": "一只猫在奔跑"})
task_id = resp.json()["id"]
# 轮询
while True:
resp = requests.get(f"{BASE}/result/{task_id}",
headers={"Authorization": f"Bearer {API_KEY}"})
data = resp.json()
print(f"状态: {data['status']}")
if data["status"] in ("completed", "failed"):
break
time.sleep(10)
if data["status"] == "completed":
print(f"下载: {data['video_url']}")
| 模型 | 每次扣费 |
|---|---|
wan2.7-t2v | 150 quota |
wan2.7-i2v | 150 quota |