Direct answer

Your AI agent ran up your API bill overnight. Here is the first hour, in order.

You woke up to a bill hundreds of dollars higher than it should be, maybe on your OpenAI API bill, maybe on another provider account, and your agent is the prime suspect. Do not start with blame or with the refund form. Start by making sure it cannot spend another dollar, then read the bill properly, then name the cause. This is bill shock triage, in the order that actually helps.

First five minutes: pause the agent, and if the spend pattern does not look like your agent at all, revoke or rotate the exposed key before you investigate anything else. A fresh key is cheap. Another night is not.

Updated October 24, 2026.

Minute 0 to 10: Stop the bleeding

1. Pause the agent everywhere it can run. Stop the live process or session, disable any scheduler, cron entry, queue worker, or auto-restart that could relaunch it, and check for a second copy running under a different name. Runaway spend that survives your first stop is almost always a second copy you forgot.

2. Revoke or rotate the exposed key first if the pattern is not your agent shape. If the usage shows models you never use, hours your agent never runs, or a volume your task could never explain, treat it as a possible leaked key, not a misbehaving agent. Revoke the key in the provider dashboard now and investigate after. If the pattern does match your agent, pausing the agent plus a temporary hard limit may be enough, but rotation is still the cleaner stop, as the FAQ below explains.

3. Set a temporary hard provider limit. Drop the account or project limit to a level that cannot hurt you while you triage. You can raise it later with a clear head. Right now its only job is to make a restart harmless.

4. Save the raw evidence before you touch anything else. Export or screenshot the usage views exactly as they are, with dates and times visible. Dashboards roll up and age out detail. Your future dispute, and your own diagnosis, both depend on the numbers as they looked this morning.

Minute 10 to 25: Read the bill properly

The headline total is the least useful number on the bill. Break it down three ways, in this order:

Usage by API key. Separate your agent key from every other key on the account: your own experiments, teammates, production services, old scripts. The overnight spike should belong overwhelmingly to one key. If it does not, you have a wider problem than one agent.

Usage by model. Check which models the spending key called. A spike concentrated on one expensive model tells a different story than a spike spread across everything you use.

Usage by hour. Plot or list the night hour by hour. You are looking for the start time, the shape, and the end. A sharp start followed by a flat plateau is a runaway. A series of bursts is retries or scheduled restarts. Normal work has pauses. Runaway work usually does not.

One hard truth belongs here: a shared key makes attribution impossible. If three agents and two scripts all used the same key, the usage log can tell you what the key spent and never which program spent it. Do not pretend otherwise to yourself or to the provider. Note the shared key as a fact, fix it in the never again section below, and base your cause finding on timing and on whatever per-call records exist.

Minute 25 to 45: Identify the cause pattern

Most overnight blowups are one of four patterns. Each one looks different in the usage graph, so match the shape before you match a story.

The loop. In the graph: a sudden start, then a steady, relentless rate for hours with no gaps. In the work itself: the same tool or call repeated with near-identical inputs and no progress. The agent was awake and busy all night and finished nothing.

The retry storm. In the graph: sharp bursts stacked on top of each other, often growing after each failure. In the work itself: one endpoint or tool failing, and the agent retrying immediately, sometimes with parallel retries, instead of backing off or stopping. Look for the first failure time. The storm starts there.

The context window resent on every call. In the graph: a moderate number of calls, each one unusually expensive, with input cost dominating. In the work itself: the agent attaching a huge history, a full document set, or an ever-growing transcript to every single request, so each call repays for all the context before it. Call count looks innocent. Cost per call gives it away.

The leaked key. In the graph: spend at hours your agent never runs, on models you never call, sometimes from a pattern that starts abruptly and ignores your task entirely. In the work itself: nothing, because it was not your agent doing the work. This is why step one told you to revoke first when the shape is foreign. Diagnosis later, key dead now.

Write your finding down as one sentence with times attached, for example: loop pattern, agent key, started 01:12, stopped 06:40, concentrated on one model. That sentence is the spine of everything you file and everything you fix.

Minute 45 to 60: Dispute and refund reality, stated honestly

Now, and only now, contact the provider. Here is the honest version. Providers sometimes credit obvious runaway spend when you report it fast and show evidence that the pattern was a malfunction rather than work you benefited from. Nothing is owed to you. Credit is discretionary, partial credit is common, and a slow or evidence-free report is easy to decline.

What strengthens your report is a per-call record of what the agent actually did. A usage graph proves money left. A call by call record proves what it left for: the task on each call, when it ran, and how the repetition built up. Zambo is the verifiable work layer for AI. Every Zambo tool call issues a verifiable receipt carrying the task, the timestamp, and a fingerprint of the saved result, and on Zambo receipts issue for rejected calls too, so even the failing stretch of a retry storm is on the record. A receipt proves the saved result was not changed since it was saved. It never proves an answer was right. Attached to a dispute, a set of receipts is the strongest evidence packet most builders can offer, because it replaces your summary of the night with the night itself, call by call. Check any receipt free at zambo.dev/verify before you send it, so you know exactly what the reviewer will see.

File the report the same day, attach the usage exports grouped by key, by model, and by hour, attach any receipts or logs you have, state the start and stop times, and state plainly what you have changed so it cannot recur. Then stop refreshing the ticket. You have done the part that matters.

Never again: the setup that makes the next anomaly visible in minutes

Separate key per agent. One agent, one key, never shared with scripts, teammates, or production. Attribution becomes a lookup instead of an argument.

Hard provider limit per key or project. Set the ceiling at a number that would annoy you, not ruin your month, and make sure hitting it stops calls rather than only sending an email.

Per-call receipts for the work itself. Run agent work through the Zambo MCP endpoint at https://zambo.dev/mcp (153 tools) so every call, rejected calls included, leaves a receipt you can walk the next morning or the next minute.

An alert before the cap. Set a usage alert well below the hard limit, routed somewhere you will actually see it at night. The alert buys you a manual stop. The cap is the backstop when you sleep through the alert. You need both.

A max-iteration and progress rule in the task. The agent stops after a set number of steps or repeats, and it must show new progress to continue. Most runaways die on this rule before money becomes the lesson.

Honest limits

No setup makes an overnight blowup impossible, and this page does not promise a refund, a provider timeline, or a credit outcome. Receipts cover calls made through Zambo; calls made directly to a provider leave only that provider usage log, which is why the by key and by hour reading above matters. A receipt proves the saved result was not changed, not that the underlying answer was right and not that the spend was justified. And if your key was shared, some of last night may stay unattributable no matter how carefully you read the bill. Say so, fix the sharing, and move on.

Run the next night on the record

Work run through Zambo at https://zambo.dev/mcp returns a verifiable receipt for every call, so the next anomaly is visible in minutes at https://zambo.dev/verify/ instead of on next month bill. Start on the free tier: 20 free calls per day, then they upgrade. The Day Pass is $0.99 for 24 hours. The Zambo Pass is $29 for 30 days, one payment.

Questions, answered

Should I rotate the key even if it was my own agent?

Yes, in most cases. Rotating the key stops every copy of the agent at once, including schedulers and retries you forgot about, and it closes the question of whether the key also leaked. Issue a fresh key per agent when you restart, update the one place that agent reads its key from, and delete the old key instead of leaving it active just in case. The small hassle of rotation is the cheapest certainty you will buy today.

How fast do providers answer a bill shock report?

It varies, and no honest page can promise a timeline. Reports filed the same day, with a clear time window and evidence attached, are easier to review than reports filed weeks later from memory. Expect an automated acknowledgement first and a human review later. Keep your agent stopped or capped while you wait, keep the usage exports you saved, and answer any follow-up with the same facts and figures you filed at the start.

What evidence do I attach to a dispute or credit request?

Attach the packet that lets a stranger reconstruct the night: the usage export grouped by API key, by model, and by hour, the exact start and stop times, what the agent was tasked to do, the cause pattern you found, and any per-call records you have. Receipts from calls that ran through Zambo are especially useful because each one carries the task, the timestamp, and a fingerprint of the saved result, so the reviewer can see what the agent actually did instead of only what it cost.

How do I cap one agent without capping my whole account?

Give that agent its own API key, and where your provider supports it, its own project with its own limit. The cap then binds the agent, not your other tools, your team, or your production traffic. Pair that with a budget for the work the agent runs through Zambo, so both rails have their own ceiling. The rule is simple: one agent, one key, one cap. Shared keys make shared accidents.

Will the provider refund runaway agent spend?

Sometimes, and never as a right. Providers sometimes credit obvious runaway spend when you report it fast and show evidence that the pattern was a malfunction rather than work you wanted. Nothing is owed to you, approval is at the provider discretion, and partial credit is a common outcome. File quickly, file factually, and do not spend the expected refund in your head before it arrives.

Related