Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
通过存储任务 ID、检查任务状态以及处理回调投递失败,使用轮询和 webhook 跟踪 CometAPI 视频生成。
curl https://api.cometapi.com/v1/videos \ -H "Authorization: Bearer $COMETAPI_KEY" \ -F "model=doubao-seedance-2-0" \ -F "prompt=A cinematic shot of a paper airplane crossing a desk"
{ "id": "task_example", "task_id": "task_example", "object": "video", "model": "doubao-seedance-2-0", "status": "queued", "progress": 0, "created_at": 1779872000 }
curl https://api.cometapi.com/v1/videos/task_example \ -H "Authorization: Bearer $COMETAPI_KEY"
video_url
/v1/videos/{id}/content
{ "id": "task_example", "object": "video", "model": "doubao-seedance-2-0", "status": "completed", "progress": 100, "completed_at": 1779872300, "video_url": "<generated-video-url>" }
import express from "express"; const app = express(); app.use(express.json({ limit: "2mb" })); app.post("/cometapi/video-webhook", async (request, response) => { const event = request.body; console.log("Task ID:", event.task_id || event.id); console.log("Status:", event.status); response.status(200).json({ received: true }); }); app.listen(3000);
{ "task_id": "task_example", "status": "completed", "progress": 100, "result": { "video_url": "https://example.com/result.mp4" } }
2xx