AgentBudget — I got a $32 surprise bill from a runaway AI agent, so I built a real-time kill switch
A few weeks ago I left an AI agent running, walked away for 20 minutes, and came back to a bill I didn't expect. I searched for a tool that could just stop the agent when it hit a dollar limit. Nothing existed.
So I built AgentBudget. It monkey-patches the OpenAI and Anthropic SDKs, tracks running cost per API call, and throws a BudgetExceeded exception the moment the agent crosses its limit. Under 2ms overhead. One import, one line.
from agentbudget import BudgetManager
budget = BudgetManager(max_cost="$5.00")
That's it. Works with OpenAI, Anthropic, Gemini, Mistral, Cohere, LangChain, and CrewAI.
Would love feedback from people building agents in production — especially around what the cloud dashboard should look like.
sahiljagtapyc•1h ago
A few weeks ago I left an AI agent running, walked away for 20 minutes, and came back to a bill I didn't expect. I searched for a tool that could just stop the agent when it hit a dollar limit. Nothing existed. So I built AgentBudget. It monkey-patches the OpenAI and Anthropic SDKs, tracks running cost per API call, and throws a BudgetExceeded exception the moment the agent crosses its limit. Under 2ms overhead. One import, one line. from agentbudget import BudgetManager budget = BudgetManager(max_cost="$5.00") That's it. Works with OpenAI, Anthropic, Gemini, Mistral, Cohere, LangChain, and CrewAI. Would love feedback from people building agents in production — especially around what the cloud dashboard should look like.
GitHub: github.com/sahiljagtap08/agentbudget