#8911 翻译字幕阶段出错 [DeepSeek] Authentication Fails, Your api key: **** Key is invalid (request_id: 9ca724ad-50ae-4ecb-a266-1505b14

171.213**1 Posted at: 2 hours ago

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


Key is invalid (request_id: 9ca724ad-50ae-4ecb-a266-1505b1448621)
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: 9ca724ad-50ae-4ecb-a266-1505b1448621)', '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: 9ca724ad-50ae-4ecb-a266-1505b1448621)
https://api.deepseek.com/v1/
{'model': 'deepseek-flash', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 16384}
{'thinking': {'type': 'disabled'}}
trk=[TransCreate]: uuid='36469df161', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 批量翻译模式
原始输入文件名: D:/dvrcc17-mp4.mp4,
输出结果保存到文件夹: D:/_video_out/dvrcc17-mp4-mp4,
临时文件夹: D:/pyvideotrans/win-pyvideotrans-v4.16/tmp/20696/36469df161
已选 清理已存在
已启用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 渠道的 API Key 鉴权失败(HTTP 401 Key is invalid)。服务器认定你填写的 key 不存在、已失效或被截断/含多余字符,因此请求被直接拒绝,翻译阶段无法继续。

解决步骤:

  1. 核对 key 来源与状态

    • 登录 https://platform.deepseek.com/ → 「API keys」页面,确认该 key 仍存在且未删除、未过期。
    • 若列表中查不到你填写的这个 key,说明已被删除,请新建一个。
  2. 重新填写到软件

    • 菜单 → 翻译设置 → DeepSeek,删除原 Key 内容后重新粘贴。
    • 粘贴时务必只复制 sk- 开头的整串字符,前后不要带空格、换行、引号,也不要一次填多个 key。
    • 保存后重启软件(配置写入 videotrans/params.json,偶发写入失败也会导致读不到 key)。
  3. 确认账户可用

    • 在 DeepSeek 平台的「用量/充值」页面确认账户有余额。余额为 0 时部分接口会返回鉴权类错误。
    • 若你在国内访问,DeepSeek 是境内服务,不要在主界面「网络代理」栏为它设置代理;若代理栏填了内容,请清空,避免请求被转到错误出口。
  4. 确认请求地址未被改动

    • 报错中地址为 https://api.deepseek.com/v1/,这是正确的官方地址。若你的设置窗口里手动改过 API 地址(例如中转站地址),请恢复为官方地址,或确认中转站地址与 key 属于同一服务商。
  5. 验证是否已修复

    • 可用左侧面板「翻译字幕」功能导入一个小 srt 文件,翻译渠道选 DeepSeek 单独测试,成功后再跑视频翻译。
    • 该任务已因 401 中断,重跑时请勾选 清理已生成 后重新开始。
  6. 临时替代方案(若短时间内拿不到可用 key)

    • 翻译渠道改用 M2M100(内置)(本地离线,首次使用需下载模型)。
    • 或改用其他 AI 渠道(如智谱AI、阿里百炼等),同样需填写对应平台的 key。

补充说明:日志中的 'model': 'deepseek-flash'、max_tokens: 16384、thinking: disabled 均为正常参数,与本次报错无关,无需调整。

请查阅相关文档:

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