Ler original em português

← All content

dooopSoftware · Product · 14 min

How to Measure Cost Per Task in AI Features

Understand how to measure cost per task in AI by separating calls, context, tools, failures, and human review to decide limits and simplifications.

Published on September 6, 2026

CENTRAL THESIS

Model call is a technical event. The decision unit is the completed task.

Measuring cost per task separates consumption, exceptions, and waste before discussing return.

Tracking the cost per task of artificial intelligence means measuring how much operational effort an intelligent feature consumes to deliver a useful action to the user. The main unit should not be the model call but the completed task, including context used, attempts, tools triggered, failures, human reviews, and abandonment.

This measurement does not promise financial return. It creates a basis to compare versions, identify waste, and decide when to simplify, limit, review, or discontinue a product capability.

Why Measure by Task and Not Just by AI Call

A model call is a technical event. A completed task is a product event.

This difference changes the conversation. If an AI feature helps a person classify messages, review catalog descriptions, or suggest next steps in support, what matters to leadership is not only how many times the model was triggered. What matters is the entire path until the task makes sense to the user.

The same task can consume very different resources depending on the design. In one execution, the AI receives a short context, responds once, and the user accepts. In another, the feature retrieves multiple information blocks, calls an external tool, generates an incomplete response, tries again, requests human approval, and only then finishes. Counting both as one call or even as equivalent executions hides operational reality.

Therefore, AI cost per task should start from three separate units:

  • Model call: each inference made by an AI model.
  • Execution attempt: each cycle in which the feature tries to solve the task.
  • Completed task: the value action for the user, with start, end, and success criteria.

The call remains relevant. It helps explain technical consumption. But it should not be the main product decision unit.

This distinction also avoids a common trap in AI products: optimizing what is easy to count and ignoring what changes the experience. A feature may reduce calls and worsen task completion. Another may increase calls in specific situations but avoid relevant human rework. Without measuring the entire task, leadership sees disconnected pieces.

This topic connects directly to AI product evolution addressed in the guide Intelligence in the product: how to evolve software with AI. The question here is more operational: what is the smallest unit that allows clear decisions?

What Is Included in the Operational Cost of an Intelligent Task

AI operational cost does not need to start with price, margin, or return. Before that, it needs to separate components.

In an intelligent feature, cost per task may include:

  • Inference: model usage to generate, classify, compare, or decide.
  • Context retrieval: searching for information in internal databases, history, documents, or external data.
  • Tool usage: calls to systems, APIs, or functions that AI triggers to execute parts of the task.
  • Temporary storage: records needed to maintain state, traceability, or continuity.
  • Repeated attempts: reprocessing caused by insufficient, ambiguous, or incomplete responses.
  • Fallback: alternative path when automation cannot proceed safely.
  • Human review: time for approval, correction, triage, or manual decision.
  • Support and observability: effort to understand failures, monitor behavior, and investigate deviations.

Not all these items will have monetary value assigned initially. Still, it is worth recording them. The first function of the metric is not to close a definitive financial account. It is to allow comparison between design versions.

If a prompt change reduces attempts but greatly increases loaded context, the team needs to see both sides. If a new agent triggers too many tools for simple tasks, this must appear. If human review becomes the bottleneck, the cost is in the process, not just the model.

This separation helps avoid turning cost per task into a single success metric. Quality, reliability, latency, security, and experience remain relevant. A product does not improve just because it became cheaper to run. It improves when it delivers the right task, with compatible cost, reliable behavior, and clear limits.

How to Calculate Without Hiding Failed Attempts

One way to calculate the monetary average is to divide the cost assigned to all attempts of a task during a period by the number of tasks completed in the same period. Thus, failed or abandoned attempts enter the numerator even without producing a conclusion.

Cost per completed task = cost assigned to all attempts in the period ÷ tasks completed in the period.

Separate technical expenditure from human effort. Record review and support time in its own unit; convert this time into money only with an explicit attribution criterion. Tokens, hours, and monetary values cannot be summed directly. For shared costs, document the allocation rule and use the same rule when comparing versions.

If no task was completed, the average is undefined. Record the cost consumed and the absence of conclusions instead of reporting zero cost. Also track cost per attempt and completion rate to understand if variation came from technical consumption or task completion difficulty. This calculation is a proposal for operational measurement; values should come from the feature’s own records.

How to Design Telemetry Before Deploying the Feature to Production

Telemetry is the set of records that allows observing the feature’s behavior in operation. In AI, it needs to reconstruct the complete task execution, not just record success or error at the end.

Before deploying the feature to production, define stable events. They do not need to depend on a specific platform. They need to allow comparison over time.

A minimal design can record:

  • task_started: task start by user or system.
  • intent_selected: identified intent, category, or task type.
  • context_retrieved: consulted context, with identifier, source, and selection rule version.
  • route_selected: route used, such as predefined flow, information retrieval, or agent.
  • model_called: model or model class triggered, without exposing sensitive data.
  • tool_called: external tool, function, or integration used.
  • response_delivered: response presented to user or system.
  • correction_requested: request for adjustment, redo, or completion.
  • human_review_requested: sent for human approval, correction, or decision.
  • task_failed: failure due to technical error, lack of context, or safety limit.
  • task_abandoned: abandonment before reaching a final state.
  • task_completed: completion according to defined criteria.

The critical point is to use correlation identifiers. Each event must be linkable to the same task execution, configuration version, and route taken. Without this, analysis becomes a collection of interesting logs but little actionable.

It is also useful to record versions. Prompt, context policy, model, tool, fallback rule, and user experience can change. If the team does not know which version was active in each execution, it loses the ability to compare before and after.

Anthropic defines context engineering as selecting and maintaining the information available to the model during inference, including instructions, tools, external data, and history, within a limited window. This definition reinforces a practical point: context is not invisible background. It is part of execution and must be observed.

How to Separate Expected Cost, Exception Cost, and Waste Cost

Not all additional cost is waste. An intelligent feature needs to handle variation, ambiguity, and exceptions. The problem is when exceptions become routine or complexity adds no value to the task.

A simple taxonomy helps:

  • Expected cost: consumption necessary for the task to work within the planned design.
  • Exception cost: additional consumption in legitimate situations, such as fallback, human review, or repetition due to lack of information.
  • Waste cost: consumption caused by excessive context, redundant calls, circular attempts, or low-utility automation.

Fictional example: imagine a SaaS support system that uses AI to suggest an initial response to account configuration support requests. In version A, the feature follows a predefined flow. It identifies intent, retrieves a snippet from the knowledge base, generates a suggestion, and asks the agent for confirmation. In version B, an agent dynamically decides which steps to follow and can consult the base, check account history, and trigger a diagnostic tool.

Version B may be appropriate when the request requires investigation. But for simple and repetitive questions, it may trigger context and tools unnecessarily. In this case, analysis should not automatically conclude that agents are expensive or flows are better. The correct question is: for which task classes does the dynamic route deliver utility proportional to operational cost?

Anthropic distinguishes flows with predefined paths from agents that dynamically decide their process and tool usage. In the same article, it recommends starting with the simplest solution and adding complexity when necessary. This is useful guidance for product design: measuring cost per task helps discover where complexity is justified.

For this fictional example, the effects of any change would be hypotheses to measure. Reducing context may decrease consumption but also worsen quality. Limiting tools may avoid waste but increase fallback. Transforming a dynamic route into a predefined flow may simplify operation but reduce coverage in ambiguous cases.

The metric does not decide alone. It shows which part of the design needs discussion.

Which Limits Trigger Product Review

Measuring without limits becomes a decorative dashboard. For AI cost per task to work as a product metric, it is necessary to define review triggers.

These limits can be expressed without specific prices. For example:

  • Maximum cost per completed task, defined based on tracked components.
  • Maximum number of attempts per execution before fallback.
  • Acceptable percentage of tasks requiring human review.
  • Maximum time in review state before completion or abandonment.
  • Allowed variation between usage segments, task types, or execution routes.
  • Maximum frequency of redundant calls for the same context.
  • Limit of tools triggered in tasks considered simple.

The limit does not need to be perfect on day one. It needs to be explicit enough to guide a decision. When consumption deviates from expected, who reviews? Product, engineering, data, operations, or support? What decisions are available: maintain, simplify, limit, experiment with another design, or remove the capability?

The logic approaches service level objectives. Google SRE defines service level objectives as reliability goals guiding engineering decisions, with agreement on targets, error budget use for prioritization, and review process. Here, the idea is not to copy reliability practice literally. It is to adopt the discipline of combining goal, tolerance, and review.

A product with AI needs this discipline because cost can grow unintuitively. Sometimes variation appears in a small task segment. Sometimes it arises from a context change. Sometimes it emerges because users learned to request more open tasks than the design supported.

Without limits, review tends to happen late, when consumption has already become operational pressure.

Questions to Review AI Cost Per Task

Use these questions before treating the feature as ready for operation:

  • Task unit: does the measured task represent a value action for the user, not just a model call? Evidence: task name, start event, completion event, and success criteria.
  • Execution boundary: is it clear where execution starts and ends, including abandonment, error, or human review? Evidence: event map with possible final states such as completed, abandoned, failed, escalated, or canceled.
  • Cost components: does measurement separate inference, context, tools, repeated attempts, fallback, and human effort? Evidence: telemetry fields by component, even if some lack monetary value assigned.
  • Context used: does the record allow knowing which information blocks, history, or external data were provided to the model? Evidence: context identifier, approximate size, consulted source, and selection rule version.
  • Variation by route: is it possible to compare the cost of a predefined flow with the cost of an agent that dynamically decides steps and tools? Evidence: execution route field, orchestration type, and number of tools triggered.
  • Review limit: is there an explicit limit that forces the team to review the feature when cost per task deviates from expected? Evidence: operational goal, tolerance, responsible for review, and possible decision.
  • Version comparison: can the team compare cost per task before and after a prompt, context, model, or flow change? Evidence: configuration version, actual change date, testable hypothesis, and tracked metric.

This checklist also helps decide if the feature is mature enough to advance. Maturity here does not mean having a proprietary model. Third-party models can support mature products when design, telemetry, governance, and limits are well defined. For a broader view on organizational starting point, it is worth connecting this discussion to the AI maturity diagnosis.

When to Simplify the Feature Instead of Optimizing the Model

When cost per task rises, the most tempting reaction is to change the model, adjust the prompt, or negotiate infrastructure. Sometimes this makes sense. Often the prior question should be about design.

Does the feature really need to decide each step dynamically? Does it need to consult the entire history? Does it need to trigger an external tool on every execution? Does it need to automate the entire step or would recommending and asking for confirmation suffice?

Simplifying can mean:

  • Reducing the context available for the task.
  • Separating simple tasks from ambiguous tasks.
  • Transforming an agent into a predefined flow for recurring cases.
  • Limiting tools by intent type.
  • Asking the user for confirmation before triggering a more costly route.
  • Removing an automated step when utility does not justify operational complexity.

This decision relates to experience and governance choices. In some flows, AI should recommend. In others, it can execute. In others, it should stop. The article on when AI recommends and when it executes deepens this boundary, but cost per task measurement offers an additional signal: automatic execution without limits tends to hide consumption until operation is pressured.

The criterion is not always choosing the cheapest path. It is choosing the simplest design that delivers the task with quality, reliability, and control proportional to risk and value.

How to Review Cost Per Task in Product Cycles

AI cost per task should enter the product cycle as an operational metric, not as a late audit.

At first, frequent review helps the team understand patterns. Later, the ritual can mature into version comparisons and analysis of outlier tasks. The format can be lightweight as long as it answers concrete questions:

  • Which tasks consumed more than expected?
  • Did the excess come from context, tools, attempts, fallback, or human review?
  • Does the pattern appear in a specific route or all uses?
  • Did the previous change have a testable hypothesis?
  • Will the next change reduce some cost component, change the execution route, or keep the current design?

It is important to separate discovery, hypothesis, and experiment. Discovery is observing that a task class consumes more resources. Hypothesis is formulating a testable explanation, such as excess context in simple requests. Experiment is changing part of the design and measuring the effect on cost, quality, latency, and task completion.

Microsoft describes its ExP platform as a way to incorporate experimentation into the development cycle, validate hypotheses, measure impact, and iterate products. This does not mean user feedback automatically retrains a model. Feedback can feed analysis, hypothesis, and experiment, as long as this cycle is designed.

The concrete decision is to define operational measurement before discussing price, margin, or return. Choose the task, record the complete execution, separate cost components, establish review limits, and document who decides design changes.

The final question is which product capability supports its cost per task, which needs another design, and which should not scale yet.

If you want to discuss this decision in your company context, talk to dooop.

Further Reading

Sources

NEXT DECISION

Discussing Application in the Company

Conversation about the software company context

Content by dooop. Registration allows relating this topic to the reader’s journey and tracking interest in the subject.

Conversation about the software company context

We will use your details to deliver this content and contact you about related topics.