#6395 API key must start with 'sk_'.:{'text': 'hello,my friend', 'role': 'Roger - Laid-Back Casual Resonant', 'filename': 'D:/

2405:**:7e14 Posted at: 10 hours ago

API key must start with 'sk_'.:
{'text': 'hello,my friend', 'role': 'Roger - Laid-Back Casual Resonant', 'filename': 'D:/pyVideoTrans/win-pyvideotrans-v4.07/tmp/1704/1785971405.7137778-elevenlabs.wav', 'tts_type': 22}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 221, in run
File "videotrans\tts\_base.py", line 130, 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
File "contextlib.py", line 135, in enter
File "elevenlabs\text_to_speech\raw_client.py", line 204, in convert
File "elevenlabs\text_to_speech\raw_client.py", line 202, in _stream
elevenlabs.core.api_error.ApiError: headers: {'date': 'Wed, 05 Aug 2026 23:10:06 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': 'd28fd982eaf8dc2d85096f195c1bc622', 'x-region': 'asia-southeast1', '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': 'd28fd982eaf8dc2d85096f195c1bc622', 'param': 'api_key'}}


=
system:Windows-10-10.0.22631-SP0
version:v4.08
frozen:True
language:zh
root_dir:D:/pyVideoTrans/win-pyvideotrans-v4.07

1 Replies

这是 ElevenLabs 配音渠道返回的 API 密钥认证错误:你当前填入的 ElevenLabs API Key 格式不正确,官方密钥必须以 sk_ 开头(返回码 invalid_api_key_prefix)。

解决方案

  1. 打开 ElevenLabs 官网,登录后在 Profile Settings → API Keys 页面生成或复制一个新的 API Key(新版 key 均以 sk_ 开头)。
  2. 确保复制时没有多余空格、没有截断,并确认该 Key 处于启用状态。
  3. 回到 pyVideoTrans,进入 菜单 → 翻译设置/TTS设置 → ElevenLabs,将新的 sk_ 开头的 Key 填入对应输入框并保存。
  4. 如果使用的不是官方地址,检查是否填入了第三方代理/中转地址;中转服务可能要求不同的 Key 前缀,请以该服务商提供的 Key 为准。
该报错仅代表 Key 前缀校验失败,与网络、配音角色无关。若更换正确 Key 后仍报错,请提供软件安装目录下 logs/ 文件夹中最新的日志文件。
Post Your Reply
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

Dondate via PayPal

Related resource