Learn how to set spending caps on your AI agent's budgets to control costs and prevent overspending.

Setting Spending Caps

Spending caps let you control exactly how much your AI agent can spend. They're the primary guardrail for keeping costs predictable.


What is a Spending Cap#

A spending cap is a maximum credit limit on a budget. Once the cap is reached, your agent can no longer make tool calls using that budget until you increase the cap or reset it.

Spending caps protect you from runaway costs. Even if your agent enters a loop or makes more calls than expected, it can never exceed the cap.


Setting a Cap#

Open your budget

Go to the AI Budgets tab on your dashboard and select the budget you want to configure.

Find spending controls

Look for the Spending Cap section in your budget settings.

Set the limit

Enter the maximum number of credits this budget can spend. For example, 1,000 credits = $10.00.

Save

Click Save to apply the cap. It takes effect immediately.


Cap Strategies#

Conservative -- Set low caps (100-500 credits). Good for testing new tools. Increase as you gain confidence. Best for getting started.

Production -- Set higher caps based on expected usage. Monitor spending in Agent Activity. Adjust based on actual patterns. Best for established workflows.


Multiple Budgets for Different Tasks#

A powerful pattern is creating separate budgets for different types of work:

BudgetToolsCapPurpose
ResearchWeb search, summarizer500 creditsDaily research tasks
ContentImage generation, writing tools2,000 creditsContent creation projects
TestingVarious100 creditsTrying out new tools

This gives you granular control over spending by category.


What Happens When the Cap is Reached#

When a budget hits its spending cap:

  1. Your agent receives an error indicating the budget is exhausted
  2. No further tool calls can be made with that budget
  3. Your existing results and data are unaffected
  4. You can increase the cap at any time to resume

On-Chain Spending Controls#

If you're using an x402 wallet, spending controls are enforced at the smart contract level:

  • Per-transaction limits -- Maximum USDC per single tool call
  • Time-based limits -- Maximum spend per time period
  • Contract-level caps -- Hard limits enforced on-chain, not just in the app
Defense in depth

For maximum protection, use both app-level spending caps on your budgets and on-chain limits on your wallet. This provides two independent layers of cost control.


Monitoring Spend vs. Cap#

Your budget settings show:

  • Current spend -- How much has been used so far
  • Remaining -- How much is left before the cap
  • Cap utilization -- Percentage of cap used

You can also view this information in the Agent Activity tab alongside your tool call history.


Next Steps#