How to Calculate Cost per PR Merged for AI Coding Assistants

20 Nov 2026
John D'Emic
[
CTO, Co-founder
]
Share
How to Calculate Cost per PR Merged for AI Coding Assistants

Engineering leaders keep getting asked whether the coding assistant budget is paying off, and most are answering with a seat invoice and a feeling. That worked when assistants were flat seat licenses parked in the software budget next to the design tool. Now that more of the spend is billed by usage, what an assistant costs varies widely from one developer to the next, and a seat invoice can't show any of that. Cost per merged pull request gives engineering and finance a unit cost they can both check, and it points at the decisions that change the bill.

Why a seat invoice isn't a unit cost

Dividing the assistant bill by headcount gives you an average cost per developer. It doesn't show how usage is distributed. Under consumption pricing, developers using different models or running longer sessions can incur very different costs. Start with per-person usage and the applicable billing model before extrapolating a cost across the team.

What cost per merged PR measures

The metric compares an assistant's AI spend over a window with the pull requests that were merged in the same window, read per developer or across the team. Most of the questions leaders ask about coding assistants are about whether developers are using them and whether the investment is paying off. A token total shows how much AI got used without showing whether the use produced anything, and a seat count only shows who has access. A merged PR is work that made it into the codebase, so the ratio connects spend to output in a form a finance partner can reconcile.

Building the number honestly

The numerator depends on which cost you're measuring. Provider billing tells you what you were charged. Metered usage tells you what the assistant consumed, valued at the configured API rates. On a subscription plan, that API-equivalent value can differ substantially from what you paid.

Revenium's developer and vendor views use different calculations. The developer-level Cost/PR divides a developer's API-equivalent estimated usage value by their merged PRs. The vendor comparison divides vendor spend by merged PRs attributed to that vendor's coding tools.

Developer Cost/PR = developer's API-equivalent estimated usage value / developer's merged PRs

Vendor Cost/PR = vendor spend / merged PRs attributed to that vendor's coding tools

Use the same reporting window for spend and merges. Count PRs by when they merged, not when they were opened. A PR opened last month and merged this month belongs in this month's denominator. That still doesn't mean this month's AI usage produced those exact PRs. This is a period-level ratio, not a record of the cost incurred on each change.

A PR assisted by tools from multiple vendors counts toward each vendor. Don't add those attributed counts together as if they were unique PRs.

Keeping seat value and real spend apart

On a seat plan, Revenium can value usage at API rates to show what that consumption would cost outside the subscription. That estimate is useful for understanding utilization, but it isn't an invoice charge. Label whether your Cost/PR uses estimated usage value or billed spend before comparing results.

Keep seat fees separate for a usage-only metric. If you're evaluating the total cost of an assistant, include those fees in a separate calculation without adding API-equivalent usage to a subscription bill that already covers it.

Vendor rate comparisons answer a separate question. Dollars per PR measures spend relative to merged changes. Dollars per token measures the price of usage. Comparing the two does not verify an invoice.

Where the number mislead

  • Review-heavy repos. PR counts follow authorship, so a developer who spends most of their AI usage reviewing other people's code shows high cost and few merged PRs. Reporting those repos or roles separately keeps reviewers from looking like outliers.
  • Bot-authored PRs. Dependency bots and automation accounts can open many PRs with little or no assistant spend. Leaving those accounts out of the denominator keeps them from pulling the org-wide number down.
  • Developers using more than one assistant. Someone working across two assistants in the same week shows up in two assistants' user tables, and a single PR can draw on both. Reading each assistant's number with that overlap in mind keeps one tool from getting all the credit for shared work.

What the metric is good for

Cost per merged PR helps you decide where to investigate. If the ratio rises, check whether usage increased, fewer PRs merged or the work changed. A developer reviewing a large migration will look different from one shipping small fixes, even if both are using their assistants effectively.

Before drawing conclusions about an individual, check their identity mapping and repository coverage. Missing PR data can make an active developer look like they're spending without delivering. Use the ratio alongside review effort, change quality and the kind of work being done. It does not establish who needs training or whether a seat should be removed. A renewal decision also needs subscription costs and a comparison of the available plans.

Revenium shows developer-level Cost/PR on supported assistant dashboards and vendor-level Cost/PR under Providers → Comparison. Connecting source control supplies the PR data, but vendor attribution also depends on recognizable markers. Those can include co-author trailers, commit author identities and markers in PR descriptions.

Claude Code, Cursor and Codex CLI have built-in detection signatures. Copilot, Gemini CLI and Cowork require additional configuration for vendor-level attribution. An assistant can contribute to a change without leaving a marker Revenium recognizes, so an unattributed PR does not establish that the work was done without AI.

Table of Contents
Ship With Confidence
Sign Up
Ship With Confidence

Start with visibility. Scale with control.

100,000 transactions free. No credit card required.

Start for free
Send
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.