#2697 openai.PermissionDeniedError: Error code: 403 - {'error': {'code': 'unsupported_country_region_territory', 'message': 'C

103.197* Posted at: 6 hours ago 👁7

当前密钥没有访问权限,请检查权限设置 Error code: 403 - {'error': {'code': 'unsupported_country_region_territory', 'message': 'Country, region, or territory not supported', 'param': None, 'type': 'request_forbidden'}}:
Traceback (most recent call last):
File "videotrans\util\TestSTT.py", line 18, in run
File "videotrans\recognition\__init__.py", line 218, in run
File "videotrans\recognition\_base.py", line 80, in run
File "videotrans\recognition\_openairecognapi.py", line 66, in _exec
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\audio\transcriptions.py", line 406, in create
File "openai\_base_client.py", line 1259, in post
File "openai\_base_client.py", line 1047, in request
openai.PermissionDeniedError: Error code: 403 - {'error': {'code': 'unsupported_country_region_territory', 'message': 'Country, region, or territory not supported', 'param': None, 'type': 'request_forbidden'}}


=
system:Windows-10-10.0.19045-SP0
version:v3.91
frozen:True
language:zh
root_dir:E:/AAAAAAA1

1 Replies

您遇到的错误 unsupported_country_region_territory 表明您当前所在的地区或网络环境无法访问 OpenAI 的语音识别 (Whisper) API。这是一个网络访问限制问题,与密钥本身无关。

核心解决方法:必须使用网络代理。

请按以下步骤操作:

  1. 配置代理:

    • 在软件主界面第 5 行,找到“网络代理”输入框。
    • 填入您可用的代理地址,格式为:http://代理IP:端口http://127.0.0.1:端口 (如果您在本地运行了代理软件,如 Clash、V2rayN 等)。
    • 示例: http://127.0.0.1:7890
  2. 重新测试:

    • 配置好代理后,返回“设置”页面,在“语音识别”区域选择“OpenAI-Whisper(API)”。
    • 点击“测试”按钮,检查是否能够成功连接。

如果问题依旧存在:

  • 检查代理有效性: 确保您填入的代理地址和端口正确,且代理软件本身工作正常(可以访问其他被墙的网站)。
  • 更换代理节点: 尝试更换代理服务器节点,选择一个支持 OpenAI 服务的地区(如美国、日本、新加坡等)。
  • 考虑替代方案: 如果代理问题无法解决,建议使用本地语音识别模型,例如 faster-whisper(本地)阿里FunASR(本地),它们不依赖网络且完全免费。

请查看更多参考文档:

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