There’s a math conundrum hidden in AI cost calculations. At the end of the month, an AI service company has two sets of invoices. And while each might be accurate within its system, they rarely align at the accounting level. This is the gap that AI billing infrastructure has to close.
If you read the first article in this series, you’ll have a good understanding of the provider costs behind a single voice AI interaction. Our second story looked at why early AI pricing needs to be checked against real usage data. Today, we’re looking at the missing connection between the two: matching customer revenue to provider cost at the account level, and what a proven billing practice from telecommunications can teach AI companies about doing it well.

The two bill problem
Even if the results are fuzzy, those two sets of invoices make sense. One goes to customers and shows what each account was charged. The other comes from vendors and shows what you paid for model calls, speech services, telephony, cloud resources, tool APIs, and other providers.
Your finance department can see total customer revenue and the total vendor cost. What they often can’t see is whether they made a profit last month off of Customer X.
This is a serious problem. If AI companies want to have the whole picture, AI billing has to do more than produce invoices. It has to connect customer usage, provider cost, pricing rules, and revenue records at the account level so that margin is a measured output, not a monthly estimate.
The missing AI cost record is margin by account

Most AI service companies can answer two questions. But they have to answer them separately.
“What did we bill Customer X?” No problem. The billing platform or invoicing system has the answer to that.
“What did we spend on AI this month?” Got that sorted. The vendor dashboards and FinOps tools have that information.
The question AI providers struggle with is the one that sits in between. “What did it cost to serve Customer X, and did the revenue from that account cover it?”
In other words: Is Customer X profitable? What is the margin by account?
To get that figure, you have to join the records from both sides. Usage events from the application. Provider charges from vendor invoices. Customer pricing rules from the contract. Invoice lines from the billing system. When these records are not linked, finance sees a blended margin across the entire customer base. Sure, they know whether the overall number is healthy or declining. But they cannot say which accounts are driving the outcome.
AI revenue leakage begins as a structural gap, not a dramatic failure. Unbilled usage, pricing misconfigurations, missed escalators, reconciliation errors between provider charges, and customer invoices are common in fragmented billing environments.
Let’s look at an illustration. BluLogix estimates that AI companies with a 5% leakage rate on $10M in annual revenue lose $500,000 per year in earned revenue that is never collected. The m3ter and PwC UK software monetization survey describes revenue leakage in the range of 4% to 7% of ARR, with 87% of respondents reporting a lack of integration between billing and ERP or general ledger systems.
Margin by account (aka per-account margin) is the metric that makes leakage visible before it compounds.
What changes when the records connect
When you can link usage events, provider charges, and customer invoices at the account level, the company gains a measured answer to a critical question: Did this customer make us money last month? And that can guide decisions across the business.

Finance can see which accounts are profitable before the month closes. If the provider AI cost rises faster than customer revenue, the account appears on a margin report while there is still time to adjust the pricing rule, workflow, or invoice logic. AI cost attribution connected to the revenue record turns margin into a signal rather than a retrospective calculation.
Sales can compare a proposed deal with accounts that behave similarly around the workflow type, model mix, interaction duration, and tool usage. They no longer have to judge a discount against blended margin. Instead, they can judge it against real delivery cost for comparable accounts. The difference between pricing on estimates and pricing on data is the difference between hoping the margin holds and knowing where it sits before the contract is signed.
Meanwhile, the customer success department can see when an account changes behaviour. For example, a customer that used to run short tasks may start running longer agent workflows with more tool calls and heavier model usage. The change shows up before renewal, not after the margin has already moved.
Engineering gains a feedback loop between workflow changes and commercial outcomes. Switching from a premium to a lighter LLM, reducing tool call frequency, optimizing context window management: these all have measurable margin effects when you can connect provider AI cost to customer accounts. Without that connection, engineering optimizes for latency and accuracy. With it, engineering can optimize for per-customer profitability too.
Telecom already solved a similar billing problem

The structural challenge AI companies face with AI cost has a precedent. Telecommunications operators worked through a similar problem over decades. The billing practices they built map directly to what AI companies need now.
A telecom call created two records at once. The customer-facing record determined what the subscriber paid. The supplier-facing records determined what other carriers were owed. A single call might touch an originating carrier, a transit carrier, and a terminating carrier. Each bills in different units, under different rate agreements, on different settlement cycles.
Revenue assurance to the rescue
Interconnect billing connected those records through rating, routing, settlement, and reconciliation. Usage records were rated, checked, re-rated when needed, and matched against partner agreements before settlement. If the system could not match a usage record to a billing rule, it suspended the issue and resolved it before the billing period closed. This practice, which became known as revenue assurance, enabled operators that invested in it to catch mismatches early. Operators that did not invest in it kept on with old fashioned monthly reconciliation. The result? They discovered those mismatches only after the revenue disappeared.
Per-transaction cost attribution meant that every supplier charge was connected to the specific customer interaction that generated it. This made per-customer profitability a continuous output of the billing system rather than a quarterly exercise. Operators could see which customers were profitable, which routes were expensive, and where supplier costs were drifting from the rates built into customer pricing.
These connected records opened up possibilities that went beyond accounting. Operators could now route traffic to the most cost-effective supplier per transaction. They could detect revenue leakage as it happened, price new services based on measured unit economics, and model the margin impact of a rate change before committing to it.
The operators who built this connection early gained a structural advantage. while those who continued to run on blended averages and monthly reconciliation leaked revenue, mispriced contracts, and discovered margin problems only after they had compounded.
The lesson for AI companies is that the same multi-vendor, per-transaction billing economics that demanded this level of connection now apply to what you are selling.
What AI billing infrastructure has to connect
For AI service companies, interactions go beyond ordinary phone calls. They can include chat sessions, voice conversations, generated documents, agent tasks, or API requests.

AI cost billing units are tokens, minutes, characters, tool calls, API calls, and compute time. The shape of the problem is familiar: connect the usage event to the provider charge, the customer account, the pricing rule, and the invoice line.
The flow looks like this: Customer interaction >> Usage events (tokens, minutes, characters, API calls, tool calls) >> Provider charges (LLM, STT, TTS, carrier, cloud, tools) >> Customer account (customer ID, contract, pricing rules) >> Invoice line (what the customer is charged) >> Margin record (revenue minus provider cost, per account).
OK, that was a lot of chevrons. Here’s something more visual:

Each step in this chain already produces and records data. Application logs capture what happened, vendor invoices and API billing dashboards capture what each provider charged, and the billing platform holds pricing rules and produces invoices. The challenge is joining them at the account level so that margin is a measured output – per interaction, per customer, per billing period.
Where current tools stop, PortaAIM takes over

Most AI businesses already have pieces of the answer. Records from FinOp tools that track where spend is going. Metered usage and invoices from billing systems. Product logs that show customer activities. But these records usually stop short of one shared output: margin by account.
Producing that number means matching each billable interaction to the provider costs behind it, applying the customer’s pricing rules, comparing the result with the invoice line, and flagging anything that does not reconcile. That is where AI cost attribution evolves beyond cost reporting into revenue assurance.
Twenty-five years of high-volume billing engineering built the patterns for multi-vendor billing reconciliation, real-time rating, revenue assurance, and per-account settlement at scale. AI companies reaching the point where AI margin visibility is becoming a commercial priority can apply these patterns to their own usage events, provider charges, and customer invoices. And you can do it without building the practice from scratch.
PortaAIM fills this exact role by leveraging records that already exist and joining them at the account level. As a result, you are able to see which customers are profitable, which workflows are expensive, which usage was never billed, and where provider cost is drifting away from customer revenue. AI cost and AI revenue become AI profitability, per customer.
Request a demo to see how PortaAIM connects usage, provider cost, and customer billing in one system.