查詢任務狀態
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