メインコンテンツへスキップ
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 が完了すると output 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