#8800 翻译字幕阶段出错 [OpenRouter] This model is not available in your region.https://openrouter.ai/api/v1

18.166**1 Posted at: 2 days ago

翻译字幕阶段出错 [OpenRouter] This model is not available in your region.
https://openrouter.ai/api/v1
{'model': 'anthropic/claude-sonnet-4.6', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 16384}
None
Traceback (most recent call last):
File "videotrans\translator\_openaicompat.py", line 87, in _item_task
File "videotrans\translator\_openaicompat.py", line 39, in _create_completion
File "openai\_utils\_utils.py", line 298, in wrapper
File "openai\resources\chat\completions\completions.py", line 1215, in create
File "openai\_base_client.py", line 1332, in post
File "openai\_base_client.py", line 1105, in request
openai.PermissionDeniedError: Error code: 403 - {'error': {'message': 'This model is not available in your region.', 'code': 403, 'metadata': {'routing_funnel': [{'step': 'Initial Endpoints', 'endpoint_count': 9}, {'step': 'Filter by Regional Surcharge', 'endpoint_count': 5}], 'failed_routing_step': 'Gate Endpoints with Geo Restrictions'}}}

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

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 113, in run
File "videotrans\task\_stage_translate.py", line 31, in trans
File "videotrans\translator\_runner.py", line 71, in run
File "videotrans\translator\_base.py", line 82, in run
File "videotrans\translator\_base.py", line 165, in _run_srt
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 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 99, in _item_task
videotrans.configure.excepts.StopTask: This model is not available in your region.
https://openrouter.ai/api/v1
{'model': 'anthropic/claude-sonnet-4.6', 'timeout': 300, 'temperature': 0.1, 'max_tokens': 16384}
None

trk=翻译视频 单视频模式
选择音视频文件: X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity/2.1-Clarity.mp4,
输出目录: X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity/_video_out/2.1-Clarity-mp4,
self.cfg.cache_folder='D:/pyvideotrans4.18/tmp/21084/5ec669d936'
已选 清理已生成, 未选 CUDA加速
语音识别:OpenRouter.ai, microsoft/mai-transcribe-2, 发音语言: 英语
最长语音持续(秒): 10s
最短语音持续(毫秒): 3000ms
静音分割持续毫秒: 600ms
语音阈值: 0.45
选择VAD: silero
翻译渠道:OpenRouter,发音语言:英语,目标语言:简体中文
已选 发送完整字幕, AI翻译渠道每批字幕行数:40
配音渠道:Edge-TTS(免费), 配音角色:Yunjian(Male/CN), 目标语言:简体中文
Volume:+0%, Speed:+0%, 未选 配音加速, 未选 视频慢速
未选 删字幕间静音, 已选 对齐字幕声音
已选 移除每条字幕配音开头结尾静音缓冲
静音移除力度: default
嵌入软字幕
video duration:1843754ms
video information:{'video_fps': 48.0, 'r_frame_rate': 48.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 1920, 'height': 1080, 'time': 1843754, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
self.cfg=TaskCfgVTT(uuid='5ec669d936', name='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity/2.1-Clarity.mp4', dirname='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity', noextname='2.1-Clarity', basename='2.1-Clarity.mp4', ext='mp4', target_dir='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity/_video_out/2.1-Clarity-mp4', cache_folder='D:/pyvideotrans4.18/tmp/21084/5ec669d936', is_cuda=False, source_language='英语', source_language_code='en', source_sub='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity/_video_out/2.1-Clarity-mp4/en.srt', source_wav='D:/pyvideotrans4.18/tmp/21084/5ec669d936/en.wav', source_wav_output='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity/_video_out/2.1-Clarity-mp4/en.m4a', target_language='简体中文', target_language_code='zh-cn', target_sub='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity/_video_out/2.1-Clarity-mp4/zh-cn.srt', target_wav='D:/pyvideotrans4.18/tmp/21084/5ec669d936/target.wav', target_wav_output='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity/_video_out/2.1-Clarity-mp4/zh-cn.m4a', translate_type=10, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='Yunjian(Male/CN)', voice_autorate=False, video_autorate=False, remove_silent_mid=False, align_sub_audio=True, detect_language='en', recogn_type=31, model_name='microsoft/mai-transcribe-2', shibie_audio=None, remove_noise=False, enable_diariz=False, nums_diariz=0, rephrase=False, fix_punc=0, app_mode='biaozhun', subtitle_language=None, targetdir_mp4='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/2 - Clarity/_video_out/2.1-Clarity-mp4/2.1-Clarity.mp4', novoice_mp4='D:/pyvideotrans4.18/tmp/21084/5ec669d936/novoice.mp4', is_separate=False, embed_bgm=True, instrument='D:/pyvideotrans4.18/tmp/21084/5ec669d936/instrument.wav', vocal='D:/pyvideotrans4.18/tmp/21084/5ec669d936/vocal.wav', clear_cache=True, background_music='', subtitle_type=2, only_out_mp4=False, recogn2pass=False, output_srt=0, copysrt_rawvideo=False, loop_backaudio=1, backaudio_volume=0.8, batch=False)
video_duration_ms=1843754


=
system:Windows-10-10.0.19045-SP0
version:v4.18
frozen:True
language:zh_CN
root_dir:D:/pyvideotrans4.18

1 Replies

#1 DeepSeek reply at 2 days ago

这是 OpenRouter 平台返回的 403 地理限制错误(Gate Endpoints with Geo Restrictions),并非 pyVideoTrans 本身的问题:你请求的 anthropic/claude-sonnet-4.6 模型的上游提供商对当前出口 IP 所在地区做了封锁,OpenRouter 直接拒绝了请求。

解决办法(任选其一,按推荐顺序)

  1. 更换 OpenRouter 中不受地区限制的模型
    打开 菜单 → 翻译设置 → OpenRouter,把模型从 anthropic/claude-sonnet-4.6 换成其他模型(如 DeepSeek、Gemini、Qwen 系列的 OpenRouter 模型名),保存后重试。不同模型的地区限制策略不同,换模型是最快的验证方式。
  2. 更换网络出口 IP
    若必须使用 Claude,需要把网络出口切到被允许的地区(如美国节点)。切换后,在软件主界面「对齐控制」行右侧的 网络代理 文本框填写代理地址(格式 http://127.0.0.1:7890),并确保代理已启动、端口正确,不能随意填写;填错会导致全部请求失败。
  3. 改用国内可直连的 AI 渠道(最省事)
    打开 菜单 → 翻译设置 → DeepSeek,填入 API Key,然后把主界面翻译渠道从 OpenRouter 改为 DeepSeek。国内可直连、不走代理、价格低、中文翻译质量好,可直接规避此类地区限制问题。

重试前注意

任务日志显示你已勾选 清理已生成,更换渠道或模型后,直接重新开始任务即可。若无报错但字幕仍为空白,再把 高级选项 → 字幕翻译 → AI翻译渠道每批字幕行数 调小到 20 以内。

另外你这版识别用的是 OpenRouter 的 microsoft/mai-transcribe-2,若该模型同样受地区限制,语音识别阶段也会失败,建议一并换成内置的 faster-whisper + large-v3-turbo。

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource