Przejdź do głównej treści
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
}
Użyj tego endpointu, aby rozpocząć zadanie Runway reverse-format GEN-4 text-to-video.

Wymagane pola w CometAPI

  • callback_url jest obecnie wymagane przez wrapper
  • prompt, ratio, style i model definiują żądanie generowania
  • options.seconds i options.motion_vector są wymagane przez bieżący schemat wrappera

Zweryfikowana ścieżka żądania

  • Header: X-Runway-Version: 2024-11-06
  • Model: gen4_turbo
  • Odpowiedź: code: 200, msg: 成功 oraz data.task_id

Przepływ zadania

1

Utwórz zadanie

Wyślij żądanie i zapisz zwrócone task_id.
2

Odpytuj ścieżkę feed reverse-format

Kontynuuj z Feed Get Task, aby śledzić stan zadania.
3

Zapisz gotowy zasób

Gdy adres URL wideo będzie dostępny, przenieś go do własnego pipeline’u storage.
Jeśli pominiesz callback_url, bieżący wrapper CometAPI zwróci callback_url_empty, mimo że jest to asynchroniczne API oparte na zadaniach.

Autoryzacje

Authorization
string
header
wymagane

Bearer token authentication. Use your CometAPI key.

Nagłówki

X-Runway-Version
string

Optional Runway API version header, for example 2024-11-06.

Treść

application/json
callback_url
string
domyślnie:https://example.com/webhook
wymagane

Webhook URL that receives a POST request with the result when the task completes.

ratio
string
domyślnie:16:9
wymagane

Aspect ratio of the generated video, e.g. 16:9, 9:16, 1:1.

prompt
string
domyślnie:A cat sitting on a windowsill.
wymagane

Text prompt describing the video content to generate.

style
string
domyślnie:cinematic
wymagane

Artistic style for the generated video, e.g. cinematic.

model
string
domyślnie:gen4
wymagane

Model version to use, e.g. gen4.

options
object
wymagane

Advanced generation options including duration and camera motion.

Odpowiedź

200 - application/json

OK

code
integer
wymagane

HTTP status code or business status code

msg
string
wymagane

Text description of the status code

data
object
wymagane

Business data body containing detailed task information

exec_time
number
wymagane

Execution time of the API interface itself (in seconds), does not represent the total video generation time