Skip to content

提交视频生成任务

POST https://az.gptplus5.com/runwayml/v1/image_to_video

官方文档:https://docs.dev.runwayml.com/api/#tag/Start-generating/paths/~1v1~1image_to_video/post

请求参数

Authorization

在 Header 添加参数Authorization,其值为在 Bearer 之后拼接 Token

示例:Authorization: Bearer ********************

Header 参数

参数名类型必需说明示例
Content-Typestring必需application/json
Acceptstring必需application/json
Authorizationstring必需Bearer {{YOUR_API_KEY}}

Body 参数 (application/json)

参数名类型必需说明
promptImagestring必需必填,HTTPS URL或数据URI,包含编码图像作为生成视频的第一帧
modelstring必需必填,指定使用的模型变体,可选值:"gen4_turbo"或"gen3a_turbo"
ratiostring必需必填,输出视频分辨率,格式为"宽度:高度",不同模型支持不同分辨率
seedinteger必需可选,随机种子值(0-4294967295),相同种子对相同请求产生相似结果
promptTextstring必需可选,字符串(≤1000字符),详细描述期望在视频中出现的内容
durationinteger必需可选,视频时长(秒),可选值:5或10,默认为10

请求示例

json
{
    "promptImage": "https://www.bt.cn/bbs/template/qiao/style/image/btlogo.png",
    "model": "gen4_turbo",
    "promptText": "cat dance",
    "watermark": false,
    "duration": 5,
    "ratio": "1280:768"
}

cURL 示例

bash
curl --location --request POST 'https://az.gptplus5.com/runwayml/v1/image_to_video' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "promptImage": "https://www.bt.cn/bbs/template/qiao/style/image/btlogo.png",
    "model": "gen4_turbo",
    "promptText": "cat dance",
    "watermark": false,
    "duration": 5,
    "ratio": "1280:768"
}'

返回响应

🟢200成功

响应 Body

参数名类型必需说明
codeinteger必需
messagestring必需
request_idstring必需
dataobject必需
  └ task_idstring必需
  └ task_statusstring必需
  └ created_atinteger必需
  └ updated_atinteger必需

响应示例

json
{
    "id": "4665a07c-7641-4809-a133-10786201bb56",
    "prompt": "",
    "state": "pending",
    "queue_state": null,
    "created_at": "2024-12-22T13:38:40.139409Z",
    "batch_id": "",
    "video": null,
    "video_raw": null,
    "liked": null,
    "estimate_wait_seconds": null,
    "thumbnail": null,
    "last_frame": null
}