الانتقال إلى المحتوى الرئيسي
POST
/
runway
/
pro
/
generate
generate(text)
curl --request POST \
  --url https://api.cometapi.com/runway/pro/generate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "callback_url": "http://baidu.com",
  "ratio": "16:9",
  "prompt": "a cat",
  "style": "cinematic",
  "model": "gen4",
  "options": {
    "seconds": 10,
    "motion_vector": {
      "x": 0,
      "y": 0.3999999999999999,
      "z": 0,
      "r": -6,
      "bg_x_pan": 0,
      "bg_y_pan": 0
    }
  }
}
'
{
  "code": 123,
  "msg": "<string>",
  "data": {
    "task_id": "<string>"
  },
  "exec_time": 123
}
استخدم نقطة النهاية هذه لبدء مهمة Runway reverse-format من نوع GEN-4 text-to-video.

الحقول المطلوبة في CometAPI

  • callback_url مطلوب حاليًا من قبل الـ wrapper
  • prompt وratio وstyle وmodel تحدد طلب الإنشاء
  • options.seconds وoptions.motion_vector مطلوبان وفقًا لمخطط الـ wrapper الحالي

مسار الطلب الذي تم التحقق منه

  • Header: X-Runway-Version: 2024-11-06
  • Model: gen4_turbo
  • Response: code: 200 وmsg: 成功 وdata.task_id

تدفق المهمة

1

إنشاء المهمة

أرسل الطلب وخزّن قيمة task_id المُعادة.
2

الاستعلام عن مسار feed بصيغة reverse-format

تابع باستخدام Feed Get Task لمراقبة حالة المهمة.
3

حفظ الأصل النهائي

بمجرد توفر رابط الفيديو، انقله إلى مسار التخزين الخاص بك.
إذا حذفت callback_url، فإن wrapper الحالي في CometAPI يعيد callback_url_empty رغم أن هذه واجهة API غير متزامنة قائمة على المهام.

التفويضات

Authorization
string
header
مطلوب

Bearer token authentication. Use your CometAPI key.

الترويسات

X-Runway-Version
string

Optional Runway API version header, for example 2024-11-06.

الجسم

application/json
callback_url
string
افتراضي:https://example.com/webhook
مطلوب

Webhook URL that receives a POST request with the result when the task completes.

ratio
string
افتراضي:16:9
مطلوب

Aspect ratio of the generated video, e.g. 16:9, 9:16, 1:1.

prompt
string
افتراضي:A cat sitting on a windowsill.
مطلوب

Text prompt describing the video content to generate.

style
string
افتراضي:cinematic
مطلوب

Artistic style for the generated video, e.g. cinematic.

model
string
افتراضي:gen4
مطلوب

Model version to use, e.g. gen4.

options
object
مطلوب

Advanced generation options including duration and camera motion.

الاستجابة

200 - application/json

OK

code
integer
مطلوب

HTTP status code or business status code

msg
string
مطلوب

Text description of the status code

data
object
مطلوب

Business data body containing detailed task information

exec_time
number
مطلوب

Execution time of the API interface itself (in seconds), does not represent the total video generation time