Surprise LLM bill

Why is my LLM or AI agent bill so high?

Most surprise LLM bills come from tokens you didn't know you were sending: agent loops that resend the whole conversation on every call, retries, hidden reasoning tokens billed as output, and a prompt cache that stopped matching. To find the cause, find the day the bill jumped, split it by key, model and token type, then open the most expensive runs and count their calls.

Last updated . Part of the AI agent cost control guides.

The usual reasons an LLM bill is higher than expected

A bill rarely jumps because the price per token changed. It jumps because more tokens were sent or produced than anyone thought. These are the causes we see most often, roughly in order of how often they explain a surprise.

1. The agent resends the whole conversation on every call

Model APIs don't remember earlier calls. An agent that works in steps sends its instructions, its tool definitions and everything that has happened so far with every new call, and pays for all of it as input each time. Anthropic says this plainly about its own coding agent: Claude Code "sends your full conversation with every request", and each round of tool use sends another request with the tool results added (Claude Code cost docs, checked 1 Dec 2026).

That is why input cost grows much faster than the number of steps. These numbers are made up to show the arithmetic:

A ten-step agent task

Illustrative
Instructions and tool definitions
2,000 tokens
New content added after each step
1,000 tokens
Input on step 1
2,000 tokens
Input on step 10
11,000 tokens
Input tokens billed across all ten calls
65,000

The longest prompt in the task was 11,000 tokens, but the bill counts 65,000 input tokens, because each call paid again for everything before it. Run the same agent for twenty steps and the input comes to 230,000 tokens: twice the steps, more than three times the input.

2. Retries and loops

A call that times out and is sent again is paid twice. An agent that can't get what it wants from a tool and keeps calling it is paid every time, and because of the point above, each repeat carries a longer context than the last. Retries are often added by the SDK or the framework, so the agent code doesn't show them.

3. Reasoning and thinking tokens you don't see

Reasoning models think before they answer, and you pay for the thinking. OpenAI reports these as usage.output_tokens_details.reasoning_tokens and they are not returned in the reply (OpenAI reasoning guide). Anthropic says thinking tokens are billed as output tokens and that the default budget "can be tens of thousands of tokens per request depending on the model" (Claude Code cost docs). Output is the more expensive token type, so switching a busy step to a reasoning model, or turning the reasoning setting up, can move the bill a lot while the answers look no longer than before.

4. The prompt cache stopped working

Caching makes repeated input much cheaper. On Anthropic, a cache read costs 0.1 times the base input price on most models, and a five-minute cache write costs 1.25 times it (Anthropic pricing, checked 1 Dec 2026). OpenAI turns caching on by default for supported models, but "cache reuse requires the entire rendered prefix to match" (OpenAI prompt caching, checked 1 Dec 2026).

So one small change at the top of a prompt, like the current time in the system message or tools listed in a different order, can turn cheap cached input back into full-price input on every call. Nothing breaks and nothing errors. The bill just goes up.

5. Tools and MCP servers on every call

Tool definitions are sent with the request and counted as input tokens (Anthropic pricing, tool use section). Every tool or MCP server you attach to an agent adds its names, descriptions and schemas to each call, whether the agent uses it or not. Large tool results, such as a whole web page or a long log, then sit in the context for every later step.

6. An expensive model on a high-volume step

One config change can send a step that runs thousands of times a day to a larger model. Check spend by model before and after the jump.

7. Paid tools and keys used by something else

Web search, embeddings and other paid tools are billed on top of tokens. And a key shared between an agent, a test script and a teammate's experiment shows up as one line on the bill. Give each agent its own key or project so you can tell them apart.

How to find the cause of a high LLM bill, step by step

  1. Find the day it jumped. Open your provider's cost report in daily buckets and find the first day spend rose. Then ask what shipped that day: a prompt change, a new tool, a model switch, a new customer flow.
  2. Split by key, project and model. OpenAI's Costs endpoint can group spend by project, API key and line item. Anthropic's cost report can group by model, workspace and API key. That usually narrows the jump to one agent or one model.
  3. Split by token type. Compare input, output and cached input before and after the jump. The table below says what each pattern usually means.
  4. Open the most expensive runs. The provider report stops at keys and models. In your own traces, sort runs by cost and look at how many calls each run made, how large the input was on the last call compared with the first, and whether the same tool call repeats.
  5. Fix it, then cap it. Fix the cause you found, then set a budget on the agent and a limit on steps and retries per task, so the next surprise stops at the cap.

What each pattern in your bill usually means

What you seeLikely cause
Input tokens up, number of calls about the sameContext is growing: longer conversations, bigger tool results, more documents retrieved, or a new tool or MCP server attached to every call.
Input tokens up, cached share downThe prompt cache stopped matching. Something near the start of the prompt changes on every call, such as a timestamp, a user ID or tools in a different order.
Output tokens up, replies look the same lengthHidden reasoning or thinking tokens. A model switch or a higher reasoning setting can do this without any visible change in the answers.
Number of calls up, traffic the sameRetries, loops or more steps per task. Look for the same tool called again and again within one run.
Everything up on one key or project onlyOne agent changed, or one key is being used by something you didn't expect, such as a test script or a job left running.
Spend moved to a different modelA config change sent a high-volume step to a more expensive model.

How to keep the bill from surprising you again

  • Know what a normal task costs. Once you track cost per task and cost per outcome, a jump shows up as one task type getting more expensive, not as a bigger number at the end of the month.
  • Estimate before you ship. The AI agent cost calculator shows how steps, tokens and retries turn into a monthly bill, so you can see the effect of a change before it reaches production.
  • Put a budget on every agent. A limit that blocks calls at the cap ends a runaway loop the same day. The AI agent cost control guide covers budgets and the other controls.
  • Keep the start of every prompt stable. Put anything that changes per call, such as dates, user details or retrieved text, after the fixed instructions and tools, so the cache keeps matching.
  • Use batch for work that can wait. Anthropic gives a 50 percent discount on input and output tokens for batch requests (Anthropic pricing). Overnight jobs and evaluations rarely need an answer in seconds.

Where Alpha fits

Alpha traces every agent run with its tokens, model and cost, links retried calls together even when the framework doesn't mark them, and can pause an agent when it reaches its budget. Calls go through your own provider accounts with no markup. If you want to see where one of your agents' spend goes, book a 30-minute teardown.

FAQ

Common questions

Why is my OpenAI bill so high?

Check three things first. Input tokens: an agent that sends the whole conversation on every call pays for it again each time. Output tokens: reasoning models produce reasoning tokens you never see in the reply, and those are billed as output. Cached tokens: if the cached share of input dropped, something at the start of your prompt changed and the cache stopped matching.

Why is my Claude API bill higher than expected?

The same causes apply: full conversations resent each turn, tool results added to context, and thinking tokens, which Anthropic bills as output tokens. Anthropic's cost report can be grouped by model, workspace and API key, which usually narrows it down to one agent or one model quickly.

Why do AI agents cost more than a chatbot?

An agent makes many model calls to finish one task, and each call usually carries the instructions, the tool definitions and everything that happened so far. So the input grows with every step, and a ten-step task can cost far more than ten times a single call.

How do I find which agent is causing my LLM bill?

Give each agent its own API key or project so the provider's cost report splits by agent. For anything finer, such as which task or which step, tag every call with an agent and task ID in your own tracing and add up the cost per tag.

How do I stop an AI agent from running up a huge bill?

Put a budget on each agent at the layer its calls pass through, and block calls when it is reached. Also cap steps and retries per task in the agent itself, so a loop ends after a set number of attempts instead of running until someone notices.

Want to find out where your agent bill went?

In 30 minutes we'll go through one of your agents on real runs and show which calls the money went to.