Skip to main content
POST
/
replicate
/
v1
/
models
/
{models}
/
predictions
cURL
curl https://api.deerapi.com/replicate/v1/models/black-forest-labs/flux-1.1-pro/predictions \
  -H "Authorization: Bearer <DEERAPI_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "prompt": "A red paper lantern on a wooden table, studio photo",
      "aspect_ratio": "1:1",
      "output_format": "jpg"
    }
  }'
{
  "id": "e6je4zpgdxrmw0cww2xsb0515g",
  "model": "black-forest-labs/flux-1.1-pro",
  "version": "hidden",
  "input": {
    "aspect_ratio": "1:1",
    "output_format": "jpg",
    "prompt": "A red paper lantern on a wooden table, studio photo"
  },
  "logs": "",
  "output": null,
  "data_removed": false,
  "error": null,
  "source": "api",
  "status": "starting",
  "created_at": "2026-03-12T06:28:50.927Z",
  "urls": {
    "cancel": "https://api.replicate.com/v1/predictions/e6je4zpgdxrmw0cww2xsb0515g/cancel",
    "get": "https://api.replicate.com/v1/predictions/e6je4zpgdxrmw0cww2xsb0515g",
    "stream": "https://stream.replicate.com/v1/files/example-stream",
    "web": "https://replicate.com/p/e6je4zpgdxrmw0cww2xsb0515g"
  }
}

概述

如果你希望继续使用 Replicate 风格的任务对象,但模型又集中在 FLUX 家族,这一页是最适合的新接入方式。相比 legacy 的 POST /replicate/v1/predictions,这里把模型 ID 放进 URL,更直观,也更接近 DeerAPI 当前推荐的兼容写法。

第一次调用建议

  1. 把完整模型 ID 放在 URL 中的 {models} 位置。
  2. 所有模型参数都放进 input 对象中。
  3. 创建成功后,使用 api/image/replicate/query-task.mdx 查询标准 Replicate 对象;如果你想统一查询 FLUX 与 Replicate 两种任务,也可以用 api/image/flux/query-task.mdx

DeerAPI 与官方文档的差异

  • Replicate 官方路径是 /v1/models/{owner}/{name}/predictions;DeerAPI 这里把完整模型 ID 合并成一个 {models} 路径参数,方便已有路由层直接拼接模型字符串。
  • 官方 Replicate 页面会列出对应模型的原生输入 schema;DeerAPI 只保证当前接入的那部分模型可用,不保证官网所有模型都可直接迁移。
  • DeerAPI 使用 Bearer Token,不使用 Replicate 官方 Token。

参数理解建议

  • 文生图模型最常见的是 input.promptinput.aspect_ratioinput.output_format
  • Kontext 类模型常用 input_imageinput_images 做图像编辑或参考图生成。
  • Ultra 类模型可能会额外用到 raw、更高分辨率或图像参考参数。
  • 创建任务时 output 通常先是 null,这不是报错,而是正常的异步状态。

与其他 DeerAPI 端点怎么选

  • 你想使用更短的模型 ID,例如 flux-pro-1.1,并接受 BFL 风格查询结果:看 api/image/flux/generate.mdx
  • 你已经使用 Replicate 风格对象并且只关心 FLUX:用这一页。
  • 你需要更通用的 Replicate 风格入口,不只限于 FLUX:看 api/image/replicate/create-task.mdx

参考文档

Authorizations

Authorization
string
header
required

使用 DeerAPI Key 进行 Bearer Token 鉴权。

Path Parameters

models
enum<string>
required

完整的 FLUX 模型 ID。

Available options:
black-forest-labs/flux-1.1-pro,
black-forest-labs/flux-1.1-pro-ultra,
black-forest-labs/flux-2-dev,
black-forest-labs/flux-2-flex,
black-forest-labs/flux-2-max,
black-forest-labs/flux-2-pro,
black-forest-labs/flux-dev,
black-forest-labs/flux-kontext-max,
black-forest-labs/flux-kontext-pro,
black-forest-labs/flux-pro,
black-forest-labs/flux-schnell

Body

application/json
input
object
required

模型输入对象。具体字段取决于所选 FLUX 模型。

webhook
string<uri>
webhook_events_filter
enum<string>[]
Available options:
start,
output,
logs,
completed

Response

200 - application/json

任务已创建

id
string
required
input
object
required
status
enum<string>
required
Available options:
starting,
processing,
succeeded,
failed,
canceled
created_at
string<date-time>
required
urls
object
required
data_removed
boolean
required
model
string
version
string
logs
string | null
output
error
source
enum<string>
Available options:
api,
web
metrics
object
started_at
string<date-time> | null
completed_at
string<date-time> | null