Passer au contenu principal
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
}
Utilisez ce endpoint pour démarrer une tâche texte vers vidéo GEN-4 au format de compatibilité Runway.

Champs requis

  • callback_url est requis
  • prompt, ratio, style et model définissent la requête de génération
  • options.seconds et options.motion_vector sont requis

Chemin de requête validé

  • En-tête : X-Runway-Version: 2024-11-06
  • Modèle : gen4_turbo
  • Réponse : code: 200, msg: 成功 et data.task_id

Flux de tâche

1

Créer la tâche

Soumettez la requête et stockez le task_id renvoyé.
2

Interroger la route feed au format de compatibilité

Continuez avec Feed Get Task pour suivre l’état de la tâche.
3

Conserver l’asset finalisé

Une fois qu’une URL de vidéo est disponible, déplacez-la vers votre propre pipeline de stockage.

Autorisations

Authorization
string
header
requis

Bearer token authentication. Use your CometAPI key.

En-têtes

X-Runway-Version
string

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

Corps

application/json
callback_url
string
défaut:https://example.com/webhook
requis

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

ratio
string
défaut:16:9
requis

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

prompt
string
défaut:A cat sitting on a windowsill.
requis

Text prompt describing the video content to generate.

style
string
défaut:cinematic
requis

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

model
string
défaut:gen4
requis

Model version to use, e.g. gen4.

options
object
requis

Advanced generation options including duration and camera motion.

Réponse

200 - application/json

OK

code
integer
requis

HTTP status code or business status code

msg
string
requis

Text description of the status code

data
object
requis

Business data body containing detailed task information

exec_time
number
requis

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