Skip to main content
POST
cURL
使用這個路由可在 CometAPI 上啟動一個 Replicate 風格的 prediction,並取得之後可用於輪詢的 prediction id。

首次請求檢查清單

  • 將每個模型參數都放在 input 物件內
  • 第一次請求先使用 black-forest-labs/flux-schnell,以便最快完成初次請求
  • 除非你明確需要 input_imageinput_images,否則第一次請求請僅使用文字
  • 儲存回傳的 prediction id 以供狀態檢查

任務流程

1

建立 prediction

透過此端點提交路徑 model id 與 input 物件。
2

儲存 prediction id

儲存回傳的 id,因為之後輪詢時會需要它。
3

輪詢 prediction

繼續閱讀 取得 Replicate prediction,直到 output 出現內容或發生錯誤。

授權

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

路徑參數

models
string
必填

Replicate model id, for example black-forest-labs/flux-schnell or black-forest-labs/flux-kontext-pro.

主體

application/json
input
object
必填

Provider-specific model input. Keep all parameters inside this object.

回應

200 - application/json

Prediction accepted.

id
string
必填
model
string
必填
input
object
必填
output
string[] | null
必填
error
string | null
必填
status
string
必填
created_at
string
必填
urls
object
必填
version
string
logs
string
data_removed
boolean
source
string