DeerAPI 旧版 Replicate 兼容生图接口文档:通过 POST /replicate/v1/predictions 兼容官方 Predictions.create 语义,适合已有旧代码迁移;新项目不建议优先从这里开始。
curl https://api.deerapi.com/replicate/v1/predictions \
-H "Authorization: Bearer <DEERAPI_KEY>" \
-H "Content-Type: application/json" \
-H "Prefer: wait=5" \
-d '{
"version": "black-forest-labs/flux-1.1-pro",
"input": {
"prompt": "A minimalist tea cup on white background",
"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 minimalist tea cup on white background"
},
"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"
}
}POST /v1/predictions 写的,并且短期内不方便改 URL 结构,可以继续使用这页;如果你是第一次接 DeerAPI,不建议把它当成首选入口。
POST /v1/predictions 的关键字段是 version,不是 model。这点很重要,很多旧迁移文档会把它写错。version + input 结构,但鉴权和域名改为 DeerAPI 的 Bearer Token + https://api.deerapi.com。POST /replicate/v1/predictions 的旧客户端。version,不要使用 model。Prefer: wait 只是可选等待头,不代表一定同步拿到最终图片;超时后仍然需要查询任务。output 很可能是 null,要等任务完成后再取结果。使用 DeerAPI Key 进行 Bearer Token 鉴权。
可选等待头。使用 wait=n 时,服务端会尽量等待最多 n 秒后再返回。即便设置了该头,也不能保证一定同步拿到最终图片。
"wait=5"
可选的自动取消时间,例如 5m、30s。
要运行的官方模型或具体版本 ID。对于 DeerAPI 当前接入的官方图片模型,通常可直接填写完整模型 ID。
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-pro, black-forest-labs/flux-kontext-max, black-forest-labs/flux-pro, black-forest-labs/flux-schnell 模型输入对象。具体字段由所选模型决定。
Show child attributes
异步通知地址。
start, output, logs, completed 任务已创建
starting, processing, succeeded, failed, canceled Show child attributes
api, web curl https://api.deerapi.com/replicate/v1/predictions \
-H "Authorization: Bearer <DEERAPI_KEY>" \
-H "Content-Type: application/json" \
-H "Prefer: wait=5" \
-d '{
"version": "black-forest-labs/flux-1.1-pro",
"input": {
"prompt": "A minimalist tea cup on white background",
"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 minimalist tea cup on white background"
},
"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"
}
}