ExecutionConfig(max_budget=...) — when the limit is hit, PraisonAI stops the run and raises BudgetExceededError.
Async enforcement.
max_budget is now enforced on async paths (astart() / achat()) as well as sync paths. Gateway bots using async agents will receive BudgetExceededError when their configured ceiling is reached. Previously only sync dispatch enforced the limit.BudgetExceededError once estimated cost exceeds the limit.
Quick Start
Set a simple USD cap
BudgetExceededError including agent name and totals.Async run with budget cap
astart() raises BudgetExceededError the same way start() does — the async path now has identical pre-call guards and post-call cost accounting.max_budget is enforced on both sync (start()) and async (astart()) paths as of 1.6.88+. Gateway bots that call astart() internally now honour the budget cap and raise BudgetExceededError identically to sync runs.How It Works
Budget tracking adds zero overhead whenmax_budget is None (the default).
Configuration Options
| Option | Type | Default | Description |
|---|---|---|---|
max_budget | float | None | None | Hard USD limit per agent run. None disables tracking. |
on_budget_exceeded | "stop" | "warn" | callable | "stop" | Action when the cap is reached |
ExecutionConfig
Full execution configuration reference
CLI Budget Handling
Budget limits from the CLI
Best Practices
Start with a conservative cap in production
Start with a conservative cap in production
Set
max_budget on any agent that runs unattended or loops over tools. 1.00 is a sensible starting range for research agents.Use warn mode during development
Use warn mode during development
on_budget_exceeded="warn" lets you see full output while still logging when you’d have been stopped in production.Combine with rate limiting
Combine with rate limiting
Budget caps control spend; rate limiters control request frequency. Use both for cost-sensitive deployments.
Related
CLI Budget Handling
Set budgets from the command line
Execution Config
All execution options in one place

