IT-RAT the stack/tokenfuse Live demo Stack Guides Console
money plane · wave 1

TokenFuse. The breaker between your agents and your invoice.

TokenFuse is a drop-in gateway that gives every run a budget, watches its burn in real time, and cuts the circuit with an HTTP 402 the moment a run crosses its budget. Adoption is one base-URL change; no agent framework rewrite, no SDK lock-in.

releasepinned tags · ghcr images (no :latest)
coreRust
ledgerin-process by default · raft cluster build optional
enforcementHTTP 402, in-line
proven onHetzner · AWS · GCP
licenceApache-2.0
sixty seconds, one runaway

Watch the breaker do its job.

A replay of the exact shape of the live validation runs: an agent enters a retry loop against a $0.006 budget.

under the hood

One gateway in the path. One ledger everyone trusts.

Your agent's SDK points at TokenFuse instead of the provider. In the hot path: budgets, loop detection, a model router that downgrades routine calls, a semantic cache, DLP and the Wardryx policy hook.

agent SDK base_url = tokenfuse tokenfuse-gateway :4100 budgets · breaker loop detection model router semantic cache DLP · firewall Wardryx PEP every decision emitted as an agent-event provider Anthropic · OpenAI · local spend ledger n1 n2 n3 no cross-node double-spend Cloud + dashboard incidents · savings · evidence your console · browser
what it holds

Not a dashboard. A set of hands on the wheel.

one call, through the gatewayrun budgets
TokenFuse sits between the run tree and the provider: it prices each call before it is sent, rolls sub-run spend into every ancestor's budget, trips a breaker on loops, takes taint from what the MCP broker saw, opens one Cloud incident per failing provider and exports the call trace for finance.the run treeparent runsub-runsub-runfits every ancestortokenfuse gatewayreserve, then settlepriced before it is senta loop trips the breakertaint from what it sawledger in memoryrouter, cache: offproviderkeeps failingMCP brokerlabels by theserver that answeredCloudone incidentper providerfan-out:an incidentfleet: noshared capfocus-exportone row per callagent and run columnsfinance's dashboardsshowback and chargebackleft openone gateway by defaultits raft build: own tag

The run is the unit that pays: a sub-agent's run rolls up into its parent, so its spend must fit inside every ancestor's budget. In the guide

in the stack

The loud neighbor everyone listens to.

TokenFuse asks Wardryx before letting a declared tool through, and stamps the verdict on the response. Everything travels as one envelope, the agent-event, and Genaryx lifts that same signed kill into a console you reach over your own tunnel, where it becomes a passkey break-glass ceremony.

try it now

Run it from the repository, where the one-line command lives beside the image tag it pulls.

Then point ANTHROPIC_BASE_URL at localhost:4100 and give your next run a run id and a budget (the x-fuse-run-id and x-fuse-budget-usd headers). A call with no run id is refused with 400 metering_required. That's the whole migration.

Full install and configuration in the guide →
the two planes either side of this one

It stops the spend. Two neighbours stop other things.

A breaker answers a runaway. A stolen delegation is Vouchryx's, and next month's invoice is CostCrew's.

a runawayretries against its budgetTokenFusestops the spend, in the pathVouchryxends the authority everywhereCostCrewallocates and closes the billa stolen delegationthe invoice, a month on
go deeper

The TokenFuse guide

common questions

How teams put a ceiling on agent spend

How do I cap what an AI agent can spend?

Give the run a budget. Every call is priced before it happens, the reserve is taken against that budget, and the call that would cross the cap is refused with an HTTP 402 before the provider ever sees it. Budgets nest along the run tree, so a sub-agent's run also has to fit inside every ancestor run's budget. A business unit can also have a monthly cap, which the gateway enforces in enforce mode.

What happens to my agent when it hits the budget?

It gets a 402 with the reason, which is a status every framework already understands, and an incident is recorded against that run. Nothing else in the fleet is affected, and the spend that would have followed simply never happens.

Do I have to rewrite my agent to use it?

No. It is a one-line base-URL change to a gateway that speaks the Anthropic Messages API and the OpenAI chat completions API. Set TOKENFUSE_MODE=shadow first and it prices and records everything while refusing nothing, so you can see what would have been blocked before anything is. Its own bookkeeping fails open, so a lost event or a failed telemetry push never refuses a call; the one exception is the start, when a gateway with a Cloud configured answers 503 seed_pending until it has read its money state. What happens when the policy plane is unreachable is the deployment's choice, and all three launchers ship it closed.

Can it catch a retry loop before the bill does?

That is the case it was built for. A sustained loop trips the breaker, and a fan-out explosion opens an incident in the Cloud; either looks the same as a compromised agent from the budget's side. In the live campaign, the runaway that mattered was caught and killed on the day, not on the invoice.

Does it still work with several gateways behind a load balancer?

In the cluster build, yes: the spend ledger is raft-replicated and the affordability check is linearized across the fleet, so four nodes on four machines admit exactly what one budget allows. The cluster record tests that with 30 concurrent reserves against a 5-unit budget, a kill of the leader and a real network partition. That build is optional and ships as its own image tag, not what the default image runs; the default profile is one gateway whose ledger lives in memory and is read back from the Cloud when it starts, each run's spend over the last 31 days, so a restart does not hand a run its budget again. That read-back does not let two gateways share one budget; only the cluster build does.