AI agent cost: what one task and one customer cost to run

Why an AI agent's cost grows faster than its step count, what caching and reasoning change, and a $99 customer who runs 3x the tasks and loses money.

Brandon Holt
December 1, 2026
9
min read
Summarize
AI agent cost: what one task and one customer cost to run

AI agent cost is the sum of every model call the agent makes, and a 10-step task makes 10 calls that each re-send a longer prompt. In this post's example, one support task with prompt caching costs $0.27 on Claude Opus 5.5 and $0.07 on GPT-6.1 Terra. A $99 customer running 600 of those tasks a month loses you $61.

Prices checked on December 1, 2026, from OpenAI's pricing page and Anthropic's pricing page.

This post covers what an agent costs to run: tokens, caching, reasoning and tool fees, per task and per customer. Build costs and salaries sit outside it. For every lever on the bill, from model choice to batching, see our guide to cutting LLM costs.

How AI agent cost adds up across steps

An agent works in a loop. The model reads the task and picks a tool, your code runs the tool, and the result goes back to the model along with everything that came before. Each pass through the loop is a separate API call, billed on its own.

Every call re-sends the whole context, which has four parts:

  • System prompt. The agent's instructions, identical on every call.
  • Tool definitions. Names, descriptions and schemas for each tool. Anthropic counts the tools parameter as input tokens and adds a tool-use system prompt of 286 tokens on Claude Opus 5.5.
  • History. The customer's message plus every earlier model output and tool call.
  • Tool results. Order lookups, help articles and search results. Each one stays in the history for the rest of the task.

The first two parts stay the same size from call to call. The last two grow on every step, so the prompt at step 10 carries everything from steps 1 to 9.

Prompt at step k  = fixed prefix + first message + (k − 1) × tokens added per step
Input for n steps = n × (fixed prefix + first message) + tokens added per step × n(n − 1) ÷ 2

The second term grows with the square of the step count. In the example below, step 10's prompt is 4.4 times the size of step 1's, and stretching the same task from 10 steps to 20 multiplies its input tokens by 3.4.

How prompt caching and reasoning tokens change agent cost

Agents suit prompt caching well, because each step's prompt starts with the previous step's entire prompt. You pay a premium to write tokens to the cache once, then a small fraction of the input price each time a later step reads them.

  • Anthropic. A 5-minute cache write costs 1.25 times base input and a 1-hour write costs 2 times. Cache hits on Claude Opus 5.5 and Sonnet 5.5 cost 0.05 times base input, which is $0.20 and $0.10 per million tokens.
  • OpenAI. From GPT-5.6 on, OpenAI's prompt caching guide prices cache writes at 1.25 times input for the default 30-minute lifetime and 2.5 times for 12 hours. The minimum cacheable prompt is 1,024 tokens, and a hit needs the entire prefix to match, tool definitions included.

Keep tool definitions, their order and the system prompt fixed across requests. If your code reorders tools or edits the system prompt per customer, every step pays for a fresh write. Claude prompt caching shows where to put cache breakpoints.

Reasoning tokens are the other hidden line. OpenAI's reasoning guide says they stay out of the API response, get billed as output, and can run from a few hundred to tens of thousands per request. If a call hits its max_output_tokens limit mid-reasoning, you pay for the input and reasoning with no visible answer.

On Claude, Anthropic's thinking documentation says Claude 4.6 and later models keep earlier turns' thinking blocks in context and bill them as input. You pay for an agent's reasoning on Opus 5.5 twice: as output on the step that produced it, and as input on every step after.

What a 10-step support agent task costs on two models

Example. A support agent resolves a refund request in 10 steps: it reads the ticket, looks up the customer, checks the order, reads the refund policy, and so on until it replies. The prompt has a 5,000-token fixed prefix (a 2,000-token system prompt and 3,000 tokens of tool definitions) plus a 500-token first message.

Each step outputs 600 tokens, 400 of them reasoning, and gets back a 1,500-token tool result, so the history grows by 2,100 tokens a step. Step 1 sends 5,500 tokens and step 10 sends 24,400. The whole task uses 149,500 input tokens and 6,000 output tokens.

With caching on, each step reads the previous step's prompt from the cache and writes only its 2,100 new tokens. Across the task, that's 24,400 tokens written and 125,100 read. The table prices the task on Claude Opus 5.5 and on GPT-6.1 Terra, whose per-token prices are a quarter of Opus 5.5's on every line.

ModelCachingInput costOutput costCost per taskPer 1,000 tasks
Claude Opus 5.5Off$0.5980$0.1200$0.7180$718.00
Claude Opus 5.5On$0.1470$0.1200$0.2670$267.02
GPT-6.1 TerraOff$0.1495$0.0300$0.1795$179.50
GPT-6.1 TerraOn$0.0368$0.0300$0.0668$66.76

Example data. Claude Opus 5.5: $4 input, $5 five-minute cache write, $0.20 cache hit and $20 output per million tokens. GPT-6.1 Terra: $1 input, $1.25 30-minute cache write, $0.05 cached input and $5 output per million tokens.

Caching cuts the task cost by 62.8% on both models. On cached Opus 5.5, output makes up 44.9% of what's left, so reasoning effort and reply length become the next lever. A busy product does a little better than the table, since it keeps the 5,000-token prefix warm across tasks and reads it instead of writing it.

GPT-6.1 Terra runs the same task for a quarter of the price. That saving holds only if it resolves your tickets as well as Opus 5.5 does, so test it on a sample of real tickets before you switch.

How much an AI agent costs per customer

Per-task cost becomes per-customer cost as soon as you sell the agent on a flat plan. Example. A support product charges $99 a month. A typical customer has the agent resolve 200 tickets a month, and a heavy customer runs 600, three times as many.

SetupTypical: 200 tasksMarginHeavy: 600 tasksMargin
Opus 5.5, no caching$143.60−$44.60$430.80−$331.80
Opus 5.5, caching$53.40$45.60$160.21−$61.21
GPT-6.1 Terra, no caching$35.90$63.10$107.70−$8.70
GPT-6.1 Terra, caching$13.35$85.65$40.05$58.95

Example data. Margin is the $99 plan price minus agent cost for the month. Payment fees and hosting are left out.

Uncached Opus 5.5 loses money on the typical customer. With caching, the typical customer leaves you $45.60, or 46.1% of the price, and the heavy one costs you $160.21. On cached Opus 5.5, any customer who runs more than 370 tasks a month costs more than they pay.

−$61.21
a month on a $99 customer who runs 600 tasks on Claude Opus 5.5 with caching on

On a flat plan, the price stays at $99 while the heavy customer's agent bill triples. You have two fixes: an included task allowance with a per-task overage, or routing heavy users to a cheaper model you've tested. Cached GPT-6.1 Terra keeps even the heavy customer at $58.95 of margin.

How tool fees and runaway runs push agent cost up

Some tools carry a fee on top of tokens. Web search costs $10 per 1,000 searches on both the Claude API and OpenAI's API, plus the result tokens at model rates, and Anthropic counts those results as input again in later turns. Two searches per task add $0.02, which is 30% on top of a cached GPT-6.1 Terra task before you count the result tokens. OpenAI's file search tool costs $2.50 per 1,000 calls.

Long runs also cost more per step. Example. A flaky order-lookup tool keeps failing, and the agent retries until the same refund task runs 60 steps. Its final prompt reaches 129,400 tokens, total input hits 4,047,000 tokens, and the task costs $2.15 on cached Opus 5.5. That's 8.1 times the 10-step cost for 6 times the steps, and $16.91 without caching.

Some models change price with prompt length too. Claude Haiku 5.5 charges $0.50 per million input tokens instead of $0.10 once a prompt passes 100,000 tokens, and Anthropic prices each request on its own, so steps 47 through 60 of that run would all pay the higher rate. An attacker can trigger the same pattern on purpose, which denial of wallet covers.

Lancelot prices every agent call against the customer who triggered it and what that customer pays, and flags runaway loops: more than 50 calls in 10 minutes from one customer, on the same feature and model, with prompt sizes within 10%. It can then throttle that customer, pause their AI, move them to a cheaper model you've approved or hold them to the plan's normal daily spend, within limits you set, with each fix starting as a suggestion and Undo on all of them, while the SDK's emergency stop halts any customer at 600 calls a minute or $50 in 5 minutes for a 5-minute cooldown (Runtime protection).

Questions about AI agent cost

How much does an AI agent cost to run?

It depends on steps per task, tokens per step and the model. In this post's example, a 10-step support task costs $0.27 on Claude Opus 5.5 with caching and $0.07 on GPT-6.1 Terra. Without caching, the same task costs $0.72 and $0.18.

Why does an AI agent cost more than a chatbot reply?

A chatbot reply is one model call. An agent makes one call per step, and each call re-sends the system prompt, tool definitions, history and every tool result so far. Input tokens grow with the square of the step count, so 20 steps use about 3.4 times the input tokens of 10.

How much does AI customer support cost per ticket?

In the example here, an agent that resolves a ticket in 10 steps costs between $0.07 and $0.72 per ticket, depending on the model and caching. A $99 customer with 200 tickets a month costs $13.35 to $143.60, so model choice decides whether the plan makes money.

Does prompt caching work for AI agents?

Yes, and agents benefit more than most workloads, because each step's prompt starts with the previous step's whole prompt. In the example, caching cut a 10-step task's cost by 62.8%. Keep tool definitions and the system prompt identical across calls so the prefix matches.

Are reasoning tokens billed in an AI agent?

Yes. OpenAI bills reasoning tokens as output even though they stay hidden, and a request can use tens of thousands of them. Claude 4.6 and later models keep earlier thinking blocks in context and bill them as input, so an agent pays for its reasoning again on later steps.

How do I stop one customer from running up my AI agent bill?

Measure agent cost per customer against what each customer pays, then act on the outliers. Throttle them, cap their daily spend, move them to a cheaper model, or charge per task above an allowance. Add a per-customer circuit breaker so a stuck loop can't run all night.

Per-task math shows which step, model or customer to fix first. For caching, model routing, batching and the rest of the playbook, read our guide to cutting LLM costs.

Keep reading

All dispatches →
AI agent cost: what one task and one customer cost to run
Running AI in production
/
9
min read

AI agent cost: what one task and one customer cost to run

AI wrapper economics: price, model mix and your heaviest 5%
AI unit economics
/
8
min read

AI wrapper economics: price, model mix and your heaviest 5%

Usage-based billing for AI: what to meter and how Stripe bills it
Pricing AI products
/
9
min read

Usage-based billing for AI: what to meter and how Stripe bills it

What is a token in AI? Words per token, context and cost
Running AI in production
/
9
min read

What is a token in AI? Words per token, context and cost

Get the numbers when they change.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
New dispatches and model price changes. Unsubscribe anytime.