Back to Blog

Cost per Token vs Cost per Completed Task: A Better Metric for AI Agents

Per-token pricing measures an input cost, but AI agent cost per completed task measures whether an agent actually delivered an acceptable result. For multi-step systems, that distinction changes model selection, infrastructure budgeting, and optimization priorities.

A low-priced model call can still produce an expensive workflow when the agent repeats failed tool calls, expands context unnecessarily, times out in a browser session, escalates to another model, or sends work to a human reviewer. Token price remains essential for reconciliation and capacity planning. It is simply not the final economic outcome for an agent.

Why AI agent cost per completed task reveals the real economics of multi-step workflows

A task is not the same thing as a request. A customer-support agent may classify an issue, query an order system, retrieve policy text, call a CRM tool, validate its draft, and generate a final response. A coding agent may inspect files, run tests, repair a failed patch, and ask for a second model pass.

Every step adds cost and a potential failure point.

Agent cost trajectory

The practical comparison is straightforward:

Metric

What it captures

What it can miss

Cost per token

Direct input, output, and cache-related model billing

Whether the task succeeded

Cost per request

Cost of one model call

The rest of an agent trajectory

Cost per agent run

End-to-end spend for one attempt

Failed or unacceptable outcomes

Cost per attempted task

Spend across every started task

The difference between success and failure

AI agent cost per completed task

All attributable spend divided by accepted outcomes

Requires a clear definition of completion

For production use, a useful formula is:

Cost per accepted completed task = total attributable cost / accepted completed tasks

The numerator should include more than LLM inference cost:

  • Input, output, cached-input, and cache-write token charges where applicable.

  • Tool calling costs for search, browser automation, databases, sandboxes, and third-party APIs.

  • Retry and repair loops.

  • Worker, queue, browser, storage, and observability costs where material.

  • Evaluation and human-review costs.

  • Failed runs, because they consumed real resources.

The denominator should be narrower than "received a response." Define an accepted task as one that meets functional, quality, safety, and latency requirements for the workflow.

A HTTP success code may show that an API request completed. It does not prove that an order lookup was accurate, a code patch passed tests, or a browser action reached the required postcondition.

What the AI agent cost per completed task news hook from TrueFoundry does and does not prove

On August 19, 2026, VentureBeat reported TrueFoundry's announcement that its open-source agent harness, TrueForge, claimed 30% to 75% cheaper task completion than Claude Managed Agents.

That claim is notable because it frames agent economics around completed work rather than token unit price.

TrueFoundry's reported comparisons were associated with DevRev's Enterprise-Bench, a multi-step tool-use setting involving CRM, issue-tracking, and document-management contexts. However, the 30% to 75% figure remains a TrueFoundry claim reported by VentureBeat, not an independently verified benchmark result.

The accessible reporting does not establish every detail needed for a fully auditable comparison, including sample size, run-to-run variance, model configuration, tool settings, evaluation rules, and the treatment of infrastructure or human-review costs. It also should not be interpreted as a GonkaRouter result or as evidence that one architecture will be cheaper for every workload.

TrueFoundry claimed task-completion savings reported by VentureBeat

The useful lesson is narrower and more durable: task-level outcomes are a better decision unit for agents than token price alone.

A lower direct model price can lose its advantage when it produces:

  • Invalid function arguments.

  • Repeated or unnecessary retrieval.

  • Longer reasoning trajectories.

  • Tool errors that trigger retries.

  • Context growth that increases later input cost.

  • More frequent escalation to a premium model.

  • More human correction after apparent completion.

Conversely, a higher-priced model can have a lower cost per successful task when it finishes reliably in fewer steps with fewer tool calls and less rework.

How to calculate AI agent cost per completed task with trace-level evidence

Teams should calculate the metric at the task and trace level, then segment it by workflow. A global average can hide expensive failures in coding, browser automation, claims handling, or support escalation.

Trace-level measurement

Start with this operating model:

Measurement layer

Capture

Why it matters

Task

Task type, user goal, difficulty, final status

Defines the business unit

Trace

Agent version, workflow version, duration, retries

Shows the full attempt

Model call

Model ID, token categories, pricing version, latency

Reconciles direct inference spending

Tool span

Tool name, arguments status, external cost, errors

Exposes tool calling costs

Evaluation

Validator result, quality score, safety status

Separates completion from acceptance

Human review

Escalation outcome, correction time, allocated cost

Makes rework visible

Use stable task_id and trace_id fields so every model call, tool invocation, retry, validation event, and final outcome can be joined to the same unit of work.

A practical task-level calculation looks like this:

Cost component

Example inclusions

Model cost

Input, cached input, cache writes, output tokens

Tool cost

Search queries, browser sessions, external APIs, sandbox runtime

Infrastructure cost

Workers, queues, storage, networking, retrieval systems

Evaluation cost

Deterministic checks, graders, sampled reviews

Human cost

Exception handling, correction, approval time

Official pricing documentation from OpenAI and Anthropic illustrates why token accounting itself is granular. Cached input, uncached input, output, and cache-write categories may receive different billing treatment. Track categories rather than storing only a total-token number.

A minimal implementation checklist:

  1. Define the task unit before changing prompts or models.

  2. Set acceptance criteria for correctness, quality, safety, and timing.

  3. Record every model and tool span under one trace.

  4. Log retry reason, such as transport error, invalid tool arguments, validation failure, or timeout.

  5. Record direct costs using a versioned price table.

  6. Capture tool and infrastructure charges where they materially affect the workflow.

  7. Evaluate the final result with deterministic validation where possible.

  8. Include human review and correction when it is a regular part of delivery.

  9. Segment results by task type, agent version, model, difficulty, and time period.

  10. Monitor tail behavior, including P95 latency, high-cost traces, and maximum loop count.

Where AI agent cost per completed task changes developer optimization priorities

Token optimization remains worth doing. Shorter prompts, structured outputs, retrieval discipline, and cache-aware context management can reduce direct LLM inference cost. But teams should not optimize those inputs in isolation.

Consider two hypothetical configurations for 100 started tasks:

Illustrative metric

Lower token price configuration

Higher token price configuration

Model cost per attempt

$0.012

$0.022

Total attempts

140

100

Accepted tasks

84

85

Total attributable cost

$3.50

$3.20

Cost per accepted task

$0.0417

$0.0376

The lower-token-price configuration costs less at the first model call, but it triggers more retries and tool work. The higher-cost configuration has a better first-pass outcome and a lower total cost per accepted task.

These numbers are hypothetical, not provider benchmarks. The pattern is common enough to justify a broader optimization order:

  1. Fix failure clusters first. Repeated tool schema errors or endless loops can outweigh prompt-level token savings.

  2. Improve acceptance criteria. A system that labels weak results as success will produce misleading economics.

  3. Measure escalation value. A premium fallback may be worthwhile only for task categories where quality improves enough to justify its incremental cost.

  4. Control trajectory length. Set sensible maximum steps, budget limits, deadlines, and duplicate-call detection.

  5. Inspect tool reliability separately. A slow or unstable downstream API is not necessarily a model problem.

  6. Track human rework. An apparently low-cost automated workflow can become costly after reviewers repair its output.

  7. Compare matched workloads. Hold task samples and quality thresholds constant when testing configurations.

Agent evaluation guidance from Langfuse usefully separates trajectory quality, tool use, task completion, and multi-turn quality. That separation matters because an agent can produce polished final text while still taking an unsafe, invalid, or unnecessarily expensive path.

How AI agent cost per completed task informs a restrained GonkaRouter test

GonkaRouter is an AI Model Router built for the Gonka Network. Its site displays an OpenAI-compatible endpoint and currently lists DeepSeek-V4-Flash-0731, Kimi-K2.6, and MiniMax-M2.7, along with Function Calling, Private VPC Deployment, and Web3 Ecosystem Integration.

For teams evaluating supported models through an inference-access layer, the correct conclusion is not that a router automatically lowers task cost. The practical value is the ability to conduct controlled workload tests through a consistent access point.

Controlled agent evaluation

A disciplined test should:

  • Use a representative set of real tasks and known failure cases.

  • Apply the same acceptance rules across configurations.

  • Record tokens, tool calls, retries, latency, failures, and evaluator outcomes.

  • Compare cost per accepted task rather than only published token rates.

  • Keep model, prompt, tool, and pricing assumptions versioned.

For additional context on the integration category, see GonkaRouter's guide to one OpenAI-compatible endpoint for multiple AI models.

New users receive $20 in API credit. At the displayed reference price of $0.0012 per 1 million tokens, that represents up to 16.7 billion tokens. Rates, token accounting, and actual usage vary by model and may change. Treat that credit as a way to test a small, representative workload, not as proof of production economics.

FAQs about AI agent cost per completed task

Is AI agent cost per completed task better than cost per token?

It is more useful for operational decisions involving multi-step agents. Cost per token remains necessary for billing analysis, forecasting, and prompt optimization, but it does not show whether the workflow produced an acceptable result.

Should AI agent cost per completed task include failed runs?

Yes. Failed, timed-out, and retried runs consume models, tools, compute, and engineering attention. They belong in the total cost numerator.

How does AI agent cost per completed task account for tool calling costs?

Include direct charges for search, browser sessions, databases, APIs, code execution, and other paid tools. Also track tool failures and retries because they can multiply cost.

What counts as a completed task in AI agent cost per completed task reporting?

A completed task should meet a written functional requirement. An accepted task should also meet the relevant quality, safety, and policy threshold for that workflow.

Can a more expensive model lower AI agent cost per completed task?

Yes. A model with a higher per-token rate can still lower overall cost if it completes tasks in fewer attempts, uses fewer tools, and reduces human rework.

The durable lesson is simple: AI agent cost per completed task converts model spend into an operational outcome. Review GonkaRouter's live model catalog and pricing, create an account if appropriate, and test a small representative workload before making a production cost decision.

โ† Back to all posts