AI agents can keep calling APIs until a task finishes. If something loops or goes wrong, the bill can grow very fast. There is usually no built in way to stop it. AgentBudget is an open source Python SDK that watches every LLM API call in real time and stops the agent the moment it reaches a set spending limit. You add one import, set a budget, and the agent cannot spend more than that.
Hey PH! Sahil here - solo founder and CS student at George Mason.
I built AgentBudget after leaving an AI agent running for 20 minutes and coming back to a bill that made my stomach drop. I tried to find a tool that could enforce a hard spending limit in real time. Nothing existed, so I built one.
AgentBudget is an open source Python SDK that stops an AI agent the moment it hits a budget you set.
Just one line:
agentbudget.init("$0.10")
Would love to hear how you're currently handling agent costs or runaway loops. Feedback from builders here helps a lot.
If you want to try it:
pip install agentbudget
Airstitch