查询任务状态
GET https://api.ofox.io/v1/videos/{id}查询任务的状态与结果。创建任务后,轮询此端点直到 status 进入终态——completed、failed、cancelled 或 expired。
Terminal
curl https://api.ofox.io/v1/videos/9bcf3c60-7db2-4e1a-a1b2-c3d4e5f60718 \
-H "Authorization: Bearer $OFOX_API_KEY"限流保护
本端点按 API Key 独立限流(默认 5 req/s、突发 20)。超限返回 429 rate_limited,并带 Retry-After: 1 响应头。创建(POST)与取消(DELETE)不受此限流影响。
建议轮询间隔不快于每秒一次,或在创建任务时传 callback_url,用 webhook 代替轮询。
响应
已完成
{
"id": "9bcf3c60-7db2-4e1a-a1b2-c3d4e5f60718",
"status": "completed",
"model": "bytedance/seedance-2.5",
"prompt": "A golden retriever running on the beach at sunset",
"unsigned_urls": ["https://upstream.example/out.mp4"],
"mirror_urls": ["https://cdn.ofox.io/videos/vgen_xxx.mp4?sig=..."],
"usage": {
"video_seconds": 5,
"video_cost": "0.4000000000"
},
"created_at": 1776211362,
"updated_at": 1776211400
}超时会以 status: "failed" 上报,且 error.code 为 expired。完整错误码见 错误码。
Video 任务对象
状态机
7 个状态,以 OpenRouter 命名为基底并补充 cancelled / expired。
流转:pending → queued → in_progress → completed 为成功路径。任意非终态可转 failed、cancelled 或 expired。
视频 URL
成功任务可能返回两组 URL,取决于该模型 provider 是否启用 CDN 镜像。
优先使用 mirror_urls(持久、稳定)。当模型只返回 unsigned_urls 时,请尽快下载或转存,避免上游临时地址过期。
Last updated on