Vai al contenuto principale
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
}
Usa questo endpoint per avviare un task text-to-video GEN-4 in formato inverso di Runway.

Campi obbligatori su CometAPI

  • callback_url è attualmente richiesto dal wrapper
  • prompt, ratio, style e model definiscono la richiesta di generazione
  • options.seconds e options.motion_vector sono richiesti dallo schema del wrapper attuale

Percorso della richiesta convalidato

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

Flusso del task

1

Crea il task

Invia la richiesta e memorizza il task_id restituito.
2

Interroga la route del feed in formato inverso

Prosegui con Feed Get Task per seguire lo stato del task.
3

Salva l'asset completato

Una volta disponibile un URL del video, spostalo nella tua pipeline di storage.
Se ometti callback_url, l’attuale wrapper CometAPI restituisce callback_url_empty anche se questa è un’API asincrona basata su task.

Autorizzazioni

Authorization
string
header
obbligatorio

Bearer token authentication. Use your CometAPI key.

Intestazioni

X-Runway-Version
string

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

Corpo

application/json
callback_url
string
predefinito:https://example.com/webhook
obbligatorio

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

ratio
string
predefinito:16:9
obbligatorio

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

prompt
string
predefinito:A cat sitting on a windowsill.
obbligatorio

Text prompt describing the video content to generate.

style
string
predefinito:cinematic
obbligatorio

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

model
string
predefinito:gen4
obbligatorio

Model version to use, e.g. gen4.

options
object
obbligatorio

Advanced generation options including duration and camera motion.

Risposta

200 - application/json

OK

code
integer
obbligatorio

HTTP status code or business status code

msg
string
obbligatorio

Text description of the status code

data
object
obbligatorio

Business data body containing detailed task information

exec_time
number
obbligatorio

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