灵活的参数配置
可配置文档中列出的 3 个参数,包括 duration_seconds, output_format, text。
curl -X POST https://runapi.ai/api/v1/elevenlabs/text_to_sound \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sound-effect-v2",
"text": "将这段文字转换为自然语音,使用温暖的英式男声,语速适中。"
}'
import { ElevenlabsClient } from "@runapi.ai/elevenlabs";
const client = new ElevenlabsClient();
const result = await client.textToSound.run({
model: "sound-effect-v2",
text: "将这段文字转换为自然语音,使用温暖的英式男声,语速适中。",
});
import os
import requests
response = requests.post(
"https://runapi.ai/api/v1/elevenlabs/text_to_sound",
headers={"Authorization": f"Bearer {os.environ['RUNAPI_API_KEY']}"},
json={"model":"sound-effect-v2","text":"将这段文字转换为自然语音,使用温暖的英式男声,语速适中。"}
)
response.raise_for_status()
<?php
$client = curl_init("https://runapi.ai/api/v1/elevenlabs/text_to_sound");
curl_setopt_array($client, [
CURLOPT_HTTPHEADER => ["Authorization: Bearer " . getenv("RUNAPI_API_KEY"), "Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode([
'model' => 'sound-effect-v2',
'text' => '将这段文字转换为自然语音,使用温暖的英式男声,语速适中。',
])
]);
$response = curl_exec($client);
RunApi client = new RunApi(System.getenv("RUNAPI_API_KEY"));
Task task = client.textToSound().run({"model":"sound-effect-v2","text":"将这段文字转换为自然语音,使用温暖的英式男声,语速适中。"});
task.waitForResult();
require "runapi/elevenlabs"
client = RunApi::Elevenlabs::Client.new
result = client.text_to_sound.run(
model: "sound-effect-v2",
text: "将这段文字转换为自然语音,使用温暖的英式男声,语速适中。"
)
client := runapi.NewClient(os.Getenv("RUNAPI_API_KEY"))
task, err := client.textToSound.Run({"model":"sound-effect-v2","text":"将这段文字转换为自然语音,使用温暖的英式男声,语速适中。"})
if err != nil { log.Fatal(err) }
task.Wait()
$ runapi generate \
--model sound-effect-v2 \
--endpoint text_to_sound \
--wait
6 个版本可用
选择任意模型,几秒内开始生成。
| 提供商 | ElevenLabs |
| 模型 ID | sound-effect-v2 |
| 模态 | 音频与音乐 |
| 任务类型 | Asynchronous |
| API 端点 | /api/v1/elevenlabs/text_to_sound |
| 计费单位 | 分钟 |
| 输入参数 | duration_seconds, output_format, text |
| 输出格式 | mp3_22050_32, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192 |
| 目录状态 | 运行中 |
免费注册后,在控制台创建用于 sound-effect-v2 的 API 密钥。
向 /api/v1/elevenlabs/text_to_sound 发送 POST 请求,并传入 sound-effect-v2 模型 ID 和参数。
轮询任务或按照回调获取已完成的 sound-effect-v2 结果。
可配置文档中列出的 3 个参数,包括 duration_seconds, output_format, text。
提供 1 个公开 endpoint:text_to_sound。
按 分钟 计量,无需订阅。
text暂无描述。
output_format暂无描述。 (mp3_22050_32, mp3_44100_32, mp3_44100_64, mp3_44100_96, mp3_44100_128, mp3_44100_192, pcm_8000, pcm_16000, pcm_22050, pcm_24000, pcm_44100, pcm_48000, ulaw_8000, alaw_8000, opus_48000_32, opus_48000_64, opus_48000_96, opus_48000_128, opus_48000_192)
duration_seconds暂无描述。
生成与节目氛围匹配的免版税背景音乐,无需授权费用。
为程序化生成的关卡生成自适应环境音效和配乐。
无需录音棚即可为客户广告生成定制配音和音效。
传入 quickstart 中显示的模型 ID。
Key 级限流随使用层级伸缩。当前限制见定价页。
可以——变体只是参数,改 model 字段即可。
模型支持流式时,RunAPI 端到端流式。
在公共 GitHub 仓库提 issue 或邮件联系 support。