跳转到主要内容
POST
cURL
使用 gen4.5 根据文本 Prompt 生成视频。通过 Bearer 身份验证发送您的 CometAPI API 密钥和 JSON 请求正文。

准备请求

  • 将 model 设为 gen4.5。
  • 在 promptText 中描述场景和动作,长度为 1 到 1,000 个 UTF-16 代码单元。
  • 将 ratio 设为 1280:720 以生成横向视频,或设为 720:1280 以生成纵向视频。
  • 将 duration 设为介于 2 到 10 秒之间的整数。
这四个字段均为必填项。若要从图像开始,请使用 创建 Runway 图像转视频任务. 请勿在此文本转视频请求中包含 promptImage 或 audio 开关。

设置可选控件

如需指定采样种子,请使用 1 到 4294967295。省略该字段或设为 0 会选择随机种子。如果包含 contentModeration,请将其 publicFigureThreshold 设为 auto 或 low;否则请省略该对象。 使用 outputFormat 选择 MP4、ProRes、PNG 序列或 HDR 格式之一,具体格式请参阅请求架构。若要使用 H.264 MP4,请省略此项。仅当 proresProfile 为 outputFormat 或 prores 时,才能设置该字段。”,“s0021”:“HDR ProRes 格式接受 hdr_prores、 HDR ProRes 格式接受 422、422 HQ 或 4444。

获取结果

保存返回的 id,并使用 获取 Runway 任务. 当 status 为 SUCCEEDED 时,读取 output 中的视频 URL。

授权

Authorization
string
header
必填

Use your CometAPI API key.

请求体

application/json

Request parameters for gen4.5.

model
enum<string>
必填

Model ID for this request variant.

可用选项:
gen4.5
Allowed value: "gen4.5"
promptText
string
必填

Describe the requested scene or motion in 1 to 1,000 UTF-16 code units.

Required string length: 1 - 1000
ratio
enum<string>
必填

Requested output dimensions, expressed as width:height. Choose a value listed for this model and endpoint.

可用选项:
1280:720,
720:1280
duration
integer
必填

Requested video duration in whole seconds, from 2 through 10.

必填范围: 2 <= x <= 10
seed
integer

Optional sampling seed. Use a positive integer for an explicit seed. Omission or 0 selects a random seed.

必填范围: 0 <= x <= 4294967295
contentModeration
object

Optional content moderation settings. Omit the object to use standard moderation.

outputFormat
enum<string>
必填 if proresProfile is set

Output encoding. Omit for mp4 (H.264). prores returns MOV; png_sequence returns a PNG ZIP; sdr_rec709_10bit returns 10-bit Rec.709 HEVC. hdr10 and hlg return 10-bit HDR MP4; hdr_pq_12bit_master returns 12-bit HEVC MOV; hdr_prores returns HDR ProRes MOV. The HDR PNG/EXR sequence formats return ZIP archives; the ACEScg variants target the named ACES version.

可用选项:
mp4,
prores,
png_sequence,
hdr10,
hlg,
sdr_rec709_10bit,
hdr_pq_12bit_master,
hdr_prores,
hdr_png_sequence,
hdr_exr_sequence,
hdr_exr_acescg_sequence_1_3,
hdr_exr_acescg_sequence_2_0
proresProfile
enum<string>

Profile for outputFormat prores or hdr_prores. Omit for 4444 with prores, or 422 HQ with hdr_prores. hdr_prores accepts only 422, 422 HQ, or 4444. Omit this field for other formats.

可用选项:
422,
4444,
422 Proxy,
422 LT,
422 HQ,
4444 XQ

响应

Task submitted. Save its id to retrieve task status.

id
string
必填

Task ID for GET /runwayml/v1/tasks/{id}.

status
string

Task state, when returned.

createdAt
string<date-time>

Task submission timestamp, when returned.

output
string<uri>[]

Result URLs, when returned.

failure
string

Failure explanation, when returned.

failureCode
string

Machine-readable failure code, when returned.

estimatedCost
object

Task estimate metadata, when returned.

cost
object

Task cost metadata, when returned.

最后修改于 2026年9月21日