So your SaaS is finally getting some traction. Congrats. Then you check your OpenAI bill and realize one power user just cost you $500 overnight running reports. Now what?
This isn't a rare problem. If you're building any multi-tenant AI app, your biggest financial risk is a single user with a runaway script or an unpredictable use case. Standard API rate limits are too crude—they punish all users and can kill legitimate usage. Manually watching your dashboard doesn't scale past your first few customers.
You need a way to track costs per user and enforce budgets automatically.
Most people start by trying to build this logic in-house. You can add a user_id to your API calls and log the token counts to your own database. Then you run a cron job to aggregate costs and check against a budget column in your users table.
It works, until it doesn't.
- Provider differences: The way you calculate costs for OpenAI is different from Anthropic, and different again for OpenRouter. Your logic gets complex fast.
- Timing issues: Cron jobs aren't real-time. By the time your job runs, a user could have already gone 2x over their budget.
- Maintenance: It's another piece of infrastructure you have to build, test, and maintain. That's time you're not spending on your core product.
Tbh, I got tired of rebuilding this for every project.
So I built a simple, open-source tool to handle it: LLMeter.
It's a dashboard that sits on top of your existing LLM providers (OpenAI, Anthropic, etc.). You tell it which user made which API call, and it handles the rest.
- Tracks costs per-user, in real-time.
- Lets you set a budget for each user.
- Sends you a webhook or email when a user hits 50%, 90%, or 100% of their budget.
You can then use that webhook to programmatically disable that user's access, switch them to a slower model, or just notify them. No more surprise bills.
It's not a proxy, so it doesn't add latency. It's just a simple, open-source dashboard you can self-host or use the managed version. Fwiw, it solved my own problem. Maybe it'll solve yours too.
Top comments (0)