#8929 OpenAI ChatGPT: [chatgpt] 无法连接到 http://key_dkbuy9lfdlifmeoo,可能当前网络不可访问该API, 若是本地服务,请确认已部署并启动Connection error.,

2602**219 Posted at: 9 hours ago

OpenAI ChatGPT: [chatgpt] 无法连接到 http://key_dkbuy9lfdlifmeoo,可能当前网络不可访问该API, 若是本地服务,请确认已部署并启动
Connection error.,
Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\http_proxy.py", line 207, in handle_request
File "httpcore\_sync\connection.py", line 101, in handle_request
File "httpcore\_sync\http11.py", line 143, in handle_request
File "httpcore\_sync\http11.py", line 113, in handle_request
File "httpcore\_sync\http11.py", line 186, in _receive_response_headers
File "httpcore\_sync\http11.py", line 224, in _receive_event
File "httpcore\_backends\sync.py", line 124, in read
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.ReadError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

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

Traceback (most recent call last):
File "openai\_base_client.py", line 1037, in request
File "openai\_client.py", line 440, in _send_request
File "openai\_client.py", line 418, in _send_with_auth_retry
File "openai\_base_client.py", line 964, in _send_request
File "httpx\_client.py", line 914, in send
File "httpx\_client.py", line 942, in _send_handling_auth
File "httpx\_client.py", line 979, in _send_handling_redirects
File "httpx\_client.py", line 1014, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.ReadError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

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

Traceback (most recent call last):
File "videotrans\translator\_openaicompat.py", line 99, in _item_task
File "videotrans\translator\_openaicompat.py", line 39, 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 1072, in request
openai.APIConnectionError: Connection 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 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 107, in _item_task
videotrans.configure.excepts.StopTask: [chatgpt] 无法连接到 http://key_dkbuy9lfdlifmeoo,可能当前网络不可访问该API, 若是本地服务,请确认已部署并启动
Connection error.


=
system:Windows-10-10.0.19045-SP0
version:v4.19
frozen:True
language:zh_CN
root_dir:D:/翻译配音软件

1 Replies

#1 DeepSeek reply at 9 hours ago

核心原因:你把 API 密钥误填到了 API 地址栏。报错中的 http://key_dkbuy9lfdlifmeoo 是一个密钥字符串,并非合法的 API 服务地址,因此必然连接失败(WinError 10054 远程主机强迫关闭连接 也是因为该地址无法解析成有效服务)。

解决步骤:

  1. 打开 菜单 → 翻译设置 → OpenAI ChatGPT(或对应的 OpenAI 兼容渠道)设置窗口。
  2. API 地址栏改为真正的接口地址,例如:

    • 官方:https://api.openai.com/v1
    • 第三方/中转服务:填服务商给出的地址,通常形如 https://xxx.com/v1(必须以 /v1 结尾,若用 responses API 则以 /responses 结尾)
    • 本地部署:http://127.0.0.1:端口/v1
  3. API Key / 密钥栏才填 key_dkbuy9lfdlifmeoo 这类密钥字符串(如为官方则为 sk- 开头)。
  4. 保存后重新执行任务。若之前失败过,请勾选主界面 清理已生成 再重试。

补充说明:

  • 若使用官方 OpenAI,中国大陆需在主导航栏 网络代理 填 http://127.0.0.1:端口 并确保代理已启动;国内中转/国内 API 无需代理。
  • 填写无效代理同样会导致连接失败,不确定请留空。
  • 若确认地址与密钥分栏填写正确后仍报 10054,请更换干净的代理节点或联系中转服务商确认线路可用。

请查阅相关文档:

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