Open source: context compression for coding agents, 63% less tool output ⭐ optscale-kompressor on GitHub →
AI ROI & Impact Analysis

How to Measure and Maximize the ROI of AI Investments

October 8, 2026

~ 5 min

On this page
    Prove what your AI spend delivers
    Book a Demo

    Calculating the ROI of AI looks like a one-line formula. In practice, almost every input to that formula is missing, scattered across budgets, or supplied by the people whose tools are being evaluated. That is why so many AI business cases stall at the moment someone asks for the number behind the claim.

    This is not a rare failure. In June 2025, Gartner predicted that more than 40% of agentic AI projects would be canceled by the end of 2027, citing escalating costs, unclear business value, and inadequate risk controls. Unclear business value is a measurement failure before it is a technology failure. The projects are not necessarily bad, but nobody can prove they are good.

    This guide walks through how to calculate AI ROI end to end: what belongs on the cost side, what counts as value, which KPIs feed the formula, the mistakes that make a figure collapse under questioning, and how to keep the measurement running instead of rebuilding it by hand each quarter. For where AI impact shows up across cost, efficiency, and risk, and how it differs by industry, see our companion article on the business impact of AI adoption.

    First, it helps to understand why AI ROI is harder to calculate than the return on a typical technology investment.

    ‍

    Why Is AI ROI Difficult to Measure?

    Standard IT investment analysis assumes predictable adoption, well-understood implementation timelines, and benefits that begin shortly after deployment. AI investments break all three assumptions, for three reasons.

    Benefits are mostly indirect. When AI helps an engineer or a support agent work faster, the benefit shows up as extra capacity, not as a line-item cost reduction. Headcount rarely changes, because AI accelerates people rather than replacing them. Unless you track the extra output and connect it to shipped work, the value stays invisible.

    Costs are distributed. Provider API fees from OpenAI, Anthropic, or Google are visible on a monthly statement. The rest — engineering time spent on prompts and RAG pipelines, infrastructure overhead, evaluation datasets, security and compliance work, change management and ongoing maintenance — is rarely aggregated into one view. Without disciplined tracking and cost attribution by team, organizations consistently undercount total cost of ownership (TCO).

    Perception is unreliable. In a randomized controlled trial published in July 2025, METR had 16 experienced open-source developers work through 246 real issues in repositories they already knew well, randomly allowing or disallowing AI tools. The developers took 19% longer with AI. They had forecast a 24% speed-up beforehand and still believed, afterward, that AI had made them about 20% faster. It is one study, on early-2025 tools and mature codebases, and METR treats the result as a historical snapshot rather than a verdict. But it is the clearest available demonstration of why self-reported time savings cannot be an input to an AI investment ROI figure: if the people doing the work were wrong about the direction of the effect, a survey of them is not evidence.

    ‍

    How to Calculate AI ROI: Cost Inputs vs. Value Outputs

    Separating proof from hope requires one formula applied consistently. The calculation itself is simple:

    AI ROI (%) = (Total quantified value − Total cost of ownership) ÷ Total cost of ownership × 100

    A worked example (illustrative). An internal support assistant costs $180,000 a year all-in: API spend, integration work, evaluation, and maintenance. Measured against the pre-AI baseline for the same queue, it deflects tickets worth $240,000 a year in agent time, and cuts overflow vendor fees by 30,000.ROI=(270,000 − $180,000) ÷ $180,000 × 100 = 50%.

    Type image caption here (optional)
    ‍

    The arithmetic is never the hard part. The inputs are. To calculate AI ROI credibly, you need four components:

    •      Value created — quantifiable efficiency gains, error reductions, revenue expansion and risk mitigation.

    •      Total cost of ownership — direct API costs plus development, infrastructure, evaluation, training, and operational maintenance.

    •      ROI and payback period — net value over time, expressed as months to payback and, for larger programs, net present value.

    •      Baseline benchmarking — output, speed and defect rates compared against a pre-AI baseline for the same team and the same kind of work.

    For context: IDC's 2024 study commissioned by Microsoft, based on interviews with more than 4,000 business leaders, reported an average return of $3.70 for every $1 invested in generative AI, with top performers reporting $10.30 and organizations realizing value within about 13 months. Treat that as a ceiling set by adopters who chose to answer a survey, not as your own benchmark. It is self-reported, and the study is vendor-sponsored — exactly the kind of provenance a CFO will ask about, so state it before they do.

    Cost Inputs vs. Value Outputs Matrix

    Cost inputs (the true investment)

    Value outputs (the business outcome)

    Model and token spend: API calls, gateway hosting, prompt and completion token fees.

    Direct cost reduction: deflected support tickets, reduced third-party vendor fees.

    Engineering and integration: time spent on prompts, RAG pipelines, API glue code.

    Capacity expansion: more output volume without adding headcount.

    Infrastructure and compute: vector databases, caching layers, hosting.

    Speed to market: shorter cycle time (for example, PR open-to-merge duration).

    Maintenance and drift: edge-case fixes, prompt updates, model migrations.

    Quality and risk reduction: lower defect escape rate, fewer SLA breaches.

    ‍

    AI ROI KPIs: What to Measure on the Value Side

    The value side of the formula should be built from outcome KPIs, not activity counts such as "requests processed" or "active users". All figures below are illustrative; in practice, each should come from your own systems with its sample size and inclusion rules attached.

    •      Cost per output (cost per merged PR, cost per resolved ticket) — total model and infrastructure spend divided by completed, verified units of work. Illustrative: an engineering team spends $2,150 in API tokens over a month, and merges 125 pull requests, so its AI cost per merged PR is $17.20. For software teams, this unit deserves its own treatment; we cover how to build it, and the two metrics that belong beside it, in cost per merged PR as an AI ROI metric.

    •      Productivity gains (capacity lift) — the percentage change in completed work units per person over a period, against the pre-AI baseline. Illustrative: a legal team that drafted 10 contracts per attorney per week now drafts 14 with AI assistance — a 40% lift, provided the review rejection rate did not move.

    •      Revert and defect escape rate — how often AI-assisted code or content fails in production or needs post-merge remediation. If AI-assisted PRs are reverted more often than the team's baseline, the cost-per-output figure flatters the program until you price in that rework.

    •      Time saved (velocity) — the reduction in elapsed cycle time from task start to completion. Illustrative: median support resolution time falling from 24 hours to 4 hours per ticket.

    •      Payback period — the number of months until cumulative measured value covers cumulative cost. Illustrative: a program with a $90,000 build cost that then costs $40,000 a month to run and returns $55,000 a month in measured value pays back in six months.

    ‍

    See these KPIs on live data

    Cost per merged PR, cost per feature, and revert rate, calculated from your AI gateway, GitHub, and Jira instead of surveys and spreadsheets

    Common Mistakes When Measuring AI ROI

    •      Counting activity instead of outcomes. "Our internal AI tool processed 50,000 requests this month" sounds impressive to executives. But did those requests close Jira tickets? Did they produce merged code? Activity metrics are easy to collect and fundamentally misleading.

    •      Overestimating time saved. "AI saves 30 minutes per task" only creates value if the saved time converts into higher-value work. If freed hours refill with low-value administrative work, the return is illusory. This is a process-design problem rather than a model problem, and it is the most common reason a technically correct ROI calculation still describes nothing real. Our companion piece on why process redesign decides AI impact covers how much of an AI program's effort belongs in process and people change.

    •      Ignoring maintenance. Pilot costs are predictable. Ongoing maintenance — updating prompts when models change, handling API deprecations, debugging hallucinations — is routinely buried in general IT budgets and never reaches the ROI denominator.

    •      Missing the baseline. Deploying AI tools without capturing performance data before the rollout makes it impossible to prove improvement later. Establishing a pre-AI baseline is the single most important and most frequently skipped step.

    •      Cherry-picking metrics. Highlighting a 50% speed improvement while ignoring a 20% rise in post-release bugs destroys credibility the moment the full operational picture surfaces.

    ‍

    Five Checks Before You Present the Number

    An AI ROI figure is rarely challenged on its arithmetic. It is challenged on where the inputs came from. Five checks separate a number you can defend from one you can only present.

    •      Baseline. State what the comparison is against: the same team, the same kind of work, before adoption. A percentage with no baseline is a claim, not a measurement.

    •      Sample size and inclusion rules. Every figure travels with the number of observations behind it and the rules for what was included or excluded. "Cost per merged PR is 17.20"invitesadifferentquestionthan"17.20 across 125 merged PRs in August, excluding reverted work."

    •      Join confidence. Some links between spend and outcome are deterministic — a session identifier or a commit trailer ties a specific token cost to a specific pull request. Others are inferred by matching on timing and authorship. Keep the two apart, label which is which, and leave the inferred ones out of headline numbers by default.

    •      Coverage, stated honestly. If some AI traffic bypasses your gateway, report the share that does. Quietly dropping it from the denominator inflates every per-unit metric you publish, and it is the first thing a skeptical reviewer will look for.

    •      Versioned definitions. Write down each metric's formula, lineage, and known limitations, and version it. When a definition changes, start a new series instead of restating a figure the board has already seen.

    Organizations that report a credible return on investment in AI are not the ones with the most favorable raw numbers. They are the ones whose numbers hold their shape when questioned — which raises the practical problem of producing them continuously instead of once a quarter.

    ‍

    How to Track AI ROI Continuously with Live Data

    The traditional way to measure AI impact is painful: quarterly surveys, self-reported time-saved estimates from employees whose tool budgets depend on the answer, and manual spreadsheet reconciliation. Each cycle costs weeks, and each one rests on figures supplied by the teams being measured.

    To produce numbers that hold up in a board meeting, measurement must be automated, continuous, and pulled from systems of record—a live AI ROI report that joins what you spend with what your teams actually shipped, rather than a spreadsheet assembled after the fact.

    This is the gap OptScale AI closes. It sits as an AI gateway between your teams and the AI providers they use, or adds a telemetry plugin to the gateway you already operate, and connects read-only to GitHub and Jira. Tokens, model, provider, cost and actor from the gateway are matched to merged PRs, review rounds, reverts and ticket transitions along an explicit chain: trace_id to commit to pull request to ticket.

    •      The five checks above are built in. Comparisons are framed against concurrent non-AI work and a pre-adoption baseline; every figure carries its sample size and join confidence; traffic that bypasses the gateway appears as a coverage figure, and editing a metric definition creates a new version rather than rewriting history.

    •      Outcomes are read, not reported. Nobody fills in a survey or has to remember to instrument an SDK call; outcomes come straight from GitHub and Jira.

    •      Cost levers are judged against outcomes. When routing moves work to a cheaper model or token compression trims context, the saving is measured net and end-to-end against what actually merged — so a saving that degrades output shows up as a quality regression, not a win.

    Full detail on the join and the metric wizard is on the AI ROI & Impact product page.

    Calculate AI ROI from real data

    Join AI spend to the work your teams actually shipped and set up your first live ROI metric in under ten minutes. Try it on your own traffic, or see it in the live demo

    Frequently asked questions

    What is AI ROI?

    AI ROI (return on investment) measures the financial and operational value generated by an AI investment compared with its total cost. A complete calculation includes direct costs such as API usage and infrastructure, and indirect costs such as engineering, maintenance, training, and integration.

    How do you calculate AI ROI?

    Subtract the total cost of ownership (TCO) from the total quantified value created, divide the result by TCO, and multiply by 100. For example, $270,000 of measured value against $180,000 of TCO is a 50% ROI. The value side must be measured against a pre-AI baseline for the same team and the same kind of work, not estimated from surveys.

    Which KPIs go into an AI ROI calculation?

    Cost per completed output (for example, cost per merged PR or per resolved ticket), productivity lift against baseline, time saved, defect or revert rates, direct cost reductions, and payback period. The right mix depends on the use case, and every KPI should carry its sample size and inclusion rules.

    What is a good ROI for AI?

    There is no reliable universal benchmark. The most cited figure — IDC's $3.70 returned per $1 invested in generative AI — is self-reported by survey respondents in a vendor-sponsored study, so treat it as a ceiling. A more useful test is whether your own ROI is positive against your own pre-AI baseline, with a payback period your finance team accepts.

    Why is AI ROI difficult to measure?

    AI benefits are mostly indirect; costs are spread across APIs, engineering, infrastructure, training, security, and maintenance, and people are poor judges of their own productivity change. Without connecting cost to measurable outcomes, organizations overestimate the value of an AI deployment.

    Why can't we just survey our teams about time saved?

    Because self-assessment has been measured and found to point the wrong way. In METR's 2025 randomized controlled trial, developers took 19% longer with AI tools while believing they had been about 20% faster. Outcomes should come from systems of record, not from the people whose budgets depend on the answer.

    How can companies track AI ROI continuously?

    By connecting AI gateway telemetry — tokens, models, and API cost — to engineering systems of record such as GitHub, Jira, and CI, and joining them automatically on session, commit, and pull request. This measures actual business outcomes instead of self-reported productivity estimates.