How to avoid surprise cloud and AI bills
Usage-based pricing is cheap until something goes wrong: a traffic spike, a leaked key, a loop. Here's a checklist that catches most of it, in about an hour.
Why bills surprise you
A typical small product today runs on several services that charge by use: hosting (Vercel), a database (Neon or Supabase), AI APIs (OpenAI, Anthropic) and CI (GitHub Actions). Each has its own dashboard and billing cycle, and most send the bill at month end. A problem that starts on day 3 shows up as money on day 30.
Public stories range from a few hundred dollars to six figures: a $104,500 bandwidth bill after a traffic attack on a free site, an $82,314 AI bill from an old public key, $607 in a week from an AI coding agent. The fixes below are boring, and they work.
1. Set hard limits where they exist
- OpenAI: set project and organization spend limits (docs).
- Anthropic: set workspace spend limits in the Console.
- Vercel: on Pro, turn on spend management alerts and, if you can tolerate downtime, auto-pause at a set amount (docs).
- Supabase: keep the spend cap on unless you need overages.
- GitHub: set a budget for Actions so overage stops at a number you choose.
Limits stop the worst case. They don't tell you that spend doubled on Tuesday; that's step 3.
2. Treat API keys like money
- Never put a secret key in front-end code or a public repository.
- Use one project or workspace per app, so a leak or a bug is contained and visible.
- Give each environment its own key, and rotate keys when people leave.
- Be careful which tools you hand admin keys to. Every service that stores them is another place they can leak from.
3. Watch daily, not monthly
Most damage happens in the first day or two of a problem. A daily check against your normal level catches it while it's cheap. A simple rule works well: flag any day above 2.5× the median of the previous 14 days, per vendor and per AI model. That's the rule Burnstack uses, and it notifies you even with the app closed.
4. Clean up what's idle
- Database branches: preview and feature branches in Neon keep costing storage after the PR merges. Delete branches with no compute in two weeks.
- Paused projects: a paused Supabase project on a paid plan can still cost the plan fee.
- Preview deployments: check whether previews take a large share of bandwidth.
- Old experiments: AI projects and keys from a weekend hack.
5. Keep CI honest
GitHub Actions minutes on macOS runners have historically counted ten times against your free allowance. One macOS matrix job on every push can use the month's free minutes in days. How to stay inside your free minutes.
6. A 2-minute weekly check
- Is the projected end-of-month total higher than you expected?
- Are there new alerts?
- Which product grew most since last week?