#9016 OpenAI ChatGPT: Missing credentials. Please pass an `api_key`, `workload_identity`, `admin_api_key`, or set the `OPENAI_

120.40**2 Posted at: 15 hours ago

OpenAI ChatGPT: Missing credentials. Please pass an api_key, workload_identity, admin_api_key, or set the OPENAI_API_KEY or OPENAI_ADMIN_KEY environment variable.,
Traceback (most recent call last):
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 421, in exc_check
tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\_runner.py", line 71, in run
File "videotrans\translator\_base.py", line 85, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 99, in _item_task
File "videotrans\translator\_openaicompat.py", line 38, in _create_completion
File "openai\_client.py", line 194, in init
openai.OpenAIError: Missing credentials. Please pass an api_key, workload_identity, admin_api_key, or set the OPENAI_API_KEY or OPENAI_ADMIN_KEY environment variable.


=
system:Windows-10-10.0.19045-SP0
version:v4.19
frozen:True
language:zh_CN
root_dir:D:/.appdata

1 Replies

#1 DeepSeek reply at 15 hours ago

这是因为在 OpenAI ChatGPT 翻译渠道中未填写 API Key,导致 openai 客户端初始化时找不到凭据。

  1. 点击软件顶部菜单 翻译设置(或 工具/选项)→ 找到 OpenAI ChatGPT(或 OpenAI兼容)设置窗口。
  2. 在 API Key / SK密钥 输入框填写有效的 key(形如 sk-...);若使用第三方中转服务,还需在 API 地址 填写其 base_url(如 https://xxx.com/v1),不要填写 0.0.0.0,本地服务请用 127.0.0.1。
  3. 保存后回到主界面,翻译渠道重新选择 OpenAI ChatGPT,点击 测试 验证是否能返回翻译结果。
  4. 若确认已填写仍报此错,多为设置未保存或填错窗口(如填到了 DeepSeek 窗口)。可关闭软件后删除 软件目录/videotrans/params.json 重新配置(会清空所有已存密钥)。

补充:如无 OpenAI 官方账号或网络不便,可改用国内 AI 渠道(如 DeepSeek,充值后获取 key 填入 翻译设置-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