Saltar para o conteúdo 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
}
Use este endpoint para iniciar uma tarefa de texto para vídeo GEN-4 no formato de compatibilidade do Runway.

Campos obrigatórios

  • callback_url é obrigatório
  • prompt, ratio, style e model definem a solicitação de geração
  • options.seconds e options.motion_vector são obrigatórios

Caminho de solicitação validado

  • Cabeçalho: X-Runway-Version: 2024-11-06
  • Model: gen4_turbo
  • Resposta: code: 200, msg: 成功 e data.task_id

Fluxo da tarefa

1

Criar a tarefa

Envie a solicitação e armazene o task_id retornado.
2

Consultar a rota de feed no formato de compatibilidade

Continue com Feed Get Task para acompanhar o estado da tarefa.
3

Persistir o asset concluído

Assim que uma URL de vídeo estiver disponível, mova-a para o seu próprio pipeline de armazenamento.

Autorizações

Authorization
string
header
obrigatório

Bearer token authentication. Use your CometAPI key.

Cabeçalhos

X-Runway-Version
string

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

Corpo

application/json
callback_url
string
padrão:https://example.com/webhook
obrigatório

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

ratio
string
padrão:16:9
obrigatório

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

prompt
string
padrão:A cat sitting on a windowsill.
obrigatório

Text prompt describing the video content to generate.

style
string
padrão:cinematic
obrigatório

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

model
string
padrão:gen4
obrigatório

Model version to use, e.g. gen4.

options
object
obrigatório

Advanced generation options including duration and camera motion.

Resposta

200 - application/json

OK

code
integer
obrigatório

HTTP status code or business status code

msg
string
obrigatório

Text description of the status code

data
object
obrigatório

Business data body containing detailed task information

exec_time
number
obrigatório

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