跳转到主要内容
POST
cURL
使用 POST /runwayml/v1/voice_dubbing 将口语音频翻译成另一种 语言。使用模型 ID eleven_voice_dubbing。 使用 Bearer 身份验证发送您的 CometAPI API 密钥,并附带 JSON 请求正文。

提供音频和目标语言

将 audioUri 设置为源音频的可访问 HTTPS URL。 将 targetLang 设置为目标语言代码,例如西班牙语使用 es ,法语使用 fr。请从请求架构中选择受支持的代码。 请求需要 model、audioUri 和 targetLang。 将示例音频 URL 替换为您的源文件。

配置配音

省略布尔控制参数即可使用模型默认值。发送 false 也会使用 默认值。

获取结果

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

授权

Authorization
string
header
必填

Use your CometAPI API key.

请求体

application/json

Request settings for eleven_voice_dubbing.

model
enum<string>
必填

Model ID for this request.

可用选项:
eleven_voice_dubbing
Allowed value: "eleven_voice_dubbing"
audioUri
必填

Audio input as an accessible HTTPS URL or base64 data URI.

Required string length: 13 - 2048
Pattern: ^https:\/\/.*
targetLang
enum<string>
必填

The target language code to dub the audio to (e.g., "es" for Spanish, "fr" for French).

可用选项:
en,
hi,
pt,
zh,
es,
fr,
de,
ja,
ar,
ru,
ko,
id,
it,
nl,
tr,
pl,
sv,
fil,
ms,
ro,
uk,
el,
cs,
da,
fi,
bg,
hr,
sk,
ta
disableVoiceCloning
boolean

Set true to use a generic voice instead of cloning the source voice. Omit or use false for the model default.

dropBackgroundAudio
boolean

Set true to remove background audio from the dubbed output. Omit or use false for the model default.

numSpeakers
integer

Number of speakers in the source audio. Supply a positive integer or omit it for automatic detection.

必填范围: x <= 9007199254740991

响应

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月21日