OVJ 视频生成 API

基础地址:https://api-cn.ovj.red/v1/video | 认证:Authorization: Bearer sk-xxx

1. 查看可用模型

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图生视频

2. 提交视频生成任务

POST /v1/video/generations

参数类型必填说明
modelstring默认 wan2.7-t2v
promptstring视频内容描述
resolutionstring480P / 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"}'
⚠️ 提交成功即扣除额度。余额不足返回 HTTP 402。

3. 查询生成结果

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失败,可重试

4. 完整示例(Python)

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']}")

5. 价格

模型每次扣费
wan2.7-t2v150 quota
wan2.7-i2v150 quota