Spending limit for Claude Code

Last updated 24 November 2026

Claude Code on an API key bills per request, and a long session or a stuck loop can cost far more than anyone expected. Anthropic’s own limits apply to the whole organisation or workspace. With Xpenvo, each developer gets their own hard limit, checked before each request is sent, and you can see and stop any of them from one dashboard.

1. Make a budget and a key

Create a free account, make a budget (for example $20 a day) and an agent key for it under Agent keys. The key starts with xpv_ and is shown once. You keep your own provider key and keep paying your provider directly; Xpenvo never stores it.

2. Point Claude Code at Xpenvo

In ~/.claude/settings.json (your own settings, not the project’s, so the key is never committed), add:

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://agents.xpenvo.com",
    "ANTHROPIC_CUSTOM_HEADERS": "X-Xpenvo-Key: xpv_your_agent_key",
    "ANTHROPIC_API_KEY": "sk-ant-your_anthropic_key",
    "XPENVO_KEY": "xpv_your_agent_key"
  }
}

Use an Anthropic API key, not a Claude subscription sign-in: a subscription is not billed per request, so there is nothing to limit. Restart Claude Code and it works as before.

3. Show what is left

Claude Code can show what is left at the bottom of the screen. Add this to ~/.claude/settings.json next to the env block (and add XPENVO_KEY to that block):

"statusLine": {
  "type": "command",
  "command": "curl -s -H \"X-Xpenvo-Key: $XPENVO_KEY\" \"https://agents.xpenvo.com/v1/xpenvo/status?format=line\""
}

It shows, for example, Xpenvo: $14.20 left of $20.00 today. The check is free and changes nothing. On Windows PowerShell, use $env:XPENVO_KEY in the command instead.

What happens at the limit

The request is stopped before it reaches Anthropic, so it is never billed, and Claude Code shows the reason, for example that today’s budget is used up. If the same request repeats again and again, Xpenvo pauses the key and tells you. You can raise the limit, pause a developer or stop everything with the kill switch from the dashboard.

Questions

Can I set a daily spending limit on Claude Code?

Yes. Point Claude Code at Xpenvo Agents with ANTHROPIC_BASE_URL and an X-Xpenvo-Key header, and give each developer a key on a daily or monthly budget. Each request is checked before it is sent and refused when it would go over.

Does this work with a Claude Pro or Max subscription?

No. A subscription is not billed per request, so there is no spending to limit. It works when Claude Code uses an Anthropic API key.

Does Xpenvo see my code?

Requests pass through Xpenvo to Anthropic so they can be priced, but prompts, code and answers are never stored, and your Anthropic key is never saved.

More: full setup guide · model prices · tested guarantees · security. Questions? [email protected]