Перейти до основного вмісту
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"
  }
}
Використовуйте цей маршрут, щоб запустити prediction у стилі Replicate в CometAPI і отримати id prediction для подальшого опитування.

Чекліст першого запиту

  • Помістіть кожен параметр model всередину об’єкта input
  • Почніть із black-forest-labs/flux-schnell для найлегшого початкового smoke test
  • Залишайте перший запит лише текстовим, якщо вам спеціально не потрібні input_image або input_images
  • Збережіть повернений id для перевірок status

Потік виконання

1

Створіть prediction

Надішліть path id model і об’єкт input через цей endpoint.
2

Збережіть id prediction

Збережіть повернений id, оскільки він знадобиться для подальшого опитування.
3

Опитуйте prediction

Продовжуйте з Replicate Query Status, доки output не буде заповнено або не з’явиться помилка.
Перевірка в реальному часі 2026-03-12 підтвердила, що black-forest-labs/flux-schnell прийняв лише текстовий запит і повернув id prediction зі status starting.

Авторизації

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