跳转到主要内容
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 反向格式的 GEN-4 文生视频任务。

CometAPI 上的必填字段

  • 当前封装器要求必须提供 callback_url
  • promptratiostylemodel 用于定义生成请求
  • 当前封装器 schema 要求必须提供 options.secondsoptions.motion_vector

已验证的请求路径

  • Header: X-Runway-Version: 2024-11-06
  • Model: gen4_turbo
  • 响应:code: 200msg: 成功 以及 data.task_id

任务流程

1

创建任务

提交请求并保存返回的 task_id
2

轮询反向格式的 feed 路由

继续使用 Feed Get Task 跟踪任务状态。
3

持久化已完成的资源

当视频 URL 可用后,将其转存到你自己的存储流水线中。
如果省略 callback_url,当前 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