We present AgentBudget, an open-source Python SDK that provides real-time, dollar-denominated cost enforcement for AI agent sessions. AI agents introduce fundamental cost unpredictability into software systems: unlike deterministic APIs, an agent decides at runtime how many inference calls to make, which models to use, and which external tools to invoke. A single misconfigured agent can consume hundreds of dollars in minutes without detection. AgentBudget addresses this gap with a per-session budget envelope that wraps LLM calls, tool invocations, and external API requests in a running cost ledger with automatic circuit breaking. The system supports drop-in integration via SDK monkey-patching, two-phase enforcement, loop detection, nested budgets for multi-agent systems, and structured cost reporting. We discuss the system's architecture and its relationship to the x402 autonomous payment protocol.
Sahil Jagtap (Sun,) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: