الانتقال إلى المحتوى الرئيسي
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
}
استخدم نقطة النهاية هذه لبدء مهمة تحويل النص إلى فيديو بصيغة التوافق GEN-4 من Runway.

الحقول المطلوبة

  • callback_url مطلوب
  • تحدد prompt وratio وstyle وmodel طلب الإنشاء
  • options.seconds وoptions.motion_vector مطلوبان

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

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

تدفق المهمة

1

إنشاء المهمة

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

استقصاء مسار feed بصيغة التوافق

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

الاحتفاظ بالأصل المكتمل

بمجرد توفر رابط URL للفيديو، انقله إلى مسار التخزين الخاص بك.

التفويضات

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