#1125 openai.BadRequestError: Error code: 400 - [{'error': {'code': 400, 'message': 'User location is not supported for the AP

143.198* Posted at: 10 hours ago 👁12

Error code: 400 - [{'error': {'code': 400, 'message': 'User location is not supported for the API use.', 'status': 'FAILED_PRECONDITION'}}]:Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 17, in run
File "videotrans\translator\__init__.py", line 844, in run
File "videotrans\translator\_base.py", line 79, in run
File "videotrans\translator\_base.py", line 97, 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 400, in
File "concurrent\futures\_base.py", line 439, in result
File "concurrent\futures\_base.py", line 391, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_chatgpt.py", line 169, in _item_task
File "openai\_utils\_utils.py", line 287, in wrapper
File "openai\resources\chat\completions\completions.py", line 1150, in create
File "openai\_base_client.py", line 1259, in post
File "openai\_base_client.py", line 1047, in request
openai.BadRequestError: Error code: 400 - [{'error': {'code': 400, 'message': 'User location is not supported for the API use.', 'status': 'FAILED_PRECONDITION'}}]


=
Windows-10-10.0.26100-SP0
version:v3.80
frozen:True
language:zh

1 Replies

这个错误是由于您所在的地理位置不被 OpenAI API 支持导致的。错误信息 "User location is not supported for the API use." 表明您所在的地区无法使用 OpenAI 服务。

请尝试以下解决方案:

  1. 切换翻译渠道:在菜单栏选择 翻译设置,将翻译渠道切换到其他可用的服务,如 Google、Microsoft、DeepL 或 Gemini 等。
  2. 使用代理:如果您必须使用 OpenAI,需要配置网络代理。在菜单栏选择 翻译设置,找到 OpenAI 相关设置区域,填入可用的代理地址(格式如 http://127.0.0.1:10809)。
  3. 检查 API 密钥:确保您的 OpenAI 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

Similar issues already exist

Trending Questions