DEV Community

Cover image for I kept getting surprised by my AI API bills, so I built a tracker in one night
primeclearco-glitch
primeclearco-glitch

Posted on Edited on

I kept getting surprised by my AI API bills, so I built a tracker in one night

I use OpenAI and Claude in a few side projects. Every month I'd open the billing pages and think "wait, how did it get that high?" Each provider has its own dashboard, its own billing cycle and its own way of reporting costs, and none of them tells you when something starts running away.

So I built AI Spend Tracker: https://aispendtracker.online

What it does

  • Connects to OpenAI, Anthropic, Google Gemini, xAI (Grok), OpenRouter and DeepSeek using each provider's billing/admin key. Keys are encrypted before storage and only used to read cost reports.
  • Puts your daily spend from all of them into one dashboard.
  • Lets you set a monthly budget and get pinged by email, Slack or Discord when you cross 50%, 75%, 100% or a point you choose.
  • Sends an hourly burn-rate alert if spend jumps faster than your limit. Someone on X said "a ping when one agent loop burns $50 in an hour is what would get me to sign up," so I built it the same day.

How it works under the hood

  • Starlette + Postgres, hosted on Render.
  • Each provider reports costs differently, so every fetcher normalizes into the same {date: usd} shape before anything is saved. OpenAI and Anthropic have usage and cost APIs. Gemini goes through the Google Cloud billing export in BigQuery. xAI and OpenRouter use management keys. DeepSeek only exposes a balance, so spend is the drop in that balance between checks.
  • An hourly job pulls fresh numbers and checks budgets and burn rate.

Try it

There's a free plan and a live demo on the homepage, no signup needed. Pro has a 3-day trial.

I'd love honest feedback: what's missing that would make you actually use this?

Top comments (0)