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