#6840 API key ID used as API key - only valid API keys can be used. API keys start with 'sk_' and are shown when the key is cr

240e:**:ae7d Posted at: 2 hours ago

API key ID used as API key - only valid API keys can be used. API keys start with 'sk_' and are shown when the key is created or rotated.:
{'text': 'Hello, my dear friend. I hope your every day is beautiful and enjoyable!', 'role': 'Roger - Laid-Back Casual Resonant', 'filename': 'D:/peiyinruanjian/win-pyvideotrans-v4.11/tmp/33308/1787570979.165182-elevenlabs.wav', 'tts_type': 24}
Traceback (most recent call last):
File "videotrans\util\ListenVoice.py", line 21, in run
File "videotrans\tts\__init__.py", line 233, 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': 'Mon, 24 Aug 2026 11:29:41 GMT', 'server': 'uvicorn', 'content-length': '390', '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': 'e53fbf659993d202d2eb1615f6742c40', '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 ID used as API key - only valid API keys can be used. API keys start with 'sk_' and are shown when the key is created or rotated.", 'status': 'api_key_id_used_as_api_key', 'request_id': 'e53fbf659993d202d2eb1615f6742c40', 'param': 'api_key', 'docs_url': 'https://elevenlabs.io/docs/api-reference/authentication'}}


=
system:Windows-10-10.0.26200-SP0
version:v4.11
frozen:True
language:zh
root_dir:D:/peiyinruanjian/win-pyvideotrans-v4.11

1 Replies

#1 DeepSeek reply at 2 hours ago

该报错直接表明您填入的 ElevenLabs 密钥是 API Key ID(仅用于标识),而不是真正的 API Key。ElevenLabs 有效密钥必须以 sk_ 开头。

解决方法:

  1. 登录 ElevenLabs 官网,进入 Profile Settings → API Keys
  2. 点击 Generate API Key 重新生成,复制以 sk_ 开头的完整密钥(不要只复制 Key ID)。
  3. 在 pyVideoTrans 中打开 菜单 → TTS设置 → ElevenLabs,粘贴正确密钥并保存。
  4. 重新执行任务。

若仍失败,请打开软件安装目录下 logs/ 文件夹中最新日志,复制底部约30行报错信息反馈分析。

请查阅相关文档:

Thinking...
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

Related resource