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"
    }
  }'

请求体

字段类型必填说明
modelstringelevenlabs-text-to-dialogue-v3
inputobject生成参数,见下
callback_urlstring任务完成/失败时接收通知的回调地址

Input 对象

字段类型必填说明
dialoguearray有序的对话轮次列表,每个元素为 { text, voice }。最多 10 个不同 voice;所有轮次总字符数 ≤ 5000
dialogue[].textstring该 voice 说的内容
dialogue[].voicestringElevenLabs voice ID 或预设名
stabilitynumber声音稳定性/随机度,取值 00.51,默认 0.5
language_codestring语言代码(如 enzhjafr),留空则自动检测(默认)

Voices(可用声音)

每个 dialogue[].voice 取下表中的预设 voice ID(或其名称)。可试听后填入对应的 voice_id

NameStylevoice_idPreview
JamesHusky, Engaging and BoldEkK5I93UQWFDigLMpZcX
ArabellaMysterious and EmotiveZ3R5wn05IrDiVCyEkUrK
BradfordExpressive and ArticulateNNl6r8mD7vthiJatiJt1
XavierDominating, Metallic AnnouncerYOq2y2Up4RgXP2HyXjE5
KuonCheerful, Clear and SteadyB8gJV1IhpuegLxdpXFOE
Monika SogamDeep and Natural2zRM7PkgwBPiau2jvVXc
MarkCasual, Relaxed and Light1SM7GgM6IMuvQlz2BwM3
AdelineFeminine and Conversational5l5f8iK3YPeGga21rQIX
SamSupport AgentscOwDtmlUjD3prqpp97I
Spuds OxleyWise and ApproachableNOpBlnGInO9m6vDvFkFC
EveAuthentic, Energetic and HappyBZgkqPqms7Kj9ulSkVzn
Northern TerryNorthern English, Characterfulwo6udizrrtpIxWGp2qJk
British Football AnnouncerBritish, Energetic CommentarygU0LNdkMOQCOrPrwtbee
BrockCommanding and Loud SergeantDGzg6RaUqxGRTHSBjfgF
NathanVirtual Radio Hostx70vRnQBMBu4FAYhjJbO
AnikaAnimated, Friendly and EngagingSm1seazb4gs7RSlUVw7c
VirajRich and SoftP1bg08DkjqiVEzOn76yG
TakshCalm, Serious and SmoothqDuRKMlYmrm8trt5QyBn
HoratiusEnergetic Character VoiceqXpMhyvQqiRxWQs4qSSB
LiamEnergetic, Social Media CreatorTX3LPaxmHKxFdv7VOQHJ
CallumHusky TricksterN2lVS1w4EtoT3dr4eOWO
LauraEnthusiast, Quirky AttitudeFGY2WhTYpPnrIDTdsKH5
BrittneySocial Media - Fun, Youthful & InformativekPzsL2i3teMYv0FxEYQ6
MarkNatural ConversationsUgBBYS2sOqTuMpoF3BR0
BellaProfessional, Bright, Warmhpp4J3VqNfWAUOO0d1Us
BrianDeep, Resonant and ComfortingnPczCjzI2devNBz1zQrb
HopeBubbly, Gossipy and GirlyuYXf8XasLslADfZ2MB4u
JeffClassy, Resonating and Stronggs0tAILXbY5DNrJrsM6F
JamahalYoung, Vibrant, and NaturalDTKMou8ccj1ZaWGBiotd
FinnYouthful, Eager and EnergeticvBKc2FfBKJfcZNyEt1n6
TomConversations & BooksDYkrAHD8iwork3YSUBbs
CassidyCrisp, Direct and Clear56AoDkrOh6qfVPDXZ7Pt
Addison 2.0Australian Audiobook & PodcasteR40ATw9ArzDf9h3v7t7
Jessica Anne BogartChatty and Friendlyg6xIsTj2HwM6VR4iXFCw
LucyFresh & CasuallcMyyd2HUfFzxdCaC4Ta
TiffanyNatural and Welcoming6aDn1KB0hjpdcocrUkmq
FelixWarm, Positive & Contemporary RPSq93GQT4X1lKDXsQcixO
Jessica Anne BogartEloquent VillainflHkNRp1BlvT73UL6gyz
LutzChuckling, Giggly and Cheerful9yzdeviXkFddZ4Oz8Mok
EmmaAdorable and UpbeatpPdl9cQBQq4p6mRkZy2Z
EdwardLoud, Confident and CockyzYcjlYFOd3taleS0gkk3
MarshalFriendly, Funny ProfessornzeAacJi50IvxcyDnMXa
John MorganGritty, Rugged CowboyruirxsoakN0GWmGNIo04
AriaSultry VillainTC0Zp7WVFzhA8zpTlRqV
Viking BjornEpic Medieval Raiderljo9gAlSqKOvF6D8sOsX
Pirate MarshalGruff, Theatrical PiratePPzYpIqttlTYA83688JI
Johnny KidSerious and Calm Narrator8JVbfL6oEdmuxKn5DK2C
HopePoetic, Romantic and CaptivatingiCrDUkL56s3C8sCRl7wb
Ana RitaSmooth, Expressive and BrightwJqPPQ618aTW29mptyoc
John DoeDeepEiNlNiXeDU1pqqOPrYMO
Burt ReynoldsDeep, Smooth and Clear4YYIPFl9wE5c4L2eu2Gb
HankDeep and Engaging Narrator6F5Zhi321D3Oq7v1oNT4
WyattWise Rustic CowboyYXpFCvM1S3JbWEJhoskW
PhilExplosive, Passionate AnnouncerLG95yZDEHg6fCZdQjLqj
Johnny DynamiteVintage Radio DJCeNX9CMwmxDxUF5Q2Inm
Rachel MPro British Radio PresenteraD6riP1btT197c6dACmy
Rex ThunderDeep N Toughmtrellq69YZsNwzUSyXh
EdLate Night AnnouncerdHd5gvgSOzSfduK4CvEg
JeanAlluring and Playful Femme FataleeVItLK1UvXctxuaRV2Oq
BritneyCalm and Calculative Villainesy0r39YPLQjOczyOib8
SvenEmotional and NiceTsns2HvNFKfGiNjllgqo
VirajSmooth and Gentle1U02n4nD6AdIZ9CjF053
NathanielEngaging, British and CalmAeRdCCKzvd23BpJoofzx
BenjaminDeep, Warm, CalmingLruHrtVF6PSyGItzMNHS
AllisonCalm, Soothing and Meditative1wGbFxmAM3Fgw63G1zZJ
Theodore HQSerene and GroundedhqfrgApggtO1785R4Fsn
LeonSoothing and GroundedMJ0RnG71ty4LH3dvNfSd

响应

{
  "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 -> completedfailed

完成

{
  "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 状态码错误码类型说明
400invalid_requestinvalid_request_error缺少必填参数或参数无效
401invalid_api_keyauthentication_errorAPI Key 无效、已禁用或已删除
402insufficient_creditsbilling_error积分余额不足,请充值
403ip_not_allowedpermission_error请求 IP 不在 Key 的白名单中
404model_not_foundinvalid_request_error模型不存在或已停用
404task_not_foundinvalid_request_error任务 ID 不存在
429rate_limit_exceededrate_limit_error请求过于频繁,请降低频率
429spend_limit_exceededbilling_error达到 Key 的消费限额(每小时/每天/总量)
500internal_errorapi_error服务器内部错误
503upstream_errorupstream_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 服务返回错误,可能原因:

  • 输入内容包含敏感或违规信息
  • 上游服务暂时不可用
  • 请求参数不被上游支持

因上游错误导致任务失败时,预扣积分会自动退还。