Перейти до основного вмісту
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 reverse-format GEN-4 text-to-video.

Обов’язкові поля в CometAPI

  • callback_url наразі є обов’язковим у wrapper
  • prompt, ratio, style і model визначають запит на генерацію
  • options.seconds і options.motion_vector є обов’язковими в поточній схемі wrapper

Перевірений шлях запиту

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

Потік виконання задачі

1

Створіть задачу

Надішліть запит і збережіть повернений task_id.
2

Опитуйте маршрут reverse-format feed

Продовжуйте з Feed Get Task, щоб відстежувати стан задачі.
3

Збережіть готовий asset

Щойно URL відео стане доступним, перемістіть його у власний pipeline зберігання.
Якщо ви пропустите callback_url, поточний wrapper 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