Skip to content

Set a spending limit before you leave anything running

An agent in a loop is an expensive agent, and you find out from the invoice. Every provider has a monthly cap. Set it before the first scheduled job.

By Nick

1 min read

AutomationAI Agents Intermediate
On this page
Time
Five minutes, once per provider
Cost
Saves money
Level
Intermediate

Before you start

1. Why this is first, not later

An agent that gets stuck retries. A retry that calls a model costs tokens. A loop that runs all night at a few cents a call is a real number by morning, and the only thing that stops it is a cap you set in advance. Everyone who runs agents has one of these stories. The ones with a cap tell it as a funny story.

2. Set two numbers

The cap. The point at which the provider refuses further calls. Twice a normal month, rounded down to something you would shrug at.

The alert. An email at half the cap. That is your warning that something is looping, days before the cap would have saved you.

Do it per provider. Every API account you hold, including the one your agent uses for images or voice.

3. Ask the agent to check itself

If you run an agent, make it part of the setup.

Before we schedule anything: list every model or API provider this setup can call, and
for each one tell me whether a monthly spending limit and an alert are set. Do not guess;
if you cannot see the billing settings, say so and tell me where I set them myself.
Example reply (trimmed). Your app will word it differently.

Asking my agent to check its provider limits, using the prompt above

  1. OpenAI (text): cap set at $40, alert set at $20.
  2. Anthropic (summaries): cap set at $30, alert not set.
  3. ElevenLabs (voice): unknown. I can’t see its billing settings, so set the limit yourself on its billing page.

Any line that says unknown is the one to fix before the first scheduled job.

The cheap model for routine work is the other half of keeping the number small.

Common questions

What number should I set?

Twice what you expect a normal month to cost, rounded to something you would not mind losing. You can raise it later. The point is that a runaway loop stops at a number you chose.

Does this apply to subscriptions?

Subscriptions are their own cap: you cannot spend more than the plan. This is for API accounts, where the bill tracks usage and nothing stops it unless you say so.

Will the cap break my agent mid-job?

Yes, at the limit, which is the point. Set an alert at half the cap too, so you hear about it before anything stops.

What to do next

Related reading

Last reviewed 9 October 2026 by Nick.

Software changes fast. If something here is out of date, tell me and I'll fix it.

Get new guides by email

Occasional and practical. No spam, no hype, unsubscribe whenever.

Occasional practical guides from UncomplicateAI. You will get a confirmation email before anything else is sent. Unsubscribe any time. Privacy

You are not subscribed until you confirm the email. Unsubscribe any time.