OpenRouter "requires more credits, or fewer max_tokens" explained
OpenRouter prices a request's whole possible output before it runs, so an agent stops with money showing. What is stranded per model, and the two fixes.
OpenRouter checks a request against the most it could cost, not what it will cost. Before a model runs, the whole output the request allows is priced against what is left on the key, and if the balance is short, the request is refused with “This request requires more credits, or fewer max_tokens.” An agent asks for a large output allowance on every turn (we have seen 128,000 tokens), so it stops with money still showing: about 6 cents on GPT-6 Luna, $1.28 on GPT-6 Sol, $2.56 on Claude Opus 5.5. Add credit or raise the key’s limit, or lower the output ceiling your agent asks for.
What you see
OpenRouter’s own message states the arithmetic, with your numbers in place of these:
This request requires more credits, or fewer max_tokens. You requested
up to <ceiling> tokens, but can only afford <what is left>. To increase,
visit https://openrouter.ai/settings/keys and create a key with a higher
monthly limitAn agent usually passes on a shorter version. OpenClaw, for instance, answers in the chat with a line like “openrouter (openai/gpt-5.6-luna) returned a billing error — your API key has run out of credits or has an insufficient balance,” while the key’s page still shows a balance. Both are true. The balance is what is left; the error is about what one request could spend. It arrives as HTTP 402, OpenRouter’s insufficient-credit refusal, and other agent tools meet the same message. Every message after it fails the same way until the balance, the key’s limit or the ceiling changes.
How much is unspendable on your model
The amount stranded on the key is the output ceiling times the model’s output price. At a 128,000-token ceiling, on the list prices of September 23, 2026 (arithmetic, not a measured bill):
- GPT-6 Luna ($0.50 per million output tokens): refused once less than about $0.06 is left
- DeepSeek V4.1 Flash ($0.60 per million output tokens): refused once less than about $0.08 is left
- GPT-5.6 Luna ($1.20 per million output tokens): refused once less than about $0.15 is left
- GPT-6 Sol and Claude Sonnet 5 ($10 per million output tokens): refused once less than $1.28 is left
- Claude Opus 5.5 ($20 per million output tokens): refused once less than $2.56 is left
- GPT-6 Astra ($50 per million output tokens): refused once less than $6.40 is left
The GPT-5.6 Luna entry is the one we met: an agent on that model stopped with $0.14 left, just under its $0.15 line. The ceiling in your own error message is the one to use, since some agents ask for a model’s full maximum output and some models allow more than 128,000; prices are on each model’s OpenRouter page. On a cheap model the stranded amount is pocket change. On a premium model with a small key, it can be a quarter of a $10 top-up.
Two budgets can run short
The message tells you to create a key with a higher limit because a key can carry its own spending limit, separate from the account’s credit. A key with a monthly or total limit is refused once that limit’s remainder falls under the ceiling, even while the account holds plenty. So check both on OpenRouter: the account’s credits, and the limit and usage on the key your agent uses. Raising whichever one is short, or adding credit, gets the agent answering again on its next message, with nothing lost from the conversation.
Asking for less on every turn
The other way through is a lower ceiling. Replies are usually short, but on a reasoning model the thinking counts against the same ceiling and is billed as output, so a hard turn at high effort can run to many thousands of tokens. A ceiling in the tens of thousands leaves room for that and still cuts the stranded amount several times over: 32,000 strands a quarter of what 128,000 does. Too low a ceiling cuts a long reply or long reasoning short, so size it to the longest thing you ask the agent to do. In OpenClaw, the agent model settings take a per-model maxTokens under params:
agents: {
defaults: {
models: {
"openrouter/openai/gpt-6-luna": { params: { maxTokens: 32000 } }
}
}
}That is the documented setting, not one we have run against this error. The error message is your check: it quotes the ceiling each request asked for, so if it still says 128000 after the change, the setting did not reach the request.
Why it happens overnight
A key rarely runs down while you are watching. OpenClaw’s heartbeat wakes the agent every thirty minutes by default, each wake a full turn on the agent’s model, and one of our agents on a mid-priced model spent $0.61 overnight with nobody talking to it. On a small key, the first you hear of it is the morning message that fails. If the agent has stopped and you are not sure this is the reason, the not-responding checklist starts with the model error, which is where this one shows.