#3387 openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Authentication Fails, Your api key: ****.com is inv

70.173* Posted at: 2 hours ago 👁5

API密钥错误,请检查密钥是否正确 Error code: 401 - {'error': {'message': 'Authentication Fails, Your api key:


.com is invalid', 'type': 'authentication_error', 'param': None, 'code': 'invalid_request_error'}}:Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 982, in run
File "videotrans\translator\_base.py", line 102, in run
File "videotrans\translator\_base.py", line 165, in _run_srt
File "videotrans\translator\_deepseek.py", line 52, in _item_task
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\chat\completions\completions.py", line 1192, in create
File "openai\_base_client.py", line 1297, in post
File "openai\_base_client.py", line 1070, in request
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Authentication Fails, Your api key:
.com is invalid', 'type': 'authentication_error', 'param': None, 'code': 'invalid_request_error'}}


=
system:Windows-10-10.0.26200-SP0
version:v3.97
frozen:True
language:zh
root_dir:F:/win-pyvideotrans-v3.97-225

1 Replies

这是由于 DeepSeek 翻译渠道的 API 密钥配置错误导致的。

  1. 检查 API 密钥:请登录你的 DeepSeek 平台,确认你复制的 API Key 是否正确且未过期。确保密钥字符串完整,没有多余的空格或换行。
  2. 检查 API 地址:在软件“翻译渠道”设置中,确认“API URL”填写正确。对于 DeepSeek,通常应为 https://api.deepseek.com
  3. 检查模型名称:在“模型”输入框中,确认填写了正确的模型名称,例如 deepseek-chatdeepseek-reasoner
  4. 重新配置:在软件设置中,删除当前的 DeepSeek 配置,重新填写 API URL 和 API Key,然后点击“测试”按钮验证连接是否成功。

请查阅相关文档:

Post Your Reply