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

2407:cdc0* Posted at: 9 hours ago 👁7

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


Dd24 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 924, in run
File "videotrans\translator\_base.py", line 78, in run
File "videotrans\translator\_base.py", line 137, in _run_srt
File "videotrans\translator\_deepseek.py", line 55, in _item_task
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\chat\completions\completions.py", line 1156, in create
File "openai\_base_client.py", line 1259, in post
File "openai\_base_client.py", line 1047, in request
openai.AuthenticationError: Error code: 401 - {'error': {'message': 'Authentication Fails, Your api key:
Dd24 is invalid', 'type': 'authentication_error', 'param': None, 'code': 'invalid_request_error'}}


=
system:Windows-10-10.0.26200-SP0
version:v3.92
frozen:True
language:zh
root_dir:D:/A

1 Replies

API 密钥错误,请检查密钥是否正确。错误代码 401 表示身份验证失败,具体原因是您输入的 DeepSeek API 密钥无效。

请按以下步骤解决:

  1. 检查密钥正确性:登录 DeepSeek 开放平台,确认您复制的 API 密钥是否完整无误。注意密钥通常以 sk- 开头。
  2. 检查密钥状态:在 DeepSeek 平台确认密钥是否已启用、未过期,并且有足够的余额或调用次数。
  3. 重新填写密钥:在 pyVideoTrans 中,点击菜单栏的 设置 -> 翻译设置,找到 DeepSeek 翻译渠道,删除旧密钥后,重新粘贴正确的新密钥。
  4. 检查网络代理:如果您在国内使用,确保在软件主界面第 5 行的“网络代理”中填写了正确的代理地址(如 http://127.0.0.1:7860)。
  5. 尝试其他渠道:如果问题依旧,可以暂时切换到其他翻译渠道(如 Google、ChatGPT 等)进行测试。

如果以上步骤均无法解决,请提供完整的日志文件(位于 D:/A/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.

Donate: https://ko-fi.com/jianchang512

Similar issues already exist

Trending Questions