Naar hoofdinhoud gaan
GET
/
replicate
/
v1
/
predictions
/
{id}
Query a Replicate prediction
curl --request GET \
  --url https://api.cometapi.com/replicate/v1/predictions/{id} \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "input": {},
  "model": "<string>",
  "output": [
    "<string>"
  ],
  "status": "<string>",
  "created_at": "<string>",
  "data_removed": true,
  "logs": "<string>",
  "urls": {
    "get": "<string>",
    "cancel": "<string>",
    "stream": "<string>"
  },
  "error": "<string>",
  "metrics": {
    "image_count": 123,
    "predict_time": 123
  },
  "version": "<string>",
  "started_at": "<string>",
  "completed_at": "<string>"
}

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.

Gebruik dit endpoint nadat je al een Replicate prediction id hebt. Het rapporteert de huidige taakstatus en retourneert output-URL’s wanneer de prediction is voltooid.

Controleer deze velden eerst

  • status om te zien of de prediction nog draait of al is voltooid
  • output voor gegenereerde asset-URL’s
  • error voor fouten aan de providerzijde
  • metrics wanneer je details over uitvoeringstijd of het aantal afbeeldingen nodig hebt

Pollingpatroon

1

Maak eerst de prediction aan

2

Poll op prediction id

Blijf query’s uitvoeren totdat status een eindstatus bereikt en output is gevuld of een providerfout wordt geretourneerd.
3

Voltooide assets opslaan

Behandel geretourneerde asset-URL’s als delivery-URL’s en verplaats ze naar je eigen opslag als je lange retentie nodig hebt.

Autorisaties

Authorization
string
header
vereist

Bearer token authentication. Use your CometAPI key.

Padparameters

id
string
vereist

Prediction id returned by the create endpoint.

Respons

200 - application/json

Current prediction state.

id
string
vereist
input
object
vereist
model
string
vereist
output
string[] | null
vereist
status
string
vereist
created_at
string
vereist
data_removed
boolean
vereist
logs
string
urls
object
error
string | null
metrics
object
version
string
started_at
string | null
completed_at
string | null