الانتقال إلى المحتوى الرئيسي
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"
  }
}

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.

استخدم هذا المسار لبدء prediction بأسلوب Replicate على CometAPI والحصول على prediction id للـ polling لاحقًا.

قائمة التحقق للطلب الأول

  • ضع كل معلمات model داخل الكائن input
  • ابدأ بـ black-forest-labs/flux-schnell للحصول على أسرع طلب أول
  • اجعل الطلب الأول نصيًا فقط ما لم تكن بحاجة تحديدًا إلى input_image أو input_images
  • احفظ قيمة id المُعادة للتحقق من الحالة

تدفق المهمة

1

إنشاء prediction

أرسل model ID الموجود في المسار والكائن input عبر هذا endpoint.
2

تخزين prediction id

احفظ id المُعاد، لأنك ستحتاج إليه في polling لاحقًا.
3

الاستعلام عن prediction

تابع إلى Replicate Query Status حتى تتم تعبئة output أو يظهر خطأ.

التفويضات

Authorization
string
header
مطلوب

Bearer token authentication. Use your CometAPI key.

معلمات المسار

models
string
مطلوب

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

الجسم

application/json
input
object
مطلوب

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

الاستجابة

200 - application/json

Prediction accepted.

id
string
مطلوب
model
string
مطلوب
input
object
مطلوب
output
string[] | null
مطلوب
error
string | null
مطلوب
status
string
مطلوب
created_at
string
مطلوب
urls
object
مطلوب
version
string
logs
string
data_removed
boolean
source
string