ospalabs
Guide · Claude Code

Put a spending limit on Claude Code API usage

Updated November 2026

Claude Code has no dollar ceiling on a single session. A hung loop keeps calling the model until something outside the session stops it. In a July 2026 report, a re-authentication created a Console workspace named Claude Code and an API key, moved the session off a Team subscription onto pay-per-use, and an eight-hour hang billed $104.25. The prepaid balance went negative. Anthropic's own commercial channel told that reporter there is no circuit breaker for a looping session: organization and user spend caps, plus threshold alerts, are the controls that exist.

Fuse cannot sit in front of the Claude Code binary. The CLI speaks Anthropic's Messages API. Fuse accepts OpenAI chat completions and the Responses API, then forwards Claude model names over Anthropic's OpenAI-compatible chat endpoint. Pointing ANTHROPIC_BASE_URL at Fuse will fail. The limit that works is a split: Claude Code gets its own Anthropic workspace cap, and every app you do control goes through Fuse so the CLI cannot spend that budget.

  1. 01

    See which account is paying

    In the Anthropic Console, look for a workspace you did not create, especially one named Claude Code, and a key created at the same time as a re-login. Usage on that workspace is API credit, separate from a Claude subscription seat. /status in Claude Code and the Console usage page should name the same billing source. If they don't, the session is not on the plan you think it is.

  2. 02

    Set the workspace spend cap

    On the workspace Claude Code is billing, set the spend cap and the threshold alert Anthropic offers for that organization. Confirm the labels in your own console; they move. Treat the cap as the outer wall for the CLI. It bounds the month. It does not interrupt one looping session before the cap is reached.

  3. 03

    Give Claude Code its own key

    Create a key that only that workspace uses, and do not paste it into production apps. A CLI loop then spends only what that workspace cap allows. Revoke it from the Console if a session runs away; a new key is cheaper than sharing the production key.

  4. 04

    Put app traffic behind Fuse

    Store a different Anthropic key on a Fuse project and point your own tools at Fuse. Those requests are priced before they are sent, and the one that would cross the ceiling gets 402. Claude Code never sees that key, so a hung CLI session cannot draw it down.

    .env
    FUSE_BASE_URL=https://fuse.ospalabs.com/v1
    FUSE_API_KEY=fz_your_fuse_key

Questions

Can I set ANTHROPIC_BASE_URL to Fuse?
No. Claude Code calls /v1/messages. Fuse does not implement that API. Use Anthropic's workspace spend cap for the CLI, and Fuse for OpenAI-compatible clients.
Does a subscription include API usage?
No. A Claude subscription and Console API credit are different bills. A session that silently switches to an API key is billed per token even if the seat is paid up.