跳转到主要内容
POST
使用 POST /runwayml/v1/sound_effect 根据文本 Prompt 创建音频任务。 使用 Bearer 身份验证和 JSON 请求正文发送您的 CometAPI API 密钥。

选择模型

对于 eleven_text_to_sound_v2,请省略 duration,以便根据 Prompt 选择时长。设置 loop: true 可请求循环播放的音效。 对于 seed_audio,请在 Prompt 中将 referenceAudios 称为 @Audio1、@Audio2, 以及 @Audio3,顺序与数组中的顺序一致。无需参考时,请省略 referenceAudios。 将每个示例音频 URL 替换为您的音频文件可访问的 HTTPS URL。 请勿在此端点上对该模型包含 duration、loop 或 voice。

配置音频控制项

对于三个速率控制项,请省略该字段或使用 0 以保留其正常值。

获取结果

保存返回的 id,然后使用 获取 Runway 任务 以获取任务状态。当 status 为 SUCCEEDED 时,读取音频 URL 所在的字段 output。如果任务失败,请检查 failure 和 failureCode。

授权

Authorization
string
header
必填

Use your CometAPI API key.

请求体

application/json

Request settings for eleven_text_to_sound_v2.

model
enum<string>
必填

Model ID for this request.

可用选项:
eleven_text_to_sound_v2
Allowed value: "eleven_text_to_sound_v2"
promptText
string
必填

A text description of the sound effect to generate.

Required string length: 1 - 3000
duration
number

Sound effect duration in seconds, from 0.5 to 30. Fractional seconds are accepted. Omit this field to choose duration from the prompt.

必填范围: 0.5 <= x <= 30
loop
boolean
默认值:false

Set true to request a sound effect that loops seamlessly. Defaults to false.

响应

Task created. Save the returned 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月22日