Перейти к основному содержанию
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"
  }
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

Используйте этот маршрут, чтобы запустить prediction в стиле Replicate в CometAPI и получить id prediction для последующего опроса.

Чеклист первого запроса

  • Помещайте каждый параметр model внутрь объекта input
  • Начните с black-forest-labs/flux-schnell для самого быстрого первого запроса
  • Оставьте первый запрос только текстовым, если вам специально не нужен input_image или input_images
  • Сохраните возвращенный id для проверки статуса

Поток задачи

1

Создание prediction

Отправьте path model ID и объект input через этот endpoint.
2

Сохраните id prediction

Сохраните возвращенный id, потому что он понадобится вам для последующего опроса.
3

Опрос prediction

Продолжайте с Replicate Query Status, пока 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