跳轉到主要內容
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 文字轉影片任務。

CometAPI 上的必要欄位

  • callback_url 目前為此封裝器必填
  • promptratiostylemodel 用於定義生成請求
  • options.secondsoptions.motion_vector 為目前封裝器 schema 的必填欄位

已驗證的請求路徑

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

任務流程

1

建立任務

提交請求並儲存回傳的 task_id
2

輪詢 reverse-format 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