Back to articles
My AI bot burned through my API budget overnight. So I built an open-source tool to make sure it never happens again.
How-ToDevOps

My AI bot burned through my API budget overnight. So I built an open-source tool to make sure it never happens again.

via Dev.toAlbert Alov

I run an autonomous AI news engine called El Sapo Cripto. It monitors 25+ RSS feeds, scores articles, generates Spanish-language summaries with Gemini, creates images, and publishes to Telegram and X. All day, every day, zero human intervention. One morning I woke up to a ~$4 bill from Google. Not a lot, right? But my usual daily spend was under $0.25. Something was very wrong. What happened My app runs on Railway. Railway occasionally restarts containers. My budget tracker lived in memory. Restart = budget reset = the bot thought it had a fresh $0 balance and went wild. Gemini Flash calls piled up - summarizing, re-summarizing, processing articles it had already processed. I caught it by accident, scrolling through the billing page. There was no alert. No dashboard. No way to see what happened without manually reading through logs. And here's the thing that really bothered me: the app was returning 200 OK on every request. Prometheus would've shown zero errors. Traditional monitoring

Continue reading on Dev.to

Opens in a new tab

Read Full Article
5 views

Related Articles