Free & open source · for the OpenAI / Anthropic APIs

Stop your AI bill from exploding while you sleep.

A hard budget cap and per-feature cost attribution in one npm install. A runaway retry loop can't drain your account — Budget Guard trips the breaker before it does. No proxy, no signup, MIT.

npm i budget-guard View on GitHub →
MIT · no runtime deps · TypeScript · on npm
budget-guard · live
project: agent-worker
Spend todaycap $50.00 / day
$0.00
CAP
summarize()$0.00
embed-docs()$0.00
agent-loop() ⚠ retry storm$0.00
monitoring…
The problem — in developers' own words

You can see the bill. You can't explain it. And nothing stops it.

"I set up an agent with the API and when I woke up I saw a $40 bill from a $5 task."

— indie dev, Product Hunt forum

"One bug puts you in a retry loop that silently drains $30 in 8 minutes."

— founder, Indie Hackers

"We could see our AI bill, but not explain it. Which workflow caused the spike? Real usage or retry noise?"

— eng lead, Indie Hackers

Real public posts collected while researching this problem — the pain is everywhere.

How it works

Wrap your client. Set a cap. Sleep.

// install
npm i budget-guard

// wrap your existing client
import { guard } from 'budget-guard'

const ai = guard(openai.chat.completions, {
  project: 'agent-worker',
  dailyCapUSD: 50,        // hard stop
})

// use it exactly like before.
await ai.create(
  { model: 'gpt-4o', messages },
  { feature: 'summarize' },   // tagged for attribution
)
// runaway loops get blocked, not billed.
01

Drop-in, not a proxy

Your requests still go straight to OpenAI/Anthropic. We never sit in your critical path — just count, tag, and cap.

02

Hard cap that actually stops

Hit the daily limit and the next call throws before it bills. Retry storms die at the breaker.

03

Know what costs what

Tag by project & feature. spendReport() tells you "agent-loop cost $212 today" — no more mystery invoices.

Free today · hosted soon

The SDK is free forever. A hosted layer is coming.

Open source
$0
  • Hard daily caps (block or warn)
  • Per-project & per-feature attribution
  • OpenAI + Anthropic (auto usage detection)
  • spendReport() for cost breakdowns
  • MIT · no runtime deps · TypeScript
Get it on GitHub →
COMING SOON
Hosted
waitlist
  • Cross-project spend dashboard
  • Shared caps across instances (Redis-backed)
  • Slack / webhook alerts at thresholds
  • Per-customer (tenant) cost breakdown
  • Spend history & export
On the list — we'll email when hosted is ready. Thanks!

Building the hosted layer only if enough of you want it — the waitlist is the vote.