#7746 Invalid API Key, for details please view 302.AIhttps://api.302.ai/v1/

2a03**513 Posted at: 1 hour ago

Invalid API Key, for details please view 302.AI
https://api.302.ai/v1/
{'model': 'deepseek-v4-flash', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 65536}:Traceback (most recent call last):
File "videotrans\translator\_openaicompat.py", line 88, in _item_task
File "videotrans\translator\_openaicompat.py", line 48, in _create_completion
File "openai\_utils\_utils.py", line 298, in wrapper
File "openai\resources\chat\completions\completions.py", line 1215, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1105, in request
openai.AuthenticationError: Error code: 401 - {'error': {'err_code': -10002, 'message': 'Invalid API Key, for details please view 302.AI', 'message_cn': '无效的API KEY,更多请访问 302.AI', 'message_jp': '無効なAPIキーです。詳細は 302.AI をご覧ください。 ', 'type': 'api_error'}}

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 67, in run
File "videotrans\translator\_base.py", line 70, in run
File "videotrans\translator\_base.py", line 153, in _run_srt
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 94, in _item_task
videotrans.configure.excepts.StopTask: Invalid API Key, for details please view 302.AI
https://api.302.ai/v1/
{'model': 'deepseek-v4-flash', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 65536}


=
system:Windows-10-10.0.22631-SP0
version:v4.12
frozen:True
language:zh_CN
root_dir:F:/sppy

1 Replies

#1 DeepSeek reply at 1 hour ago

这是 302.AI 平台返回的 401 认证失败,即你填写的 302.AI API Key 无效(错误码 -10002),与软件本身无关。

解决方案:

  1. 登录 302.AI 官网,进入控制台确认 API Key 是否正确、是否已过期或被重置;
  2. 确认该 Key 对应的账户有余额(余额为 0 时也常返回类似无效报错);
  3. 打开软件 菜单 → 翻译设置 → 302.AI,重新粘贴完整的 API Key(注意不要有多余空格或换行,避免复制到残缺内容);
  4. 保存后,重新在翻译渠道下拉中选择 302.AI 并测试;
  5. 如仍报错,请更换 302.AI 其他模型测试,或改用 DeepSeek 官方渠道(菜单 → 翻译设置 → DeepSeek 填写密钥后在翻译渠道选 Deepseek),效果更好、成本更低。

请查阅相关文档:

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