跳轉到主要內容
POST
/
v1
/
videos
Create a Sora video job
curl --request POST \
  --url https://api.cometapi.com/v1/videos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'prompt=A paper airplane glides across a desk.' \
  --form input_reference='@example-file'
{
  "created_at": 1773296991,
  "id": "video_69b25d5f467c81908733a56bc236b4df",
  "model": "sora-2",
  "object": "video",
  "progress": 0,
  "seconds": "4",
  "size": "1280x720",
  "status": "queued"
}
使用此端點可從文字,或從文字加上一張參考圖片,啟動新的 Sora 渲染任務。API 會立即回傳影片 id,不會等待渲染完成。

從最小且實用的任務開始

  • 使用 sora-2 以加快迭代速度,或在輸出品質比速度更重要時使用 sora-2-pro
  • 第一個請求請將 seconds 設為 4
  • 除非你明確需要直式輸出,否則請先使用 size: 1280x720
  • 最多上傳一張參考圖片

端到端流程

1

建立渲染任務

傳送 modelpromptsecondssize,然後儲存回傳的 id
2

輪詢直到任務完成

呼叫 擷取影片,直到狀態變為 completedfailed
3

下載或混製結果

當渲染完成後,使用 擷取影片內容 取得檔案。若你想要有針對性的變體,可對已完成的結果使用 混製影片

仍然適用的 Sora 行為

OpenAI 在 Videos API 中記錄了相同的 create -> retrieve -> download 流程。在 CometAPI 上,你會保留 Sora 的請求格式,但使用 CometAPI 的 base URL 和金鑰。已完成的下載 URL 是暫時性的,因此若你需要長期保存,請將已完成的資產複製到你自己的儲存空間中。

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

主體

multipart/form-data
prompt
string
必填

Text prompt that describes the video you want to create.

範例:

"A paper airplane glides across a desk."

model
string
預設值:sora-2

Sora model ID. Choose a current model from the Models page.

範例:

"sora-2"

seconds
enum<string>
預設值:4

Clip duration in seconds.

可用選項:
4,
8,
12
範例:

"4"

size
enum<string>
預設值:1280x720

Output resolution formatted as width x height.

可用選項:
720x1280,
1280x720,
1024x1792,
1792x1024
範例:

"1280x720"

input_reference
file

Optional reference image uploaded as a file. The image should match the target size you request.

回應

200 - application/json

Video job accepted.

created_at
integer
必填
id
string
必填
model
string
必填
object
string
必填
progress
integer
必填
seconds
string
必填
size
string
必填
status
string
必填