Перейти к основному содержанию
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
}
Используйте этот endpoint, чтобы запустить задачу Runway compatibility-format GEN-4 text-to-video.

Обязательные поля

  • callback_url обязателен
  • prompt, ratio, style и model определяют запрос на генерацию
  • options.seconds и options.motion_vector обязательны

Проверенный путь запроса

  • Заголовок: X-Runway-Version: 2024-11-06
  • Модель: gen4_turbo
  • Ответ: code: 200, msg: 成功 и data.task_id

Поток задачи

1

Создать задачу

Отправьте запрос и сохраните возвращённый task_id.
2

Опрашивать маршрут ленты compatibility-format

Продолжите с Feed Get Task, чтобы отслеживать состояние задачи.
3

Сохранить готовый asset

Как только 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