메인 콘텐츠로 건너뛰기
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.

이 엔드포인트는 이미 Replicate prediction id를 가지고 있을 때 사용합니다. 현재 작업 상태를 보고하며 prediction이 완료되면 출력 URL을 반환합니다.

먼저 확인할 필드

  • prediction이 아직 실행 중인지 이미 완료되었는지 확인하려면 status
  • 생성된 에셋 URL은 output
  • 제공자 측 실패는 error
  • 실행 시간이나 이미지 개수 세부 정보가 필요할 때는 metrics

폴링 패턴

1

먼저 prediction 생성

Create Predictions - General부터 시작하세요.
2

prediction id로 폴링

status가 종료 상태가 되고 output이 채워지거나 제공자 오류가 반환될 때까지 계속 조회하세요.
3

완료된 에셋 저장

반환된 에셋 URL은 전달용 URL로 간주하고, 장기 보관이 필요하다면 자체 스토리지로 옮기세요.

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

경로 매개변수

id
string
필수

Prediction id returned by the create endpoint.

응답

200 - application/json

Current prediction state.

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