Blog / Agent experience (AX)

Cost per successful task: the one number that shows if your tools are agent-ready

“How much do AI agents cost on our API?” Most teams answer with tokens per call, or a pass rate. Neither tells you what a done job costs. One division does.

Leonid Bugaev · Published 21 Oct 2026

The metric

cost per success = (input tokens summed over all runs of the job) ÷ (runs that passed)

It combines pass rate and tokens per task into one number that goes down only if your server gets cheaper or more reliable.

Live numbers

Codex CLI on a 99-tool production MCP server, 8 read-only jobs × 5 runs.

Best group (2/5 passed)
460,455
One record's detail (5/5)
301,486
Targeting summary (5/5)
289,193
Campaign status (4/5)
262,435
My feedback (5/5)
238,883
Find a company (5/5)
228,509
Plan and credits (3/5)
189,672
Search by job title (5/5)
178,252

Input tokens per successful run. The cheapest job per run (plan and credits, 113,803) isn't the cheapest per success, because it failed 2 of 5 times: the agent didn't find the tools.

All 8 jobsPassedTokens per runPer success
Codex34/40 (71–93%)218,032~256,508
Claude Code, strict32/40 (65–90%)209,722~262,152
Claude Code, label accepted37/40209,722~226,726

Get cost per successful task for your server.

We run your users' jobs in the agent apps they use and report tokens, passes with ranges, and cost per success per job.

Measure your MCP

Before and after on a mock

On a made-up task-tracker server every run passed (10/10 per cell), so the cost per success is just tokens per run. Median input tokens per run, before → after fixing descriptions, errors and result sizes:

Claude Code
26,960 → 20,249 (−25%)
Codex
89,129 → 78,126 (−12%)
Small model
21,344 → 17,168 (−20%)

Details: sample report and cheaper models and MCP reliability.

How to measure it

  1. Pick your users' real jobs, in their words.
  2. Run each 5+ times per agent app, with ground truth from fixed calls.
  3. Record each app's own input-token usage per run (including cached), and score pass/fail.
  4. Per job: sum tokens ÷ passes. Show the pass rate with its range next to it.
  5. Re-run after each server change; the number should fall.

Caveats

Go deeper: Agent experience (AX), How to measure MCP server quality, MCP context window usage.

Back to agent experience (AX).

How we measured

FAQ

How do I measure the cost of AI agents using my API?

Run each user job several times in the agent apps your users use, sum the input tokens for all runs (passing and failing), and divide by the number that passed. Report it per job and per app, alongside the pass rate with a range.

Why not just tokens per run?

Because failed runs cost tokens too and deliver nothing. In our live data, one job averaged 184k tokens per run but passed only 2 of 5, so each success cost about 460k.

Should I convert tokens to money?

You can, with each vendor's price and cache discount, but much agent input is cached and priced differently. Tokens compare more fairly across time; we report tokens.

Get cost per successful task for your server.

We run your users' jobs in the agent apps they use and report tokens, passes with ranges, and cost per success per job.

Measure your MCP