#6290 This request requires more credits, or fewer max_tokens. You requested up to 16384 tokens, but can only afford 3664. To

2405:4800* Posted at: 4 hours ago

This request requires more credits, or fewer max_tokens. You requested up to 16384 tokens, but can only afford 3664. To increase, visit https://openrouter.ai/settings/credits and add more credits
Traceback (most recent call last):
File "videotrans\task\only_one.py", line 83, in run
File "videotrans\task\_stage_translate.py", line 31, in trans
File "videotrans\translator\_runner.py", line 63, in run
File "videotrans\translator\_base.py", line 74, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 77, in _item_task
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 requires more credits, or fewer max_tokens. You requested up to 16384 tokens, but can only afford 3664. To increase, visit https://openrouter.ai/settings/credits and add more credits', 'code': 402, 'metadata': {'limit_source': 'openrouter_credits', 'remedy_hint': 'Add credits at https://openrouter.ai/settings/credits, or lower max_tokens / prompt size to fit your remaining balance.', 'provider_name': None, 'previous_errors': [{'code': 402, 'message': 'This request requires more credits, or fewer max_tokens. You requested up to 16384 tokens, but can only afford 3664. To increase, visit https://openrouter.ai/settings/credits and add more credits'}, {'code': 402, 'message': 'This request requires more credits, or fewer max_tokens. You requested up to 16384 tokens, but can only afford 3664. To increase, visit https://openrouter.ai/settings/credits and add more credits'}, {'code': 402, 'message': 'This request requires more credits, or fewer max_tokens. You requested up to 16384 tokens, but can only afford 3664. To increase, visit https://openrouter.ai/settings/credits and add more credits'}]}}, 'user_id': 'user_3HDE3gd4ubM44a0xR3MpEOeRVXg'}

cfg=[TaskCfgVTT]当前工作模式: 翻译视频或音频 单视频模式
原始输入文件名: D:/video/mi.1199[HD]_musicaldown.com_1785772913.mp4,
输出结果保存到文件夹: D:/video/_video_out/mi.1199[HD]_musicaldown.com_1785772913-mp4,
临时文件夹: D:/pyVideoTrans/win-pyvideotrans-v4.07/tmp/1940/e65adb16c6
已选 清理已存在
已启用CUDA加速
未选 降噪
语音识别:ElevenLabs.io, model_name: , 发音语言: 越南语, 断句方式:LLM重新断句
翻译渠道:OpenAI ChatGPT,原始语言:越南语,目标语言:简体中文, 已选 发送完整字幕
未选 配音角色,不进行配音
字幕: 嵌入硬字幕
已选 分离人声与背景声, 已选 重新嵌入背景声, 背景音量0.8, 背景声音时长 短于 视频时长时: 拉长(降速播放),存在分离后的纯净人声文件,存在分离后的背景声音文件
代理地址:


=
system:Windows-10-10.0.22631-SP0
version:v4.08
frozen:True
language:zh
root_dir:D:/pyVideoTrans/win-pyvideotrans-v4.07

1 Replies

这是 OpenRouter 账户余额不足导致的付款失败错误:你的请求最多需要 16384 个 token,但当前余额仅能支付 3664 个 token,因此 OpenRouter 拒绝了请求(HTTP 402)。

解决办法按顺序操作:

  1. 充值或降低额度

    • 直接打开报错信息中的充值页面:https://openrouter.ai/settings/credits ,为 OpenRouter 账户充值后重试。
    • 如果暂时不想充值,可以降低单次请求的 token 上限:在软件菜单 翻译设置 → OpenAI ChatGPT(OpenAI兼容) 面板中,将 max token 从当前值调小(例如 1024~2048),确保不超过剩余额度。
  2. 减少单次翻译的文本量

    • 打开 菜单 → 工具/选项 → 高级选项 → 字幕翻译调整,将 AI翻译渠道每批字幕行数 调小(例如设为 20~30),避免一次提交太多字幕导致 token 过大。
    • 如果开启了 AI翻译一次性翻译所有字幕行,请取消该选项,按批提交翻译。
  3. 更换翻译渠道(可选)

    • 若不想处理余额问题,可使用免费或更便宜的渠道:Google翻译Microsoft翻译(免费),或本地 M2M100,也能完成越南语→简体中文的翻译。

请查阅相关文档:

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.

Dondate via ko-fi.com

Dondate via PayPal

Related resource