GuidesRunning & maintaining

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.

September 23, 2026Updated October 13, 2026The Everpod team
The short answer

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, such as 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 limit
Copied

An 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 October 2, 2026 (arithmetic, not a measured bill):

The arithmetic matches what happens: an agent on GPT-5.6 Luna can be refused 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 } }
    }
  }
}
Copied

That is the documented setting. The error message is your check that it took effect: 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 an idle agent on GPT-5.6 Luna, the previous generation’s efficient tier, can spend $0.61 in about twelve hours 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.

Give your AI agents a permanent cloud computer.

We set it up and secure it, so all you do is use them. Run Claude Code, Codex or any agent you use, more at once than your laptop can hold, and keep them working when it’s closed. Or have OpenClaw set up and run for you.

See the developer pod

From $24/mo · your own plan or API key

Get your OpenClaw agent

$29/mo, cancel anytime · model usage included