Przejdź do głównej treści
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.

Użyj tego endpointu, gdy masz już id predykcji Replicate. Zgłasza on bieżący stan zadania i zwraca adresy URL wyników po zakończeniu predykcji.

Najpierw sprawdź te pola

  • status, aby sprawdzić, czy predykcja nadal trwa, czy już się zakończyła
  • output dla adresów URL wygenerowanych zasobów
  • error dla błędów po stronie dostawcy
  • metrics, gdy potrzebujesz informacji o czasie wykonania lub liczbie obrazów

Wzorzec odpytywania

1

Najpierw utwórz predykcję

2

Odpytuj według id predykcji

Kontynuuj zapytania, aż status osiągnie stan końcowy, a output zostanie uzupełnione lub zostanie zwrócony błąd dostawcy.
3

Zachowaj gotowe zasoby

Traktuj zwrócone adresy URL zasobów jako adresy dostarczenia i przenieś je do własnej pamięci masowej, jeśli potrzebujesz długiego okresu przechowywania.

Autoryzacje

Authorization
string
header
wymagane

Bearer token authentication. Use your CometAPI key.

Parametry ścieżki

id
string
wymagane

Prediction id returned by the create endpoint.

Odpowiedź

200 - application/json

Current prediction state.

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