Zum Hauptinhalt springen
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
}
Verwenden Sie diesen Endpunkt, um eine Runway-Reverse-Format-GEN-4-Text-zu-Video-Aufgabe zu starten.

Erforderliche Felder in CometAPI

  • callback_url ist derzeit für den Wrapper erforderlich
  • prompt, ratio, style und model definieren die Generierungsanfrage
  • options.seconds und options.motion_vector sind für das aktuelle Wrapper-Schema erforderlich

Validierter Anfragepfad

  • Header: X-Runway-Version: 2024-11-06
  • Modell: gen4_turbo
  • Antwort: code: 200, msg: 成功 und data.task_id

Aufgabenablauf

1

Aufgabe erstellen

Senden Sie die Anfrage und speichern Sie die zurückgegebene task_id.
2

Die Reverse-Format-Feed-Route abfragen

Fahren Sie mit Feed Get Task fort, um den Aufgabenstatus zu verfolgen.
3

Das fertige Asset speichern

Sobald eine Video-URL verfügbar ist, verschieben Sie sie in Ihre eigene Storage-Pipeline.
Wenn Sie callback_url weglassen, gibt der aktuelle CometAPI-Wrapper callback_url_empty zurück, obwohl dies eine aufgabenbasierte asynchrone API ist.

Autorisierungen

Authorization
string
header
erforderlich

Bearer token authentication. Use your CometAPI key.

Header

X-Runway-Version
string

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

Body

application/json
callback_url
string
Standard:https://example.com/webhook
erforderlich

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

ratio
string
Standard:16:9
erforderlich

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

prompt
string
Standard:A cat sitting on a windowsill.
erforderlich

Text prompt describing the video content to generate.

style
string
Standard:cinematic
erforderlich

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

model
string
Standard:gen4
erforderlich

Model version to use, e.g. gen4.

options
object
erforderlich

Advanced generation options including duration and camera motion.

Antwort

200 - application/json

OK

code
integer
erforderlich

HTTP status code or business status code

msg
string
erforderlich

Text description of the status code

data
object
erforderlich

Business data body containing detailed task information

exec_time
number
erforderlich

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