跳轉到主要內容
POST
使用此 Beta 版端點建立文字轉影片、圖片轉影片或影片轉影片工作。API 會立即傳回工作 ID,因此請儲存傳回的 id,並輪詢工作直到其達到終止狀態。 選擇與輸入模式相符的請求內容類型。將文字轉影片和圖片轉影片控制項作為 multipart/form-data 欄位傳送。將參考影片編輯作為 application/json 本體傳送。

選擇輸入模式

文字轉影片和圖片轉影片範例使用 model=omni-fast。影片轉影片範例使用 model=omni-fast-v2v。請使用 列出可用模型 以確認模型 ID 是否對您的 API 金鑰可見。

讓參考圖片動起來

對於圖片轉影片,請使用 model=omni-fast,並在 multipart 的 input_reference 欄位中上傳一個 PNG 檔案。此欄位對文字轉影片仍為選填,但當參考圖片應引導所產生的影片時則為必填。 請將 prompt 聚焦於要新增的動作,並明確指出結果應保留的色彩、形狀、主體或構圖。程式碼範例選擇器包含 Shell、Python 和 JavaScript 範例,這些範例會從工作目錄上傳 reference.png 並建立工作。 此請求格式涵蓋一個上傳的 PNG。它未定義 URL 輸入、其他圖片格式、多個參考圖片或檔案大小限制。

編輯參考影片

對於影片轉影片,請將本機 MP4 檔案編碼為 base64,並在編碼後的位元組前加上 data:video/mp4;base64,。在 video 欄位中傳送完整的資料 URL。 在 prompt 中描述所要求的變更。也請指出結果應保留的主體、物件、構圖或動作。程式碼範例選擇器包含 Shell、Python 和 JavaScript 範例,這些範例會從工作目錄讀取 reference.mp4。 此請求格式涵蓋內嵌 MP4 資料 URL。它未定義 URL 輸入、其他影片容器格式或檔案大小限制。

設定時長、比例與解析度

Omni 標示為 beta,因為生成穩定性可能會因輸入內容與所選路由而異。請先讓第一個請求保持精簡,然後在依賴特定的渲染時長或影格大小之前,檢查已完成的影片。 由於此端點為 beta,請將 aspect_ratio 和 resolution 視為生成偏好設定,並在依賴最終像素前驗證下載的 MP4。

任務流程

1

建立任務

使用所選輸入模式的內容類型傳送請求,並儲存傳回的 id。
2

輪詢任務

呼叫 擷取 Omni 影片 ,直到 status 為 completed 或 failed。
3

下載結果

當任務為 completed 時,呼叫 擷取 Omni 影片內容 以下載 MP4 檔案。

授權

Authorization
string
header
必填

Bearer authentication. Use your CometAPI API key.

主體

model
string
必填

Omni model ID for this endpoint. Use omni-fast for text-to-video and image-to-video.

範例:

"omni-fast"

prompt
string
必填

Text prompt that describes the video to generate. For image-to-video, focus on motion and name the reference content that should be preserved.

範例:

"Ocean waves rolling onto a sandy beach at golden hour"

input_reference
file

One PNG reference image uploaded as a multipart file. Optional for text-to-video and required for image-to-video. This contract does not define URL input, other image formats, multiple references, or a file-size limit.

seconds
string

Requested clip duration in seconds. The completed video can use a different duration.

範例:

"4"

aspect_ratio
enum<string>
預設值:16:9

Output aspect ratio preference. 16:9 and 9:16 are the most predictable; 1:1 can be accepted but may render as landscape.

可用選項:
16:9,
9:16,
1:1
範例:

"16:9"

resolution
string

Output resolution preference. Start with 720p. A request for 1080p can render at 720p.

範例:

"720p"

回應

200 - application/json

Task accepted. Store the returned id and poll GET /v1/videos/{task_id}.

id
string
必填

Task ID. Use this value with retrieve and content endpoints.

範例:

"task_example"

object
string
必填

Object type. Video tasks return video.

範例:

"video"

model
string
必填

Model ID used for the task.

範例:

"omni-fast"

status
enum<string>
必填

Task lifecycle status. Poll until the value is completed, failed, or error.

可用選項:
queued,
in_progress,
completed,
failed,
error
範例:

"queued"

progress
integer
必填

Task progress as a coarse percentage.

必填範圍: 0 <= x <= 100
範例:

0

created_at
integer
必填

Task creation time as a Unix timestamp in seconds.

範例:

1779938152

task_id
string

Compatibility alias for id when present.

範例:

"task_example"

completed_at
integer

Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.

範例:

1779938219

video_url
string

Temporary video delivery URL. This field appears on completed tasks.

範例:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.

最後修改於 2026年8月4日