Use case

An agent can spend a quarter's budget over a weekend.

Agentic systems turn one user action into a chain of model calls, tool calls and retries. Cost per run is the only number that makes them manageable, and almost nobody has it.

How do you control the cost of AI agents?

By measuring them per run rather than per month. Camaze reports cost per run, calls per run against the design target, and the share of run cost going to retries, for every agentic workflow. Ceilings can be set on calls and cost per run, runs that never terminate are surfaced explicitly, and per-workload anomaly detection flags a loop within a day rather than at month end. That turns an agent from a line item that grew into a system with unit economics.

The problem

Agents fail expensively and quietly.

A traditional API call has a predictable cost. An agent does not.

More detail

One user action becomes a chain: plan, call a tool, evaluate, retry, call another tool, retry again, summarize. The relationship between what the user asked for and what it cost is no longer visible anywhere.

Worse, the failure modes do not look like failures. A retry that succeeds on the fourth attempt is a success in every log you have. A loop with no terminal state produces no errors and no user complaints. Neither triggers anything until the invoice arrives.

  • Retries that eventually succeed and therefore never register as errors
  • Loops with no terminal state, running until something external stops them
  • A frontier model used for every step in a chain where most steps are routing
  • Context accumulating across a long run until each call carries the whole history
  • Cost per run unknown, so a regression is invisible until it is a budget problem
Agent and workflow economics Last 30 days
WorkflowRuns Calls per runCost per run Spent on retries
Ticket resolution agent 18,400 3.2 $0.41 34%
Contract review workflow 2,100 11.8 $2.90 71%
Lead enrichment agent 44,900 1.4 $0.06 12%
Code review agent 6,300 6.1 $0.88 48%
Weekly report generator 310 22.4 $4.15 9%

Illustrative product view. Figures are examples.

What we do about it

Give every agent unit economics.

An agent with a known cost per run and a target to hold it against is a managed system. An agent measured only by monthly total is a liability with a growth rate.

  • Cost per run and calls per run, tracked against a target you set
  • Retry share of run cost, isolated and trended
  • Runs that never terminate, surfaced explicitly rather than averaged away
  • Step-level model attribution, so routing steps billed at frontier rates are visible
  • Cost regression on deploy, so a change that doubles unit cost shows immediately
Per run

The number that makes an agent manageable.

Cost per run converts an agent from an unbounded cost into a unit economics question.

More detail

It can be compared against what the run is worth: a resolved ticket, a reviewed contract, an enriched lead.

It also makes drift measurable. A workflow averaging 11.8 calls per run against a design target of 4 is a defect. Without cost per run it presents as a general increase in AI spend, and gets debated rather than fixed.

  • Cost per run, calls per run and tokens per run, by workflow
  • Target cost per run, tracked like any other service objective
  • Distribution as well as average, so the expensive tail is visible
  • Cost per unit of business output where the workflow supports it
Agent and workflow economics Last 30 days
WorkflowRuns Calls per runCost per run Spent on retries
Ticket resolution agent 18,400 3.2 $0.41 34%
Contract review workflow 2,100 11.8 $2.90 71%
Lead enrichment agent 44,900 1.4 $0.06 12%
Code review agent 6,300 6.1 $0.88 48%
Weekly report generator 310 22.4 $4.15 9%

Illustrative product view. Figures are examples.

Retries

Isolate the spend that produced nothing.

Retry cost is the clearest saving in any agentic system, and it is almost never separated.

More detail

A workflow spending 71% of its budget on attempts that were discarded is not a cost problem to be optimized. It is a correctness problem with a price tag.

Separating retry cost from productive cost changes the conversation, because it names a specific defect with a specific dollar value rather than reporting that an agent is expensive.

  • Retry share of run cost, per workflow and per step
  • Alerts when retry share crosses a threshold you set
  • The specific tool calls or steps responsible for most retries
  • Non-terminating runs counted separately from failed runs
Savings ledger $61,800 identified
OptimizationWorkflow StatusSavings
Open-weight model covers the classification step Support triage Done $15,600
Cache the system prompt, 78% of input tokens Document workflow In progress $8,700
Put a ceiling on the agent retry loop Internal agents In progress $7,400
Move batch-eligible work off synchronous Data enrichment Planned $5,100
Committed-use tier now earned All providers Planned $14,200
Right-size a GPU endpoint at 11% utilization Self-hosted models Under review $6,900
Reclaim unopened seats on two AI tools Engineering Under review $3,900
Total$61,800 a month

Illustrative product view. Figures are examples.

Early warning

The Friday deploy, caught on Saturday.

A loop that ships on a Thursday afternoon and runs through the weekend is the archetypal AI cost incident.

More detail

Nothing is broken. Nothing pages. The charge appears three weeks later.

Per-workload baselines catch it the following morning. The alert names the workflow, the likely cause and the projected month-end effect, and goes to the engineering channel as well as to finance.

  • Per-workload baselines, active from day one with no configuration
  • Spikes flagged even when total company spend stays inside budget
  • Alerts routed to engineering channels or existing on-call via webhook
  • Projected month-end effect included, so the urgency is quantified
#finance-alerts Slack
Camaze App 9:02 AM

Support automation is running 3.1x its normal daily spend. Started yesterday at 14:20. At this rate the Support team lands about $58,000 over budget this month.

Yesterday
$4,180
Normal day
$1,350
Likely cause
Retry loop on the ticket summarizer
Owner
Support Engineering
Open in CamazeAssign ownerSnooze 24h
Platform team budget Alert sent day 5
Budget burn-up for the month, crossing the limit before month end Actual spend runs above the even-pace line all month and the projection crosses the ninety thousand dollar budget on day 28, ending the month at about one hundred and four thousand dollars. 0 $30k $60k $90k Budget $90k Even pace Over on day 28 Day 1Day 8Day 15Day 22Day 31
Actual spend Projection Even pace

Illustrative product view. Figures are examples.

Put unit economics on your agents.

Bring your most expensive agentic workflow and we will show you cost per run, calls per run and retry share on real data.

In practice

The four findings that come up every time

Across almost every agentic system we look at.

1

Retries are a third of the cost

Sometimes considerably more. Because retries succeed often enough to avoid attention, the cost accumulates without any signal until it is separated out.

2

Every step runs on the strongest model

Chains are built against one model during development and never differentiated. Routing, extraction and formatting steps are billed at frontier rates for work a small model handles identically.

3

Context grows across the run

Each step appends to the history, so the final calls in a long run carry everything before them. Cost grows faster than linearly with chain length, which is rarely anticipated.

4

Nothing has a ceiling

Most agentic systems have no per-run cost or call limit. Adding one is a small change and it converts an unbounded exposure into a bounded one.

FAQ

Questions people ask

Do you need instrumentation inside our agent framework?

No. Camaze works from provider usage and billing data, which is enough to establish cost per workflow and detect anomalies. Where your requests carry a run or workflow identifier, cost per run becomes measured rather than derived, which is more precise. That identifier is a small change and is worth adding, but nothing depends on it.

Can it stop a runaway agent automatically?

No, and deliberately not. Camaze is read-only and out of band, so it cannot halt your production systems. It alerts within a day and gives you the ceilings to implement in the agent itself. Anything that could stop a workflow would have to sit in the request path, which introduces a failure mode we are not willing to add.

How quickly is a loop detected?

Typically within a day, bounded by how fast the provider reports usage. Most provider APIs publish within hours, so a loop starting on Friday evening is generally flagged Saturday morning.

How do you separate retries from legitimate multi-step work?

By pattern. Retries repeat substantially the same call after a failed or rejected result, whereas legitimate steps advance the chain. Where the distinction is genuinely ambiguous, Camaze reports it as ambiguous rather than guessing, because a confident wrong attribution here is worse than an honest uncertain one.

Bound the exposure.

Book 30 minutes. We will show you cost per run and retry share on your own agentic workflows.

5 minute setup. Read-only. No engineering time needed.