Trendveris
Live Coverage
AI & ML

AI Coding Costs: Measure Merged Work, Not Tokens

AI agents can multiply token use. Tracking cost per merged pull request helps teams connect infrastructure choices to shipped software.

Nov 02, 2026 | 3 min read
Sign in to save

AI coding costs are increasingly tied to how much work an agent does between prompts. A coding agent plans, writes code, runs tests and retries when something breaks; one task can consume 10 to 50 times the tokens of a basic chat exchange. As teams rely on agents for more of the development cycle, token pricing can make the most productive workflows the most expensive.

That pressure is showing up in budgets and pricing models. Uber reportedly used up its 2026 AI budget by April after expanding its use of Claude Code. GitHub Copilot shifted from flat-rate subscriptions to metered credits, while Gartner predicts AI coding token costs will exceed the average developer salary by 2028.

Usage caps and approval gates offer an immediate way to contain bills, but they can also throttle useful work. Token counts reveal how much a system consumed, not whether it produced a reviewed change or got stuck in retries. A spending limit treats both outcomes alike.

Connect AI spend to shipped code

Cost per merged pull request gives engineering leaders a more useful signal: divide AI-assisted development costs by the changes that pass review and land in the codebase. Pair that measure with rework and defect rates. Otherwise, a lower cost could simply mean teams are shipping less carefully.

The aim is to reduce the cost of each accepted change while preserving quality, even as developers make greater use of agents. That means reserving expensive inference for work that needs it and reducing the cost of repeatable tasks.

Route requests by difficulty and sensitivity

Not every step in an agentic workflow needs a top-tier model. Complex planning and unfamiliar reasoning may justify a frontier model, or an on-premises flagship when company policy requires it. Code generation, test writing and recurring refactors may be suitable for open-weight models operated in-house.

A model gateway can select where each request goes based on complexity, sensitivity, cost and latency. This lets teams pay for premium inference where it matters, instead of applying that price to every step. Open-weight models are approaching frontier performance on some software-engineering benchmarks, but benchmark results don't prove they will perform equally well across every repository. Teams should evaluate them against their own code, tests and acceptance criteria before assigning production work.

Choose capacity for sustained demand

Rented inference makes each additional call a variable expense. Owned infrastructure shifts more of the cost upfront, potentially lowering the cost of additional calls as utilization grows. That calculation needs to include power, operations, maintenance and depreciation; the relevant comparison remains the fully loaded cost per merged pull request.

Running code generation and tests on premises can also keep proprietary code within the organization. A controlled gateway can send approved planning prompts and governed exceptions to external models while keeping sensitive repositories on local capacity. That can make AI assistance practical in codebases where data handling has limited adoption.

Track usage before changing infrastructure

HPE says its hybrid AI platform routes routine workloads from more than 150 internal applications to on-premises open-weight models, including those running on HPE Private Cloud AI. The company reports token cost reductions of 30 to 50%.

Usage distribution matters as much as the choice of model. In HPE's data, the top 5% of users accounted for most consumption, and the heaviest users consumed about 450 times as much as the lightest users on the same license. If power users grow from a small minority to half the workforce, monthly spending could rise roughly 4.4 times even with no change in headcount. Each organization needs its own usage data to see whether that pattern applies.

HPE recommends tracking cost per active developer alongside cost per merged pull request. The first makes high usage visible instead of diluting it across every licensed seat; the second ties spending to code that has passed review. Establish both baselines before changing infrastructure, then measure a full development cycle on owned capacity. If the metrics don't improve as usage rises, the existing setup may still be more economical.

Design around adoption

Owned capacity makes the most sense when demand is steady enough to keep it busy. For low or unpredictable use, APIs avoid tying up capital in idle infrastructure. Many enterprises will need a mix: external frontier models for demanding or intermittent tasks, and owned capacity for repeatable volume. A governed gateway can control which requests leave the organization's environment.

As coding agents take on more work, token use is likely to grow. The practical question for engineering leaders is whether that growth produces a rising variable bill or more completed software at a lower cost per accepted change. Measuring outcomes, routing tasks to suitable models and matching infrastructure to actual demand gives teams a way to expand adoption without relying on blunt usage limits.

To learn more about HPE Private Cloud AI, please visit HPE.

This content was produced by HPE. It was not written by MIT Technology Review’s editorial staff.

Source: Affan Syed · www.technologyreview.com
Sign in to join the discussion.