Zum Hauptinhalt springen
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"
  }
}
Verwenden Sie diese Route, um auf CometAPI eine Prediction im Replicate-Stil zu starten und eine prediction id für späteres Polling zurückzubekommen.

Checkliste für die erste Anfrage

  • Platzieren Sie jeden Modellparameter innerhalb des input-Objekts
  • Beginnen Sie mit black-forest-labs/flux-schnell für den leichtesten Smoke-Test
  • Halten Sie die erste Anfrage nur textbasiert, es sei denn, Sie benötigen ausdrücklich input_image oder input_images
  • Speichern Sie die zurückgegebene prediction id für Statusprüfungen

Task-Ablauf

1

Prediction erstellen

Senden Sie die Modell-id im Pfad und das input-Objekt über diesen Endpoint.
2

Prediction-id speichern

Speichern Sie die zurückgegebene id, da Sie sie für späteres Polling benötigen.
3

Prediction abfragen

Fahren Sie mit Replicate Query Status fort, bis output befüllt ist oder ein Fehler erscheint.
Die Live-Validierung am 2026-03-12 hat bestätigt, dass black-forest-labs/flux-schnell eine nur textbasierte Anfrage akzeptiert und eine prediction id mit dem Status starting zurückgegeben hat.

Autorisierungen

Authorization
string
header
erforderlich

Bearer token authentication. Use your CometAPI key.

Pfadparameter

models
string
erforderlich

Replicate model id, for example black-forest-labs/flux-schnell or black-forest-labs/flux-kontext-pro.

Body

application/json
input
object
erforderlich

Provider-specific model input. Keep all parameters inside this object.

Antwort

200 - application/json

Prediction accepted.

id
string
erforderlich
model
string
erforderlich
input
object
erforderlich
output
string[] | null
erforderlich
error
string | null
erforderlich
status
string
erforderlich
created_at
string
erforderlich
urls
object
erforderlich
version
string
logs
string
data_removed
boolean
source
string