Skip to main content
POST
使用此端點可從文字,或文字加上一張參考圖片,啟動 Sora 渲染工作。API 會立即回傳影片 id,且不會等待渲染完成。

從最小且實用的任務開始

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

時長與尺寸

Sora 要求 size 欄位必須採用精確的 WxH 格式。像 720p 這類解析度標記,以及像 16:9 這類比例標籤,都不是此端點上有效的 Sora size 值。

端到端流程

1

建立渲染工作

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

輪詢直到工作完成

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

下載結果

當渲染完成後,使用 擷取影片內容 取得檔案。

仍然適用的 Sora 行為

OpenAI 在 Videos API 中記錄了相同的 create -> retrieve -> download 流程。在 CometAPI 上,你可以保留 Sora 的請求結構,但要使用 CometAPI 的基底 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 an available model from the Models page.

範例:

"sora-2"

seconds
enum<string>
預設值:4

Clip duration in seconds. Use 4, 8, 12, 16, or 20.

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

"4"

size
enum<string>
預設值:1280x720

Output resolution formatted as width x height. Use 1280x720 or 720x1280 for standard Sora output. Use 1792x1024 or 1024x1792 with a Pro model when you need larger Pro output.

可用選項:
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
必填