Skip to content

maxjustships/ohmycloudbill

Repository files navigation

ohmycloudbill

Never wake up to a $50,000 cloud bill again.

A tiny, dependency-light watchdog that polls your cloud providers' usage APIs, projects your month-end spend, watches free-tier caps — and stays silent until something is actually wrong. Built for indie hackers who are one viral post, one misconfigured loop, or one scraping bot away from billing disaster.

Why

  • Cloud billing data is delayed by hours. Native budget alerts fire after the damage.
  • Free tiers don't bill you — they just break when you hit the cap. Nobody warns you at 80%.
  • Your stack is spread across Vercel / Cloudflare / Netlify / AWS and nobody has a single pane of glass. Now you do, in 100 lines of config.

Watchdog contract

Designed for cron, systemd timers, or any scheduler that forwards stdout:

State stdout exit code
everything OK (empty — total silence) 0
alert fired human-readable alert block 0
hard failure (auth, API down) error message 1

No dashboard. No database. No daemon. No tokens burned. If you don't hear from it, your bill is fine.

Alerts

  • 🔴 Projected over budget — linear month-end projection exceeds your budget
  • 🔴 Budget exceeded — MTD spend already past the limit
  • 🟠 Free-tier cap at 80%+ — Workers requests/day, R2 storage/ops, etc.
  • ⚠️ Spike — last 24h usage > N× your trailing 7-day average (also per-zone traffic — catches scraping/attacks even when egress is free)

Quickstart

git clone https://github.com/maxjustships/ohmycloudbill
cd ohmycloudbill
pip install .
cp config.example.yaml config.yaml   # edit: your providers, your limits
export CLOUDFLARE_API_TOKEN=...       # read-only token, see below
ohmycloudbill --verbose               # dry run, shows full status

Then wire it into cron — it stays silent unless there's something to say:

0 * * * *  /usr/local/bin/ohmycloudbill || true   # mail/forward stdout on alerts

Providers

Provider Watches Token scopes (read-only)
Cloudflare Workers requests ($ or 100k/day free cap), R2 storage + Class A/B ops ($ or free caps), per-zone traffic anomaly Account Analytics:Read, Account Settings:Read, Zone:Read, Zone Analytics:Read
Vercel planned
Netlify planned
AWS planned

Set plan: free and ohmycloudbill watches free-tier limits instead of dollars — because on a free plan the real risk isn't a bill, it's your site going down at 100k requests/day.

Adding a provider

One file + one registry entry:

  1. Create ohmycloudbill/adapters/<name>.py implementing fetch_report(cfg) -> ProviderReport (see adapters/base.py for the contract, adapters/cloudflare.py for a full example).
  2. Register it in ohmycloudbill/check.py → ADAPTERS.
  3. Add pricing constants in ohmycloudbill/pricing/<name>.py if the plan is paid.

PRs welcome — the adapter contract is deliberately stupid-simple.

Config

Everything is tuned in config.yaml:

limits:
  monthly_budget_usd: 25   # your "oh shit" number
  spike_factor: 3          # 24h vs 7d average
  min_spike_absolute: 500  # anti-noise floor
  cap_warn_pct: 80         # free-tier warning threshold

Design principles

  • Silent by default. Alert fatigue is how watchdogs get muted and bills get missed.
  • Read-only. Every provider token needs nothing but read scopes. It cannot touch your infra.
  • No cloud required. A 5-line cron entry on any box. Your watchdog shouldn't itself be a SaaS subscription.

License

MIT

About

Silent watchdog against surprise cloud bills and free-tier caps (Cloudflare now, Vercel/Netlify/AWS next)

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages