#8899 翻译字幕阶段出错 [OpenRouter] This request would exceed your available credits given your current in-flight requests. Retry afte

142.91**5 Posted at: 8 hours ago

翻译字幕阶段出错 [OpenRouter] This request would exceed your available credits given your current in-flight requests. Retry after in-flight requests settle, or add credits.
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 85, in run
File "tenacity\__init__.py", line 480, in call
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.APIStatusError: Error code: 402 - {'error': {'message': 'This request would exceed your available credits given your current in-flight requests. Retry after in-flight requests settle, or add credits.', 'code': 402, 'metadata': {'reason': 'in_flight_budget_exhausted', 'limit_source': 'openrouter_in_flight_budget', 'remedy_hint': 'Retry after your in-flight requests settle (see the Retry-After header). Adding credits at https://openrouter.ai/settings/credits raises your in-flight budget, up to a capped ceiling.', 'headers': {'Retry-After': '120'}, 'provider_name': None}}, 'user_id': 'user_3LpagcqkRLPO60IAsnVeLUUymaV'}

trk=翻译视频 单视频模式
选择音视频文件: X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity/4 - Connectivity-fixed.mp4,
输出目录: X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity/_video_out/4 - Connectivity-fixed-mp4,
self.cfg.cache_folder='D:/pyvideotrans4.18/tmp/21696/0db334c773'
未选 清理已生成, 未选 CUDA加速
已选 LLM纠错,LLM纠错每批字幕行数:50, LLM纠错所用AI渠道: OpenRouter
语音识别: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:7703784ms
video information:{'video_fps': 48.0, 'r_frame_rate': 48.0, 'video_codec_name': 'h264', 'audio_codec_name': 'aac', 'width': 1920, 'height': 1080, 'time': 7703784, 'streams_len': 2, 'streams_audio': 1, 'video_streams': 1, 'color': 'yuv420p'}
self.cfg=TaskCfgVTT(uuid='0db334c773', name='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity/4 - Connectivity-fixed.mp4', dirname='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity', noextname='4 - Connectivity-fixed', basename='4 - Connectivity-fixed.mp4', ext='mp4', target_dir='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity/_video_out/4 - Connectivity-fixed-mp4', cache_folder='D:/pyvideotrans4.18/tmp/21696/0db334c773', is_cuda=False, source_language='英语', source_language_code='en', source_sub='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity/_video_out/4 - Connectivity-fixed-mp4/en.srt', source_wav='D:/pyvideotrans4.18/tmp/21696/0db334c773/en.wav', source_wav_output='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity/_video_out/4 - Connectivity-fixed-mp4/en.m4a', target_language='简体中文', target_language_code='zh-cn', target_sub='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity/_video_out/4 - Connectivity-fixed-mp4/zh-cn.srt', target_wav='D:/pyvideotrans4.18/tmp/21696/0db334c773/target.wav', target_wav_output='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity/_video_out/4 - Connectivity-fixed-mp4/zh-cn.m4a', translate_type=10, tts_type=0, volume='+0%', pitch='+0Hz', voice_rate='+0%', voice_role='Yunjian(Male/CN)', voice_autorate=True, 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=True, fix_punc=0, app_mode='biaozhun', subtitle_language=None, targetdir_mp4='X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/4 - Connectivity/_video_out/4 - Connectivity-fixed-mp4/4 - Connectivity-fixed.mp4', novoice_mp4='D:/pyvideotrans4.18/tmp/21696/0db334c773/novoice.mp4', is_separate=False, embed_bgm=True, instrument='D:/pyvideotrans4.18/tmp/21696/0db334c773/instrument.wav', vocal='D:/pyvideotrans4.18/tmp/21696/0db334c773/vocal.wav', clear_cache=False, 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=7703784


=
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 8 hours ago

这是 OpenRouter 账户的 in-flight 预算(在途请求占用额度)耗尽 导致的 402 报错,并非软件 bug。OpenRouter 会根据你账户的 credits 余额设定并发在途请求上限;余额越少,可同时发起的请求越少,超出后就会返回 402,并要求 120 秒后再试。

你当前同时向 OpenRouter 发起了两类请求(翻译渠道 = OpenRouter、LLM纠错渠道 = OpenRouter),而且 AI翻译渠道每批字幕行数=40、LLM纠错每批字幕行数=50,单次请求 token 消耗很大,极易触发该限制。

解决方案(按优先级):

  1. 充值提升额度:访问 https://openrouter.ai/settings/credits 充值,余额提高后 in-flight 预算上限同步提高(有封顶值),这是根本解决办法。
  2. 降低并发与批量:菜单 → 工具/选项 → 高级选项 → 字幕翻译,将 AI翻译渠道每批字幕行数 由 40 调小(如 5~10);同时 高级选项 → 语音识别参数 → LLM纠错每批字幕行数 由 50 调小(如 10~20),减少单次请求体积。
  3. 减少同时打到 OpenRouter 的请求:将 LLM纠错所用AI渠道 换成 DeepSeek(或直接把主翻译渠道换成 DeepSeek),避免 OpenRouter 同时承载两条链路的并发。
  4. 临时重试:若不想马上改配置,等 120 秒(服务端 Retry-After)后重试,让在途请求结算完再发。
  5. 重跑注意:重试时勾选 清理已生成,避免使用上次未完成的中间字幕文件。

另需提醒:你的视频路径 X:/BaiduNetdiskDownload/A.Course/9、Conquering the tower of Polish 抛光动画/... 含中文与特殊符号且层级较深,建议后续将视频文件改为简短英文名并放到浅层目录,可规避一批 ffmpeg 相关报错。

请查阅相关文档:

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