直接回答

这页说明团队如何使用 NextModel 的 OpenAI 兼容网关。 提交视频任务、轮询结果,参考图支持 URL 或内联 data URI。 这一页会补充接入步骤、配置重点和常见问题。

提交与轮询

POST /v1/video/generations 返回 202 与任务 id;轮询 GET /v1/video/jobs/{id} 直到 succeeded 或 failed。失败任务全额退款。

curl
curl https://api.nextmodel.app/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $NEXTMODEL_API_KEY" \
  -d '{"model":"qwen/wan2.7-i2v-glb","prompt":"A cat walking","duration_seconds":2,"resolution":"720P","image_url":"https://example.com/reference.png"}'

# Poll the job id from the response until status is succeeded/failed:
curl https://api.nextmodel.app/v1/video/jobs/<JOB_ID> -H "Authorization: Bearer $NEXTMODEL_API_KEY"
Python
# pip install requests
import os, time, requests

BASE = "https://api.nextmodel.app"
HEADERS = {"Authorization": "Bearer " + os.environ["NEXTMODEL_API_KEY"]}

job = requests.post(f"{BASE}/v1/video/generations", headers=HEADERS, json={
    "model": "qwen/wan2.7-i2v-glb", "prompt": "A cat walking",
    "duration_seconds": 2, "resolution": "720P",
    "image_url": "https://example.com/reference.png",
}).json()
job_id = job["id"]
while True:
    job = requests.get(f"{BASE}/v1/video/jobs/{job_id}", headers=HEADERS).json()
    if job["status"] in ("succeeded", "failed"):
        break
    time.sleep(10)
print(job.get("video", {}).get("url") or job.get("error"))

参考图:URL 或 data URI

image_url 接受 http(s) URL(可达性由调用方负责)或原样透传的 data:image/*;base64,<payload>。上限:单图 10MB、请求合计 10MB,超限返回 inline_image_too_large。内联图片完全无需抓取。

分辨率与计费

视频 SKU 按你传入的分辨率档位对输出秒数计费;只有模型目录页列出的档位可计费,未列出的档位会在产生任何花费前被拒绝。