メインコンテンツへスキップ
POST
/
replicate
/
v1
/
models
/
{models}
/
predictions
Create a Replicate prediction
curl --request POST \
  --url https://api.cometapi.com/replicate/v1/models/{models}/predictions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "input": {
    "prompt": "A paper boat floating on calm water at sunrise.",
    "aspect_ratio": "1:1",
    "output_format": "webp",
    "output_quality": 80
  }
}
'
{
  "id": "q4chw5rey9rmt0cww76t4h3ma4",
  "model": "black-forest-labs/flux-schnell",
  "version": "hidden",
  "input": {
    "aspect_ratio": "1:1",
    "output_format": "webp",
    "output_quality": 80,
    "prompt": "A paper boat floating on calm water at sunrise."
  },
  "logs": "",
  "output": null,
  "data_removed": false,
  "error": null,
  "source": "api",
  "status": "starting",
  "created_at": "2026-03-12T11:27:18.258Z",
  "urls": {
    "cancel": "https://api.replicate.com/v1/predictions/q4chw5rey9rmt0cww76t4h3ma4/cancel",
    "get": "https://api.replicate.com/v1/predictions/q4chw5rey9rmt0cww76t4h3ma4",
    "stream": "https://stream.replicate.com/v1/files/example",
    "web": "https://replicate.com/p/q4chw5rey9rmt0cww76t4h3ma4"
  }
}
このルートを使用すると、CometAPI で Replicate スタイルの prediction を開始し、後でポーリングするための prediction id を取得できます。

最初のリクエストのチェックリスト

  • すべての model パラメータを input オブジェクト内に入れる
  • 最も軽いスモークテストには black-forest-labs/flux-schnell から始める
  • 特に input_image または input_images が必要でない限り、最初のリクエストはテキストのみで行う
  • ステータス確認のために返された prediction id を保存する

タスクの流れ

1

prediction を作成

このエンドポイントを通じて、パス model id と input オブジェクトを送信します。
2

prediction id を保存

後でポーリングに必要になるため、返された id を保存します。
3

prediction をポーリング

output が入るかエラーが表示されるまで、Replicate ステータス照会 に進んでください。
2026-03-12 のライブ検証では、black-forest-labs/flux-schnell がテキストのみのリクエストを受け付け、ステータス starting の prediction id を返すことが確認されました。

承認

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