ElevenLabs Text-to-Dialogue v3
使用 ElevenLabs Eleven v3 生成自然、富有表现力的多角色对话音频。传入一组对话轮次,每轮指定各自的声音(voice),即可得到一段托管的音频文件。支持 70+ 种语言。
模型
| 模型名称 | 说明 |
|---|---|
elevenlabs-text-to-dialogue-v3 | 多角色对话生成,表现力强,支持 70+ 种语言 |
计费
按字符计费,按所有 dialogue[].text 的总字符数计算:
| 项目 | 数值 |
|---|---|
| 每字符 | 见 playground |
| 限制 | 最多 10 个不同 voice,单次请求总字符数 ≤ 5000 |
提交时预扣积分,生成失败自动退款。提交前可用 POST /v1/estimate 预估精确费用。
创建任务
curl -X POST https://api.aivideoapi.ai/v1/audio/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "elevenlabs-text-to-dialogue-v3",
"callback_url": "https://your-server.com/webhook",
"input": {
"dialogue": [
{ "text": "嘿!报告写完了吗?", "voice": "EkK5I93UQWFDigLMpZcX" },
{ "text": "差不多了,正在补最后的数据。", "voice": "Z3R5wn05IrDiVCyEkUrK" }
],
"stability": 0.5,
"language_code": "zh"
}
}'
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | elevenlabs-text-to-dialogue-v3 |
input | object | 是 | 生成参数,见下 |
callback_url | string | 否 | 任务完成/失败时接收通知的回调地址 |
Input 对象
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
dialogue | array | 是 | 有序的对话轮次列表,每个元素为 { text, voice }。最多 10 个不同 voice;所有轮次总字符数 ≤ 5000 |
dialogue[].text | string | 是 | 该 voice 说的内容 |
dialogue[].voice | string | 是 | ElevenLabs voice ID 或预设名 |
stability | number | 否 | 声音稳定性/随机度,取值 0、0.5、1,默认 0.5 |
language_code | string | 否 | 语言代码(如 en、zh、ja、fr),留空则自动检测(默认) |
Voices(可用声音)
每个 dialogue[].voice 取下表中的预设 voice ID(或其名称)。可试听后填入对应的 voice_id。
| Name | Style | voice_id | Preview |
|---|---|---|---|
| James | Husky, Engaging and Bold | EkK5I93UQWFDigLMpZcX | |
| Arabella | Mysterious and Emotive | Z3R5wn05IrDiVCyEkUrK | |
| Bradford | Expressive and Articulate | NNl6r8mD7vthiJatiJt1 | |
| Xavier | Dominating, Metallic Announcer | YOq2y2Up4RgXP2HyXjE5 | |
| Kuon | Cheerful, Clear and Steady | B8gJV1IhpuegLxdpXFOE | |
| Monika Sogam | Deep and Natural | 2zRM7PkgwBPiau2jvVXc | |
| Mark | Casual, Relaxed and Light | 1SM7GgM6IMuvQlz2BwM3 | |
| Adeline | Feminine and Conversational | 5l5f8iK3YPeGga21rQIX | |
| Sam | Support Agent | scOwDtmlUjD3prqpp97I | |
| Spuds Oxley | Wise and Approachable | NOpBlnGInO9m6vDvFkFC | |
| Eve | Authentic, Energetic and Happy | BZgkqPqms7Kj9ulSkVzn | |
| Northern Terry | Northern English, Characterful | wo6udizrrtpIxWGp2qJk | |
| British Football Announcer | British, Energetic Commentary | gU0LNdkMOQCOrPrwtbee | |
| Brock | Commanding and Loud Sergeant | DGzg6RaUqxGRTHSBjfgF | |
| Nathan | Virtual Radio Host | x70vRnQBMBu4FAYhjJbO | |
| Anika | Animated, Friendly and Engaging | Sm1seazb4gs7RSlUVw7c | |
| Viraj | Rich and Soft | P1bg08DkjqiVEzOn76yG | |
| Taksh | Calm, Serious and Smooth | qDuRKMlYmrm8trt5QyBn | |
| Horatius | Energetic Character Voice | qXpMhyvQqiRxWQs4qSSB | |
| Liam | Energetic, Social Media Creator | TX3LPaxmHKxFdv7VOQHJ | |
| Callum | Husky Trickster | N2lVS1w4EtoT3dr4eOWO | |
| Laura | Enthusiast, Quirky Attitude | FGY2WhTYpPnrIDTdsKH5 | |
| Brittney | Social Media - Fun, Youthful & Informative | kPzsL2i3teMYv0FxEYQ6 | |
| Mark | Natural Conversations | UgBBYS2sOqTuMpoF3BR0 | |
| Bella | Professional, Bright, Warm | hpp4J3VqNfWAUOO0d1Us | |
| Brian | Deep, Resonant and Comforting | nPczCjzI2devNBz1zQrb | |
| Hope | Bubbly, Gossipy and Girly | uYXf8XasLslADfZ2MB4u | |
| Jeff | Classy, Resonating and Strong | gs0tAILXbY5DNrJrsM6F | |
| Jamahal | Young, Vibrant, and Natural | DTKMou8ccj1ZaWGBiotd | |
| Finn | Youthful, Eager and Energetic | vBKc2FfBKJfcZNyEt1n6 | |
| Tom | Conversations & Books | DYkrAHD8iwork3YSUBbs | |
| Cassidy | Crisp, Direct and Clear | 56AoDkrOh6qfVPDXZ7Pt | |
| Addison 2.0 | Australian Audiobook & Podcast | eR40ATw9ArzDf9h3v7t7 | |
| Jessica Anne Bogart | Chatty and Friendly | g6xIsTj2HwM6VR4iXFCw | |
| Lucy | Fresh & Casual | lcMyyd2HUfFzxdCaC4Ta | |
| Tiffany | Natural and Welcoming | 6aDn1KB0hjpdcocrUkmq | |
| Felix | Warm, Positive & Contemporary RP | Sq93GQT4X1lKDXsQcixO | |
| Jessica Anne Bogart | Eloquent Villain | flHkNRp1BlvT73UL6gyz | |
| Lutz | Chuckling, Giggly and Cheerful | 9yzdeviXkFddZ4Oz8Mok | |
| Emma | Adorable and Upbeat | pPdl9cQBQq4p6mRkZy2Z | |
| Edward | Loud, Confident and Cocky | zYcjlYFOd3taleS0gkk3 | |
| Marshal | Friendly, Funny Professor | nzeAacJi50IvxcyDnMXa | |
| John Morgan | Gritty, Rugged Cowboy | ruirxsoakN0GWmGNIo04 | |
| Aria | Sultry Villain | TC0Zp7WVFzhA8zpTlRqV | |
| Viking Bjorn | Epic Medieval Raider | ljo9gAlSqKOvF6D8sOsX | |
| Pirate Marshal | Gruff, Theatrical Pirate | PPzYpIqttlTYA83688JI | |
| Johnny Kid | Serious and Calm Narrator | 8JVbfL6oEdmuxKn5DK2C | |
| Hope | Poetic, Romantic and Captivating | iCrDUkL56s3C8sCRl7wb | |
| Ana Rita | Smooth, Expressive and Bright | wJqPPQ618aTW29mptyoc | |
| John Doe | Deep | EiNlNiXeDU1pqqOPrYMO | |
| Burt Reynolds | Deep, Smooth and Clear | 4YYIPFl9wE5c4L2eu2Gb | |
| Hank | Deep and Engaging Narrator | 6F5Zhi321D3Oq7v1oNT4 | |
| Wyatt | Wise Rustic Cowboy | YXpFCvM1S3JbWEJhoskW | |
| Phil | Explosive, Passionate Announcer | LG95yZDEHg6fCZdQjLqj | |
| Johnny Dynamite | Vintage Radio DJ | CeNX9CMwmxDxUF5Q2Inm | |
| Rachel M | Pro British Radio Presenter | aD6riP1btT197c6dACmy | |
| Rex Thunder | Deep N Tough | mtrellq69YZsNwzUSyXh | |
| Ed | Late Night Announcer | dHd5gvgSOzSfduK4CvEg | |
| Jean | Alluring and Playful Femme Fatale | eVItLK1UvXctxuaRV2Oq | |
| Britney | Calm and Calculative Villain | esy0r39YPLQjOczyOib8 | |
| Sven | Emotional and Nice | Tsns2HvNFKfGiNjllgqo | |
| Viraj | Smooth and Gentle | 1U02n4nD6AdIZ9CjF053 | |
| Nathaniel | Engaging, British and Calm | AeRdCCKzvd23BpJoofzx | |
| Benjamin | Deep, Warm, Calming | LruHrtVF6PSyGItzMNHS | |
| Allison | Calm, Soothing and Meditative | 1wGbFxmAM3Fgw63G1zZJ | |
| Theodore HQ | Serene and Grounded | hqfrgApggtO1785R4Fsn | |
| Leon | Soothing and Grounded | MJ0RnG71ty4LH3dvNfSd |
响应
{
"code": 200,
"msg": "success",
"data": {
"taskId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}
Estimate 预估
在不创建任务的情况下预估积分消耗。费用随 dialogue[].text 总字符数变化。
curl -X POST https://api.aivideoapi.ai/v1/estimate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "elevenlabs-text-to-dialogue-v3",
"input": {
"dialogue": [
{ "text": "你好呀!", "voice": "EkK5I93UQWFDigLMpZcX" }
]
}
}'
查询任务
curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
-H "Authorization: Bearer sk-your-api-key"
状态流转:pending -> processing -> completed 或 failed。
完成
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "completed",
"model": "elevenlabs-text-to-dialogue-v3",
"created_at": 1775383908,
"completed_at": 1775383956,
"output": {
"urls": [
"https://file.aivideoapi.ai/audio/2026/06/23/dialogue.mp3"
],
"metadata": {
"model": "elevenlabs-text-to-dialogue-v3"
}
}
}
音频 URL 有效期 24 小时。
失败
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "failed",
"model": "elevenlabs-text-to-dialogue-v3",
"created_at": 1775383908,
"error": {
"code": "upstream_error",
"message": "Generation failed"
}
}
任务失败时,预扣的积分会自动退还。
回调
创建任务时传入 callback_url,任务完成或失败时系统会自动向该地址发送 POST 请求,格式与查询任务的响应一致。
常见错误码
请求失败时,API 返回 JSON 格式的错误响应:
{
"error": {
"code": "insufficient_credits",
"message": "Your credit balance is too low. Please top up.",
"type": "billing_error"
}
}
错误码一览
| HTTP 状态码 | 错误码 | 类型 | 说明 |
|---|---|---|---|
| 400 | invalid_request | invalid_request_error | 缺少必填参数或参数无效 |
| 401 | invalid_api_key | authentication_error | API Key 无效、已禁用或已删除 |
| 402 | insufficient_credits | billing_error | 积分余额不足,请充值 |
| 403 | ip_not_allowed | permission_error | 请求 IP 不在 Key 的白名单中 |
| 404 | model_not_found | invalid_request_error | 模型不存在或已停用 |
| 404 | task_not_found | invalid_request_error | 任务 ID 不存在 |
| 429 | rate_limit_exceeded | rate_limit_error | 请求过于频繁,请降低频率 |
| 429 | spend_limit_exceeded | billing_error | 达到 Key 的消费限额(每小时/每天/总量) |
| 500 | internal_error | api_error | 服务器内部错误 |
| 503 | upstream_error | upstream_error | 上游 AI 服务返回错误 |
常见场景
invalid_request (400)
缺少必填字段或参数格式错误时返回。
{
"error": {
"code": "invalid_request",
"message": "'model' is required.",
"type": "invalid_request_error"
}
}
insufficient_credits (402)
积分不足。可通过 GET /v1/credits 查询余额,前往 Dashboard > Billing 充值。
invalid_api_key (401)
可能原因:
- Key 不以
sk-开头 - Key 已被禁用或删除
- 用户账户已被封禁
upstream_error (503)
上游 AI 服务返回错误,可能原因:
- 输入内容包含敏感或违规信息
- 上游服务暂时不可用
- 请求参数不被上游支持
因上游错误导致任务失败时,预扣积分会自动退还。