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

必填欄位

  • callback_url 為必填
  • promptratiostylemodel 用於定義生成請求
  • options.secondsoptions.motion_vector 為必填

已驗證的請求路徑

  • Header:X-Runway-Version: 2024-11-06
  • 模型:gen4_turbo
  • 回應:code: 200msg: 成功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