官方 API
建立影片
使用 POST /v1/videos 從文字 Prompt 或參考圖片建立 Sora 2 影片生成任務,接著可依任務 ID 輪詢狀態以取得結果。
POST
Create a Sora video job
使用此端點可從文字,或從文字加上一張參考圖片,啟動新的 Sora 渲染任務。API 會立即回傳影片 id,不會等待渲染完成。Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
從最小且實用的任務開始
- 使用
sora-2以加快迭代速度,或在輸出品質比速度更重要時使用sora-2-pro - 第一個請求請將
seconds設為4 - 除非你明確需要直式輸出,否則請先使用
size: 1280x720 - 最多上傳一張參考圖片
端到端流程
輪詢直到任務完成
呼叫 擷取影片,直到狀態變為
completed 或 failed。仍然適用的 Sora 行為
OpenAI 在 Videos API 中記錄了相同的 create -> retrieve -> download 流程。在 CometAPI 上,你會保留 Sora 的請求格式,但使用 CometAPI 的 base URL 和金鑰。已完成的下載 URL 是暫時性的,因此若你需要長期保存,請將已完成的資產複製到你自己的儲存空間中。授權
Bearer token authentication. Use your CometAPI key.
主體
multipart/form-data
Text prompt that describes the video you want to create.
範例:
"A paper airplane glides across a desk."
Sora model ID. Choose a current model from the Models page.
範例:
"sora-2"
Clip duration in seconds.
可用選項:
4, 8, 12 範例:
"4"
Output resolution formatted as width x height.
可用選項:
720x1280, 1280x720, 1024x1792, 1792x1024 範例:
"1280x720"
Optional reference image uploaded as a file. The image should match the target size you request.