#3043 requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://openrouter.ai/api/v1/chat/completions%20%5C?

2a02:6ea0* Posted at: 11 days ago 👁90

404 Client Error: Not Found for url: https://openrouter.ai/api/v1/chat/completions%20%5C?sk=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:
Traceback (most recent call last):
File "videotrans\recognition\_base.py", line 140, in run
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\TestSTT.py", line 17, in run
File "videotrans\recognition\__init__.py", line 236, in run
File "videotrans\recognition\_base.py", line 171, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\recognition\_recognapi.py", line 84, in _exec
File "requests\models.py", line 1026, in raise_for_status
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://openrouter.ai/api/v1/chat/completions%20%5C?sk=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


=
system:Windows-10-10.0.26200-SP0
version:v3.95
frozen:True
language:zh
root_dir:C:/py

1 Replies

这是由于在配置 OpenRouter AI 翻译渠道时,API URL 格式错误,导致请求地址不正确。

解决方案

  1. 检查并修正 API URL:在软件设置中,找到 OpenRouter AI 翻译渠道的配置。确保 API URL 字段填写为 https://openrouter.ai/api/v1/chat/completions。你的错误日志显示 URL 末尾错误地附加了 API Key 参数(%20%5C?sk=...),这通常是复制粘贴时格式混乱导致的。
  2. 单独填写 API Key:将你的 OpenRouter API Key 填写到专门的 API Key 输入框中,不要将其拼接在 URL 后面。
  3. 填写模型名称:在 模型 输入框中手动填写你想要使用的模型名称,例如 deepseek/deepseek-chatmeta-llama/llama-3.1-8b-instruct 等。
  4. 保存并测试:修正后保存设置,并点击“测试”按钮验证连接是否成功。

配置正确格式示例

  • API URL: https://openrouter.ai/api/v1/chat/completions
  • API Key: sk-or-v1-xxxxxxxxxx...
  • 模型: deepseek/deepseek-chat

请查阅相关文档:

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.

Related resource

Similar issues already exist