- Third-party
- Zero data retention
Inworld 最强大、表现力最丰富的文本转语音模型。在 TTS 1.5 的基础上,提供丰富的表现力语音、实时延迟、自然语言引导(例如 [whisper]、[say excitedly]),并增强了多语言支持,涵盖 15 种生产语言以及 90 多种实验性语言。
| 模型信息 | |
|---|---|
| 条款和许可证 | 链接 ↗ |
| 更多信息 | 链接 ↗ |
| 零数据保留 | 是 |
| 定价 | 在 Cloudflare 仪表板中查看定价 ↗ |
用法
const response = await env.AI.run(
'inworld/tts-2',
{
output_format: 'mp3',
temperature: 1,
text: 'Hello! Welcome to Cloudflare AI Gateway. Let me show you what we can do.',
timestamp_type: 'none',
voice_id: 'Dennis',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "inworld/tts-2",
"input": {
"output_format": "mp3",
"temperature": 1,
"text": "Hello! Welcome to Cloudflare AI Gateway. Let me show you what we can do.",
"timestamp_type": "none",
"voice_id": "Dennis"
}
}'{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/inworld__tts-2/simple-speech.mp3"
},
"state": "Completed"
}示例
自然语言引导 — 使用方括号括起的自然语言提示来引导语音的情感、节奏和风格。
const response = await env.AI.run(
'inworld/tts-2',
{
output_format: 'mp3',
temperature: 1,
text: "[speak with excitement] I'm really excited about Inworld's new model. Have you tried out the steering capabilities? It's pretty cool!",
timestamp_type: 'none',
voice_id: 'Dennis',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "inworld/tts-2",
"input": {
"output_format": "mp3",
"temperature": 1,
"text": "[speak with excitement] I'\''m really excited about Inworld'\''s new model. Have you tried out the steering capabilities? It'\''s pretty cool!",
"timestamp_type": "none",
"voice_id": "Dennis"
}
}'{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/inworld__tts-2/natural-language-steering.mp3"
},
"state": "Completed"
}耳语 — 使用引导标签实现耳语效果
const response = await env.AI.run(
'inworld/tts-2',
{
output_format: 'mp3',
temperature: 1,
text: '[whisper] This is a secret just between us.',
timestamp_type: 'none',
voice_id: 'Dennis',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "inworld/tts-2",
"input": {
"output_format": "mp3",
"temperature": 1,
"text": "[whisper] This is a secret just between us.",
"timestamp_type": "none",
"voice_id": "Dennis"
}
}'{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/inworld__tts-2/whisper.mp3"
},
"state": "Completed"
}高质量音频 — 更高的采样率,达到录音室品质
const response = await env.AI.run(
'inworld/tts-2',
{
output_format: 'mp3',
sample_rate: 48000,
temperature: 1,
text: 'This recording is generated at studio quality for the best possible listening experience.',
timestamp_type: 'none',
voice_id: 'Dennis',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "inworld/tts-2",
"input": {
"output_format": "mp3",
"sample_rate": 48000,
"temperature": 1,
"text": "This recording is generated at studio quality for the best possible listening experience.",
"timestamp_type": "none",
"voice_id": "Dennis"
}
}'{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/inworld__tts-2/high-quality-audio.mp3"
},
"state": "Completed"
}使用文本规范化 — 在合成前展开数字和缩写
const response = await env.AI.run(
'inworld/tts-2',
{
apply_text_normalization: true,
output_format: 'mp3',
temperature: 1,
text: 'The meeting is at 3:30 PM on Jan 15th, 2026. Please confirm by calling 555-0123.',
timestamp_type: 'none',
voice_id: 'Dennis',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "inworld/tts-2",
"input": {
"apply_text_normalization": true,
"output_format": "mp3",
"temperature": 1,
"text": "The meeting is at 3:30 PM on Jan 15th, 2026. Please confirm by calling 555-0123.",
"timestamp_type": "none",
"voice_id": "Dennis"
}
}'{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"audio": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/inworld__tts-2/with-text-normalization.mp3"
},
"state": "Completed"
}参数
text
stringrequiredmaxLength: 2000要合成为语音的文本。最多输入 2,000 个字符。voice_id
stringrequireddefault: Dennisenum: Loretta, Darlene, Marlene, Hank, Evelyn, Celeste, Pippa, Tessa, Liam, Callum, Hamish, Abby, Graham, Rupert, Mortimer, Snik, Anjali, Saanvi, Arjun, Claire, Oliver, Simon, Elliot, James, Serena, Gareth, Vinny, Lauren, Jessica, Ethan, Tyler, Jason, Chloe, Veronica, Victoria, Miranda, Sebastian, Victor, Malcolm, Nate, Brian, Amina, Kelsey, Derek, Evan, Kayla, Jake, Grant, Tristan, Nadia, Selene, Marcus, Riley, Damon, Cedric, Mia, Naomi, Jonah, Levi, Avery, Brandon, Conrad, Bianca, Lucian, Trevor, Alex, Ashley, Craig, Deborah, Dennis, Edward, Elizabeth, Hades, Julia, Pixie, Mark, Olivia, Priya, Ronald, Sarah, Shaun, Theodore, Timothy, Wendy, Dominus, Hana, Clive, Carter, Blake, Luna, Reed, Duncan, Felix, Eleanor, Sophie用于合成语音的语音 ID。默认为 Dennis。output_format
stringrequireddefault: mp3enum: mp3, opus, wav, flac音频的输出格式。支持的格式为 mp3、opus、wav 和 flac。默认为 mp3。bit_rate
integerminimum: -9007199254740991maximum: 9007199254740991音频的比特率(每秒比特数)。仅适用于压缩音频格式(mp3、opus)。默认为 128,000。sample_rate
integerminimum: -9007199254740991maximum: 9007199254740991合成采样率(赫兹)。可选值:8000、16000、22050、24000、32000、44100、48000。默认为 48,000。speaking_rate
numberminimum: 0.5maximum: 1.5语速,范围为 [0.5, 1.5]。默认为 1.0。建议使用高于 0.8 的值以确保高质量。temperature
numberrequireddefault: 1minimum: 0.01maximum: 2决定采样音频 token 时的随机程度。默认为 1.0。接受 0(不含)到 2(含)之间的值。值越高表现力越强,值越低越确定。timestamp_type
stringrequireddefault: noneenum: none, word, character控制随音频返回的时间戳元数据。"word" 返回单词级时间信息,"character" 返回字符级时间信息。注意:会增加延迟。默认为 none。apply_text_normalization
boolean启用后,文本规范化会在转换为语音之前展开数字、日期、时间和缩写。关闭此功能可能会降低延迟。audio
string生成音频文件的 URL