#1508 anthropic.APIConnectionError: Connection error.

2402:7500* Posted at: 1 hour ago 👁19

网络连接失败: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 298, in handle_request
httpcore.ProxyError: 407 Proxy Authentication Required

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

Traceback (most recent call last):
File "anthropic\_base_client.py", line 992, in _request
File "httpx\_client.py", line 913, in send
File "httpx\_client.py", line 941, in _send_handling_auth
File "httpx\_client.py", line 978, in _send_handling_redirects
File "httpx\_client.py", line 1013, 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.ProxyError: 407 Proxy Authentication Required

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\__init__.py", line 939, in run
File "videotrans\translator\_base.py", line 83, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_claude.py", line 76, in _item_task
File "anthropic\_utils\_utils.py", line 275, in wrapper
File "anthropic\resources\messages\messages.py", line 901, in create
File "anthropic\_base_client.py", line 1279, in post
File "anthropic\_base_client.py", line 956, in request
File "anthropic\_base_client.py", line 1016, in _request
File "anthropic\_base_client.py", line 1094, in _retry_request
File "anthropic\_base_client.py", line 1016, in _request
File "anthropic\_base_client.py", line 1094, in _retry_request
File "anthropic\_base_client.py", line 1026, in _request
anthropic.APIConnectionError: Connection error.


=
system:Windows-10-10.0.19045-SP0
version:v3.83
frozen:True
language:zh
root_dir:D:/[Mine]Setup/win-videotrans-v3.83

9 Replies

这个错误是由于代理服务器需要认证导致的。您设置了网络代理,但代理服务器要求用户名和密码验证。

请按以下步骤解决:

  1. 检查代理设置:在软件主界面的“网络代理地址”文本框中,您的代理地址格式应为 http://用户名:密码@代理IP:端口http://代理IP:端口
  2. 验证代理信息:确保您提供的用户名和密码是正确的,并且代理服务器当前可用。
  3. 临时关闭代理:如果问题持续,可以暂时清空“网络代理地址”文本框,但这样将无法使用需要代理的翻译渠道(如Claude、Google等)。
  4. 测试连接:在菜单栏选择“翻译设置”,找到您使用的Claude渠道,点击“测试”按钮验证连接是否正常。

错误信息显示代理服务器返回了407状态码(Proxy Authentication Required),这表明代理服务器已收到请求但拒绝了身份验证。

网络连接失败: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 298, in handle_request
httpcore.ProxyError: 407 Proxy Authentication Required

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

Traceback (most recent call last):
File "anthropic\_base_client.py", line 992, in _request
File "httpx\_client.py", line 913, in send
File "httpx\_client.py", line 941, in _send_handling_auth
File "httpx\_client.py", line 978, in _send_handling_redirects
File "httpx\_client.py", line 1013, 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.ProxyError: 407 Proxy Authentication Required

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\__init__.py", line 939, in run
File "videotrans\translator\_base.py", line 83, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_claude.py", line 76, in _item_task
File "anthropic\_utils\_utils.py", line 275, in wrapper
File "anthropic\resources\messages\messages.py", line 901, in create
File "anthropic\_base_client.py", line 1279, in post
File "anthropic\_base_client.py", line 956, in request
File "anthropic\_base_client.py", line 1016, in _request
File "anthropic\_base_client.py", line 1094, in _retry_request
File "anthropic\_base_client.py", line 1016, in _request
File "anthropic\_base_client.py", line 1094, in _retry_request
File "anthropic\_base_client.py", line 1026, in _request
anthropic.APIConnectionError: Connection error.

這次刪除了IP地址,本人不在境內,連結Claude API仍需要代理嗎?

是的,即使您不在境内,连接Claude API仍然需要代理。Claude API的服务器位于境外,但您的网络环境可能仍然需要通过企业或组织的代理服务器才能访问外部网络。

从错误信息可以看出,您的网络请求被代理服务器拦截并要求认证(407 Proxy Authentication Required)。这说明您的网络环境强制使用代理服务器,即使您的地理位置在境外。

解决方案:

  1. 获取正确的代理认证信息:联系您的网络管理员获取代理服务器的用户名和密码
  2. 在软件中配置代理:在主界面的"网络代理地址"文本框中填写格式为:http://用户名:密码@代理服务器地址:端口
  3. 测试连接:配置后在菜单栏选择"翻译设置",找到Claude渠道点击"测试"按钮验证连接

如果您无法获得代理认证信息,可能需要切换到不需要代理的翻译渠道,或者使用其他网络环境。

這次我使用了自行購買的Proxy(動態住宅代理),仍然錯誤

Error code: 404 - {'type': 'error', 'error': {'type': 'not_found_error', 'message': 'model: claude-3-7-sonnet-latest'}, 'request_id': 'req_011CVGqcx2yL1PfLuxy7Y5fB'}:Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 939, in run
File "videotrans\translator\_base.py", line 83, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_claude.py", line 76, in _item_task
File "anthropic\_utils\_utils.py", line 275, in wrapper
File "anthropic\resources\messages\messages.py", line 901, in create
File "anthropic\_base_client.py", line 1279, in post
File "anthropic\_base_client.py", line 956, in request
File "anthropic\_base_client.py", line 1060, in _request
anthropic.NotFoundError: Error code: 404 - {'type': 'error', 'error': {'type': 'not_found_error', 'message': 'model: claude-3-7-sonnet-latest'}, 'request_id': 'req_011CVGqcx2yL1PfLuxy7Y5fB'}

这个错误显示Claude API无法找到指定的模型 "claude-3-7-sonnet-latest"。这通常是因为模型名称不正确或该模型在您使用的API版本中不可用。

请按以下步骤解决:

  1. 检查Claude模型名称:在菜单栏选择"翻译设置",找到Claude翻译渠道,确认模型名称是否正确。最新可用的Claude模型名称应为:

    • claude-3-5-sonnet-20241022
    • claude-3-opus-20240229
    • claude-3-sonnet-20240229
    • claude-3-haiku-20240307
  2. 更新模型名称:将模型名称改为上述可用的模型之一,建议使用 claude-3-5-sonnet-20241022
  3. 验证API密钥:确保您的Claude API密钥有效且具有访问相应模型的权限
  4. 测试连接:修改模型名称后,点击"测试"按钮验证连接是否正常

错误信息中的 "not_found_error" 明确表示API服务器无法识别您请求的模型名称,这是配置问题而非网络连接问题。

您好,我成功了
另外,目前購買claude api已經不支援sonnet 4之下的版本了
故3-5確定無法使用

感谢您的反馈。既然Claude API已不再支持3-5版本,您需要选择其他可用的翻译渠道:

  1. 其他AI翻译渠道:在翻译设置中可以选择

    • OpenAI ChatGPT (GPT-4o等)
    • Gemini (gemini-1.5-pro等)
    • DeepSeek
    • 智谱AI
    • 硅基流动
  2. 传统翻译渠道

    • Google翻译
    • 微软翻译
    • 百度翻译
    • 腾讯翻译
  3. 本地模型

    • 如果您有本地部署的大模型,可以使用"兼容AI/本地模型"渠道

请根据您的需求和API可用性选择合适的翻译渠道。如果您需要使用特定的Claude模型,建议查阅Anthropic官方文档确认当前支持的模型列表。

claude-sonnet-4
claude-sonnet-4-5
claude-opus-4
claude-opus-4-1
Claude Haiku 4.x
Claude Haiku 3.5
Claude Haiku 3

以上是官方現提供可用的模型
供參

感谢您提供的最新Claude可用模型列表。要在pyVideoTrans中使用这些模型,请按以下步骤配置:

  1. 在菜单栏选择 翻译设置
  2. 找到Claude翻译渠道
  3. 在模型名称字段中填入您想要使用的模型,例如:

    • claude-3-5-sonnet-20241022 (推荐)
    • claude-3-opus-20240229
    • claude-3-sonnet-20240229
    • claude-3-haiku-20240307
  4. 确保您的API密钥有效且网络代理设置正确
  5. 点击"测试"按钮验证连接

根据您之前的信息,Claude-3-5版本应该是当前可用的最新模型。如果仍有问题,请确认您的API密钥是否具有访问相应模型的权限。

Post Your Reply
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.

Donate: https://ko-fi.com/jianchang512

Trending Questions