AI Coding Costs: Measure Cost per Merged Pull Request

Nov 02, 2026 736 views

AI coding agents make the economics of software development harder to read. A task can trigger planning, code generation, tests, and repeated corrections, consuming 10 to 50 times the tokens of a basic chat prompt. As agents do more useful work, they also make more calls, and token based billing can make the most productive workflows the most expensive.

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

Usage caps and approval gates can contain spending, but they can also suppress the workflows that produce value. A token meter records consumption. It can't tell whether that consumption came from productive development or retries and runaway loops.

Connect AI spending to shipped code

A more useful measure is cost per merged pull request: the total cost of AI assisted development divided by changes that pass review and reach the codebase. Pair that figure with rework and defect rates, so a lower cost doesn't mask weaker software.

If cost per merged change declines as usage increases while quality holds steady, teams are getting more finished work from their AI spend. That shifts the management question from “How many tokens did we use?” to “What did the spend help us ship?”

Improving that result calls for two moves: use expensive inference where it earns its place, and reduce the cost of routine work.

Route work to the right model

Not every step in an agent workflow needs the strongest available model. A frontier model, or an on premises flagship where policy calls for it, can handle hard planning and unfamiliar reasoning. Code generation, test creation, and recurring refactoring may be suitable for open weight models operated in house.

A gateway can direct requests based on complexity, data sensitivity, cost, and response time. That lets teams reserve premium inference for tasks that warrant it, instead of paying premium rates across an entire workflow. The operating principle is to meter exceptional needs rather than routine volume.

Benchmark results suggest that leading open weight models can come close to frontier systems on some software engineering tasks. That doesn't prove they will perform equally well across every codebase. Teams should test candidates against their own repositories, test suites, and acceptance criteria before putting them into production workflows.

Make repeated inference cheaper

The next decision is whether to rent inference or own the capacity. With rented services, each additional call adds to the bill. Owned infrastructure requires upfront spending, but the cost of each added call can fall as utilization increases.

That comparison needs a full accounting. Power, operations, maintenance, and depreciation all contribute to the cost of owned capacity. The relevant measure remains the fully loaded cost per merged pull request.

There can also be a data control benefit that doesn't appear on an invoice. Running code generation and testing on premises can keep proprietary code within the enterprise. A controlled gateway can send approved planning prompts and governed exceptions to external models. That can make sensitive repositories more practical candidates for AI assisted development.

Use operating data to guide the mix

HPE says its hybrid AI platform routes routine workloads from more than 150 internal applications to open weight models running on premises, including on HPE Private Cloud AI. The company reports token cost reductions of 30 to 50 percent. Its approach combines owned capacity for recurring workloads with gateway access to frontier models for more demanding tasks.

HPE also reports that usage varies sharply among people with the same license: its top 5 percent of users generated most consumption, and the heaviest users consumed about 450 times as much as the lightest. If power users grew from a small minority to half the workforce, monthly spend could rise about 4.4 times even with no change in headcount. Those figures make a case for measuring actual activity rather than relying on licensed seats as a proxy for cost.

The company tracks cost per active developer to surface high usage and cost per merged pull request to connect spending with delivered software. Establishing both baselines before changing infrastructure gives teams a way to judge whether a new setup improves the economics.

Scale adoption around demand

Owned inference won't suit every organization. APIs can make more sense when demand is low or unpredictable, since they avoid capital tied up in idle systems. Ownership becomes more attractive when sustained usage keeps capacity busy. For many enterprises, the practical answer will be a hybrid mix: frontier APIs for demanding or intermittent tasks and owned capacity for repeatable volume.

As coding agents become a regular part of development, usage is likely to rise. The operating choice is whether that growth produces a larger variable bill or more shipped software from capacity the organization controls. Teams can make that choice with evidence: track cost per active developer, cost per merged change, and quality as usage expands.

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

Comments

Sign in to comment.
No comments yet. Be the first to comment.

Related Articles

Stop counting tokens, start counting what ships