Langsung ke konten utama
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
}
Gunakan endpoint ini untuk memulai task Runway reverse-format GEN-4 text-to-video.

Field yang diperlukan di CometAPI

  • callback_url saat ini wajib oleh wrapper
  • prompt, ratio, style, dan model menentukan permintaan generasi
  • options.seconds dan options.motion_vector diwajibkan oleh skema wrapper saat ini

Path request yang tervalidasi

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

Alur task

1

Buat task

Kirim request dan simpan task_id yang dikembalikan.
2

Poll route feed reverse-format

Lanjutkan dengan Feed Get Task untuk mengikuti status task.
3

Simpan asset yang selesai

Setelah URL video tersedia, pindahkan ke pipeline penyimpanan Anda sendiri.
Jika Anda menghilangkan callback_url, wrapper CometAPI saat ini mengembalikan callback_url_empty meskipun ini adalah API async berbasis task.

Otorisasi

Authorization
string
header
wajib

Bearer token authentication. Use your CometAPI key.

Header

X-Runway-Version
string

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

Body

application/json
callback_url
string
default:https://example.com/webhook
wajib

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

ratio
string
default:16:9
wajib

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

prompt
string
default:A cat sitting on a windowsill.
wajib

Text prompt describing the video content to generate.

style
string
default:cinematic
wajib

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

model
string
default:gen4
wajib

Model version to use, e.g. gen4.

options
object
wajib

Advanced generation options including duration and camera motion.

Respons

200 - application/json

OK

code
integer
wajib

HTTP status code or business status code

msg
string
wajib

Text description of the status code

data
object
wajib

Business data body containing detailed task information

exec_time
number
wajib

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