#8996 Elevenlabs.io: API key must start with 'sk_'.{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '+0%', 'role': 'Roger - Laid

2408**d4d3 Posted at: 36 minutes ago

Elevenlabs.io: API key must start with 'sk_'.
{'text': '你好啊,我亲爱的朋友,希望你的每一天都是美好愉快的!', 'rate': '+0%', 'role': 'Roger - Laid-Back Casual Resonant', 'filename': 'H:/win-pyvideotrans-v4.19/tmp/34704/listen_voice/26-zh-cn-1795831974.0977805.wav', 'tts_type': 26, 'language': 'zh-cn', 'volume': '+0%', 'pitch': '+0Hz'}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 23, in run
File "videotrans\tts\__init__.py", line 154, in run
File "videotrans\tts\_base.py", line 125, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\tts\_elevenlabs.py", line 48, in _run
File "elevenlabs\text_to_speech\client.py", line 157, in convert

with self._raw_client.convert(

File "contextlib.py", line 135, in enter
File "elevenlabs\text_to_speech\raw_client.py", line 212, in convert

yield _stream()

File "elevenlabs\text_to_speech\raw_client.py", line 210, in _stream

raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)

elevenlabs.core.api_error.ApiError: headers: {'date': 'Sat, 28 Nov 2026 02:10:51 GMT', 'server': 'uvicorn', 'content-length': '210', 'content-type': 'application/json', 'vary': 'Accept-Language', 'access-control-allow-origin': '', 'access-control-allow-headers': '', 'access-control-allow-methods': 'POST, PATCH, OPTIONS, DELETE, GET, PUT', 'access-control-max-age': '600', 'strict-transport-security': 'max-age=1800;', 'x-trace-id': '3ff62ac1559aae34bd001b08b15da93c', 'x-region': 'europe-west4', 'via': '1.1 google', 'alt-svc': 'h3=":443"; ma=2592000'}, status_code: 400, body: {'detail': {'type': 'authentication_error', 'code': 'invalid_api_key', 'message': "API key must start with 'sk_'.", 'status': 'invalid_api_key_prefix', 'request_id': '3ff62ac1559aae34bd001b08b15da93c', 'param': 'api_key'}}


=
system:Windows-10-10.0.26200-SP0
version:v4.19
frozen:True
language:zh_CN
root_dir:H:/win-pyvideotrans-v4.19

1 Replies

#1 DeepSeek reply at 36 minutes ago

这是 Elevenlabs.io 官方 SDK 的强制校验报错:你填写的 API Key 不是以 sk_ 开头的有效 ElevenLabs 密钥(invalid_api_key_prefix),因此请求在鉴权阶段就被拒绝,与视频内容、配音角色、语言设置无关。

排查与解决步骤

  1. 打开 菜单 → 翻译设置 → Elevenlabs.io,清空当前填写的 Key。
  2. 登录 https://elevenlabs.io → 右上角头像 → Profile / API Keys → 生成或复制完整的 API Key。必须是 sk_ 开头的一长串字符,中间不能有空格、换行,末尾也不能带多余字符。
  3. 粘贴后保存,再重新点击「试听」验证。
  4. 如果这个 Key 是第三方中转或聚合平台(如 302.AI 等)提供的、本身不是 sk_ 开头,那么该渠道无法使用——因为 pyVideoTrans 的 Elevenlabs.io 渠道走的是官方 SDK,会强制校验 sk_ 前缀。这类中转服务请改用 菜单 → 翻译设置 → 302.AI 等方式接入,或直接选用 fish.audio、豆包语音合成2.0、Qwen-TTS、Edge-TTS(免费) 等渠道替代。
  5. 若确认 Key 来自官方且确为 sk_ 开头仍报错,请检查是否复制了别的平台的密钥(例如把 OpenAI、DeepSeek 的 Key 误贴到了 Elevenlabs 设置页)。

补充:该报错同时说明你正在使用 试听 功能(日志中 listen_voice 路径),试听失败不代表整条链路有问题,修正 Key 后即可正常配音。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Dondate via ko-fi.com

Related resource