#8912 翻译字幕阶段出错 [DeepSeek] Authentication Fails, Your api key: **** Key is invalid (request_id: 31571e4e-d942-441f-a888-cf28573

171.213**1 Posted at: 2 hours ago

翻译字幕阶段出错 [DeepSeek] Authentication Fails, Your api key:


Key is invalid (request_id: 31571e4e-d942-441f-a888-cf285739cb59)
https://api.deepseek.com/v1/
{'model': 'deepseek-flash', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 16384}
{'thinking': {'type': 'disabled'}}
Traceback (most recent call last):

File "videotrans\translator\_openaicompat.py", line 90, in _item_task

File "videotrans\translator\_openaicompat.py", line 40, 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': {'message': 'Authentication Fails, Your api key:


Key is invalid (request_id: 31571e4e-d942-441f-a888-cf285739cb59)', 'type': 'authentication_error', 'param': None, 'code': 'invalid_request_error'}}

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

Traceback (most recent call last):

File "videotrans\task\job.py", line 35, in run

File "videotrans\task\job.py", line 136, in process_task

File "videotrans\task\_stage_translate.py", line 31, in trans

File "videotrans\translator\_runner.py", line 71, in run

File "videotrans\translator\_base.py", line 82, in run

File "videotrans\translator\_base.py", line 165, 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 101, in _item_task

videotrans.configure.excepts.StopTask: Authentication Fails, Your api key:


Key is invalid (request_id: 31571e4e-d942-441f-a888-cf285739cb59)
https://api.deepseek.com/v1/
{'model': 'deepseek-flash', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 16384}
{'thinking': {'type': 'disabled'}}
trk=[TransCreate]: uuid='d5fec548b4', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 批量翻译模式
原始输入文件名: D:/dvrcc16-mp4.mp4,
输出结果保存到文件夹: D:/_video_out/dvrcc16-mp4-mp4,
临时文件夹: D:/pyvideotrans/win-pyvideotrans-v4.16/tmp/20696/d5fec548b4
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:faster-whisper(内置), large-v3-turbo, 发音语言: 英语, LLM纠错
翻译渠道:DeepSeek,原始语言:英语,目标语言:简体中文, 已选 发送完整字幕
配音渠道:Edge-TTS(免费), 角色:Yunxi(Male/CN), 配音语言:简体中文, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 未选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: 嵌入硬字幕 , precent=12, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='', should_recogn2=False, do_diarize=False


=
system:Windows-10-10.0.26300-SP0
version:v4.16
frozen:True
language:zh_CN
root_dir:D:/pyvideotrans/win-pyvideotrans-v4.16

1 Replies

#1 DeepSeek reply at 2 hours ago

这是 DeepSeek 平台返回的 401 认证失败,即你在 菜单 → 翻译设置 → DeepSeek 中填写的 API Key 无效(错误、已失效、复制不完整或含多余空格),与软件本身逻辑无关。

处理步骤:

  1. 登录 https://platform.deepseek.com/ ,进入「API keys」页面,确认该 Key 状态正常(未被删除/禁用),必要时重新创建一个新 Key。
  2. 打开软件 菜单 → 翻译设置 → DeepSeek,清空原密钥框,重新粘贴新 Key。注意:只粘贴 sk- 开头的完整字符串,前后不要带空格、换行或引号。
  3. 确认 API 地址填写为 https://api.deepseek.com/v1/,不要随意改动。
  4. 在同一页面确认账户 余额充足(余额为 0 时请求同样会被拒绝)。
  5. 保存后,回到主界面勾选 清理已生成,并手动删除 软件目录/tmp/translate_cache/ 内的缓存文件,再重新执行任务。
  6. 若确认 Key 与余额均正常仍报同样错误,请确认模型名 deepseek-flash 是否在你账号的可用模型列表内(可在 DeepSeek 平台「模型列表/文档」中核对),名称不存在时也会导致调用异常。

补充说明:若你使用的是第三方中转平台而非 DeepSeek 官方,请把中转地址和其提供的 Key 填入对应设置,切勿混用官方地址与第三方 Key。

请查阅相关文档:

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