> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# API - 错误代码 400 或 401

这些错误代码可能由多种原因造成。响应消息会说明错误原因。

###

### max_character_limit_exceeded

每次请求的最大字符数取决于模型。

* Flash v2.5 - 最多 40,000 个字符（约 40 分钟音频）
* Turbo v2.5 - 最多 40,000 个字符（约 40 分钟音频）
* Flash v2 - 最多 30,000 个字符（约 30 分钟音频）
* Turbo v2 - 最多 30,000 个字符（约 30 分钟音频）
* Multilingual v1 和 v2 - 最多 10,000 个字符（约 10 分钟音频）
* English v1 和 v2 - 最多 10,000 个字符（约 10 分钟音频）

###

### invalid_api_key

这表示 API 密钥设置不正确。设置 API 密钥时，请确保准确使用 "xi-api-key"，没有拼写错误。

###

### voice_not_found

这表示输入了错误的 voice_id。请确认你使用的是所需音色的正确 voice_id。可在“我的音色”中查看。

###

### quota_exceeded

配额不足，无法完成请求。你可以购买[按量付费积分](/docs/zh/overview/administration/pay-as-you-go)；如果使用旧版 Creator、Pro、Scale 或商业版套餐，也可以在[订阅](https://elevenlabs.io/app/subscription)页面启用[按使用量计费](/docs/zh/help-center/account/general/what-is-usage-based-billing)。



400 响应详情示例：

`"detail": &#123;
 "status": "max_character_limit_exceeded",
 "message": "This request's text has 627 characters and exceeds the character limit of 333 characters for non signed in accounts."
&#125;`

401 响应详情示例：

`"detail": &#123;
 "status": "invalid_api_key",
 "message": "Invalid API key"
&#125;`