# How to give an AI agent a budget

_By Apoorv Khanna, July 6, 2026_

Give an AI agent its own credential, set how much it may spend during a defined period, and limit what it can buy. Then add a maximum price to individual calls. Those decisions belong in the setup, before you leave the agent running.

Vaaya supports daily, weekly and monthly spending ceilings on developer API keys. The owner sets that policy. The agent supplies a separate per-call ceiling when it requests paid work. Both matter: a hundred cheap searches can fit a low per-call ceiling and still exceed the budget you intended for the task.

## Give each agent a separate developer key

Start with one key per agent or workflow. A research agent and a media agent should not have to share a budget just because they belong to the same account. Separate keys also make their spending easier to attribute and let you revoke one without replacing the other's credential.

Restrict each key to the tool categories it needs. A research workflow might need Search and Data. It does not necessarily need Media, Compute or Outbound. A key without category restrictions can use all categories, so make this choice deliberately.

Check how the agent connects. These per-key policies apply to developer API keys. An assistant connected through OAuth does not inherit a developer key's ceiling simply because both connections belong to your account. If you need an independent budget, follow the supported client instructions for using your own key in the [installation guide](/install).

## Choose a calendar budget that matches the work

A daily ceiling suits a recurring job you want to review each morning. A weekly ceiling can suit a research cycle. A monthly ceiling gives a continuing assistant more room to vary its work across days.

For example, you might configure a research key like this. These are planning values, not a measured recommendation:

| Setting | Example policy |
| --- | --- |
| Key name | research-agent |
| Allowed categories | Search and Data |
| Spending ceiling | $5 per day |
| When to reconsider it | After reviewing the first day's useful results and charges |

The periods are calendar windows. Days reset at midnight UTC, weeks on Monday, and months on the first. A daily limit is not a rolling 24-hour allowance; spending just before and after midnight belongs to two different periods.

For a fixed-price paid call, Vaaya checks the key's recorded spending in the current period plus the proposed charge against its ceiling. If that would exceed the ceiling, the call is refused with `api_key_limit_exceeded`.

Set a positive ceiling. An unset ceiling means no per-key budget. To stop a key, use pause or revoke instead of entering zero as a budget. The [spending controls reference](/spending-controls) describes the available policies.

## Add a maximum price to individual tool calls

The key's period budget answers how much the owner has allocated. `max_cost_cents` states how much the caller accepts for a particular request.

Vaaya's MCP `use` tool requires this field. For a fixed-price action, a quoted price above the supplied ceiling produces an `over_max` refusal before the provider call. The field uses cents: `2` means two cents, not two dollars.

Keep the distinction between the person setting the budget and the agent making the call. If the agent chooses its own per-call ceiling, it can also choose a larger one on a later request. That field is useful protection against an unexpectedly expensive request; the owner-set key policy supplies the separate period boundary.

A refusal should make the agent stop, reduce the requested work or ask for a budget decision. Do not tell it to keep raising its ceiling until a call succeeds. For the HTTP API, include a valid `max_cost_cents` explicitly when you want this protection; the generic request path does not require it on every action.

## What a recorded refusal actually proves

Two public captures from September 17, 2026 UTC show the per-call check on a fixed-price search. With `max_cost_cents: 2`, the [successful search response](/blog/assets/agent-credit-card/live-search.json) reported a one-cent charge and a transaction ID.

The same search parameters with `max_cost_cents: 0` produced this [refusal](/blog/assets/agent-credit-card/live-refusal.json):

```json
{
  "error": "over_max",
  "message": "price is 1¢ but max_cost_cents was 0",
  "price_cents": 1
}
```

That response reported zero charged cents. These are historical captures of two requests. They demonstrate the quoted-price check, not today's search price, a daily-budget test or a guarantee about every billing path.

## Handle metered work separately

Some work has a known price before it starts. Some accumulates a charge while it runs.

Token-metered inference is billed from reported usage. Vaaya checks a developer key's available budget before routed inference and can restrict output tokens when little budget remains. Still set a sensible output-token limit and inspect the final charge. A pre-call check is not a measurement of tokens that have yet to be generated.

A running compute session is another case. Its initial hold is not a lifetime spending cap: uptime continues to accrue charges. Close the session when the task finishes. Revoking a credential does not substitute for closing work that is already running.

These controls cover Vaaya-routed work. They do not cap a ChatGPT subscription, an API key the agent holds directly with another provider, or other spending outside Vaaya. List those paths before calling an agent's budget complete.

## Review spending and decide when to stop

After the first run, check which key made the calls, what was charged and which results were useful. Preserve returned refusal details in the workflow's logs too; an early rejection may not have a transaction ID.

Use [the guide to monitoring agent spending](/blog/monitor-ai-agent-spending-real-time) to plan that review. If you also need notifications, treat them as a separate requirement: [spending alerts and hard limits](/blog/api-spending-alerts-vs-hard-limits) serve different purposes.

Start with a budget you are comfortable reviewing after one run. Increase it when the results justify the extra work. When the workflow behaves unexpectedly, pause the key and inspect the calls before giving it more room.

## Questions

**How do I give an AI agent a budget?**

For an agent using a Vaaya developer API key, create a separate key, set a daily, weekly or monthly spending ceiling, and restrict its tool categories. Add a maximum cost to individual paid tool calls. These controls cover work routed through Vaaya, not the agent's separate provider accounts.

**Can I set a daily budget for an AI agent on Vaaya?**

Yes. Developer API keys support daily, weekly and monthly ceilings. The periods are calendar windows: days reset at midnight UTC, weeks on Monday, and months on the first. An OAuth-connected assistant does not automatically receive a developer key's spending policy.

**What is the difference between a key budget and max_cost_cents?**

The owner sets the key's spending ceiling for a period. The caller supplies max_cost_cents for an individual tool request. A low per-call ceiling cannot stop a long sequence of affordable calls by itself; the period budget addresses their accumulated cost. Metered services also need their own usage controls.

**Does Vaaya cap every expense my AI agent incurs?**

No. Vaaya's controls apply to requests routed through Vaaya and depend on the authentication and billing path. Separate model subscriptions and direct provider calls are outside that scope. Token-metered inference and running compute sessions need usage limits and review in addition to a quoted-price check.
