Short answer
Use three layers. 1. Set a hard spend limit at your AI provider: it is the one limit nothing on your machine can get around. 2. Give each agent its own hourly, daily and monthly dollar budget so one runaway agent cannot use up the whole allowance. 3. Have whatever runs your agents stop starting new tasks the moment a budget or usage limit is hit, and resume on its own when it resets. Prompter Hawk does layers 2 and 3 for OpenAI and Gemini agents, and layer 3 for Claude Code agents on a subscription.
Why agent spend runs away
Agents do not spend more per token than you do by hand. They spend more because nothing stops them:
- Parallel agents multiply the rate. Five agents on the same allowance use it five times faster. A budget that lasts a day for one agent can be gone before lunch.
- Retries repeat the expensive part. A task that fails late and is retried from scratch pays for the whole context again.
- Background check-ins add up quietly. In our own setup, agents pinging every 30 minutes used 68% of a working session's token budget before anyone noticed. The full write-up is here.
- You find out late. With an API key the overspend shows up on next month's invoice. On a subscription it shows up as an agent dying halfway through a task.
So the fix is not to watch harder. It is to make the limit act on its own.
Two kinds of limit: dollars vs. usage windows
How you cap spend depends on how you pay for the model:
| API key (pay per token) | Subscription (e.g. Claude Pro / Max) | |
|---|---|---|
| What runs out | Money | A rolling usage window (Claude's is 5 hours, plus a weekly allowance) |
| What overspend looks like | A bigger invoice | Agents stop mid-task with a "usage limit" message |
| The cap you want | A dollar budget per agent, per hour / day / month | A clean pause when the window fills, and an automatic restart when it resets |
Most people running several Claude Code agents are on the right-hand column. Most people running OpenAI or Gemini agents through an API key are on the left. If you mix providers, you need both.
Layer 1: a hard limit at the provider
Start with the limit your provider enforces on its own servers. API providers let you set a spending limit or budget for your account or project in their billing settings; set it to the most you are willing to lose in a bad month. This is your backstop: it holds even if every tool on your machine misbehaves.
It is also blunt. It is one number for everything, it usually acts per month, and when it trips every agent stops at once. That is why you want the next two layers underneath it.
Layer 2: a dollar budget per agent
Give each agent its own allowance so a single runaway agent hits its own ceiling long before it reaches the account limit. In Prompter Hawk, every OpenAI or Gemini agent can carry an hourly, daily and monthly budget in US dollars, set in the mission's configuration:
"backend": {
"provider": "openai",
"model": "gpt-4.1",
"budget_limits": {
"hourly_budget_usd": 2.00,
"daily_budget_usd": 20.00,
"monthly_budget_usd": 200.00
}
}Prompter Hawk records the cost of every call from the token counts and model pricing, and checks all three windows after each call. If no budget is set, defaults apply: $5 an hour, $50 a day, $500 a month.
Honest limits. The check runs after each call, so a single large call can land slightly past the line before the agent is stopped; set the budget a little under your true maximum. Budgets are set in the mission configuration, not on a settings screen. Dollar budgets apply to OpenAI and Gemini agents using API keys; Claude Code agents on a subscription are covered by layer 3 instead.
Layer 3: pause automatically, resume automatically
A cap that just throws an error leaves you with half-finished work and failed tasks to clean up. What you want instead is for the limit to stop new work cleanly. When a budget is exhausted or a provider usage limit is hit, Prompter Hawk:
- Stops handing new tasks to agents on that provider, and only that provider. If a ChatGPT limit is hit, your Claude and Gemini agents keep working.
- Lets running tasks finish instead of killing them.
- Does not mark anything failed. The task that hit the limit goes back to the queue as pending, without using up a retry.
- Shows a pause banner in the dashboard saying whether it was a usage limit or a budget limit.
- Resumes on its own: at the next hour for an hourly budget, at midnight for a daily one, on the first of the month for a monthly one, or when the provider's usage window reopens (with a one-minute safety margin, because providers often reopen a little late).
For Claude Code agents on a subscription this is the cap that matters: the window fills, the Claude agents wait instead of failing, and the queue picks back up when the window resets. More on that in running many Claude Code agents on one subscription.
Watch the burn rate
Caps stop the damage; a burn-rate view tells you a cap is coming. Prompter Hawk's Analytics tab charts token burn rate with color coding and shows a 24-hour token usage graph across all your projects, so a sudden spike from one agent is visible while it is happening rather than on the invoice.
Checklist
- Set a monthly spend limit in each provider's billing settings.
- Give every API-key agent an hourly, daily and monthly dollar budget, a little under what you can actually afford.
- Make sure a limit hit pauses new work instead of failing tasks, and that it resumes by itself.
- Keep the pause per provider, so one provider's limit does not freeze your other agents.
- Check for background check-ins and retry loops that spend tokens while no real work is happening.
- Keep a burn-rate view open while many agents are running.
FAQ
Can I set a dollar budget for Claude Code agents?
On a Claude subscription (Pro, Max, Team) there is no per-call dollar bill to cap: you pay a flat fee and Anthropic enforces a rolling usage window. The useful control is what happens when that window fills, which is layer 3 above. Prompter Hawk's dollar budgets apply to OpenAI and Gemini agents that use API keys.
What happens to running tasks when a budget runs out?
They finish. Only new tasks are held back, and only for agents on the provider that hit its limit.
Does running more agents in parallel cost more?
It spends the same tokens faster, and every extra agent adds its own retries and check-ins. That is why caps should be per agent and automatic.
Is Prompter Hawk affiliated with Anthropic, OpenAI or Google?
No. Prompter Hawk is an independent desktop app that runs agents from those providers on your own machine, with your own keys or subscriptions.
Run many agents with the caps built in
Prompter Hawk is a desktop app for running several Claude, OpenAI and Gemini coding agents at once on one codebase, with per-agent budgets, automatic pause and resume on limits, and a live burn-rate view. Free tier available, no credit card.