#1141 302 ai api key error

207.174* Posted at: 8 days ago 👁27

401 Client Error: Unauthorized for url: https://api.302.ai/v1/chat/completions:Traceback (most recent call last):
File "videotrans\translator\_base.py", line 81, in run
File "videotrans\translator\_base.py", line 99, in _run_text
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\__init__.py", line 887, in run
File "videotrans\translator\_base.py", line 83, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_ai302.py", line 53, in _item_task
File "requests\models.py", line 1026, in raise_for_status
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.302.ai/v1/chat/completions
image

1 Replies

错误代码 401 Unauthorized 表示您提供的 302 AI API Key 无效或权限不足。

请按以下步骤检查和解决:

  1. 验证 API Key:请登录 302 AI 平台,确认您的 API Key 是否有效、未过期,并且拥有调用 chat/completions 接口的权限。
  2. 复制粘贴:在软件的“翻译设置”菜单中,确保 API Key 是完全正确、无多余空格或字符地粘贴到对应输入框。
  3. 检查额度:确认您的 302 AI 账户有足够的余额或调用额度。
  4. 切换渠道:如果确认 API Key 无误,可以暂时切换到其他翻译渠道(如 Google、Gemini 等)以完成当前任务。

如果问题持续,建议直接联系 302 AI 的官方客服以确认您的账户和 API Key 状态。

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