Ask most AI founders what their agent costs and they'll quote you a token price, "about three dollars per million input tokens." That number is real, and it's also the least important line in the stack. The cost that actually decides whether you have a business is the AI agent cost per customer: the fully-loaded cost of everything an agent does on behalf of one customer over a month, attributed back to that specific customer. It's harder to calculate than a token price, and almost nobody does it. Here's the full cost stack, the formula, and a worked example at real 2026 model prices.
Why token cost is the smallest number that matters
Token prices have collapsed, roughly 80 to 90% over two years. As of mid-2026, GPT-5.4 runs about $2.50 input and $15 output per million tokens, Claude Sonnet 4.6 sits near $3 and $15, and budget tiers are pennies: Gemini Flash variants and DeepSeek V3.2 ($0.14 / $0.28) cost a fraction of frontier rates. The headline token price is cheap and getting cheaper, which is exactly why founders under-count everything wrapped around it.
Even the token line itself hides two traps. Output tokens cost three to eight times input tokens, the median ratio is roughly 4x, so a verbose agent burns money on the expensive side of the ledger. And reasoning models bill their hidden "thinking" tokens at the output rate, which can make a real call three to nine times its headline price. A one-paragraph answer from a reasoning model can quietly consume tens of thousands of output tokens before it ever speaks.
The real cost stack of an AI agent run
A single agent run is not one model call. It's a chain, and every link has a cost. To know what an agent truly costs, you have to account for the whole stack: * Input tokens: the prompt, system instructions, and any retrieved context. Long context windows are where costs run away quietly. * Output tokens: three to eight times the input rate; cap your max output tokens or pay for the model's verbosity. * Reasoning tokens: the invisible thinking tokens, billed at the output rate. * Retries and failed runs: you pay for every attempt, and only some of them succeed. This is the line that sinks naive cost models. * Tool and API calls: every external action (web search, code execution, a CRM lookup, an order-status call) carries its own cost and latency. * Retrieval and vector search: embedding and query costs against your knowledge base. * Orchestration compute: the agent framework, queues, and state management running the loop. * The multi-model tax: one run may call a cheap router model, a frontier reasoning model, and a vision model, each at a different rate. * Caching credits: the one line that runs the other way. Prompt caching charges as little as 10% of the base input rate on a hit and can cut input cost by 70 to 90% on consistent system prompts.
Token cost is one item on a list of nine. Quoting it as your cost is like quoting the flour when someone asks what the bakery spends.
The formula: from cost per run to AI agent cost per customer
Once you have the stack, the math chains cleanly: * Cost per run = the sum of model costs across all attempts, plus tool and API calls, plus retrieval, plus orchestration, net of caching. * Cost per agent = cost per run × runs over the period. * AI agent cost per customer = the sum of cost per run for every run that customer triggered, across every agent and workflow they touched.
The arithmetic is the easy part. The hard part is attribution. To roll cost up to a single customer, every event, every model call, every tool invocation, every retrieval, has to be tagged with a customer ID (and ideally an agent and use-case ID) at the moment it happens. Without per-event tagging you have a single blended infrastructure bill and no way to answer the only question that matters: which customers are expensive? That instrumentation gap is why so few teams can state their AI agent cost per customer even though the formula is trivial.
A worked example, at real 2026 prices
Take a support agent built on Claude Sonnet 4.6 ($3 / $15 per million tokens), with a cheap classifier in front and a few tools behind it.
Each attempt uses roughly 4,000 input tokens and 800 output tokens. That's (4,000 ÷ 1M × $3) + (800 ÷ 1M × $15) = $0.012 + $0.012 = about $0.024 in model cost. Add three tool calls (a CRM lookup, an order API, a knowledge-base query) at roughly $0.01 total, plus retrieval and embeddings at about $0.005, and a single attempt costs around $0.039 fully loaded.
Now the part founders skip. The agent resolves about half of conversations, so it takes roughly two attempts to produce one resolved conversation: about $0.078. Add a few cents of orchestration and you're at roughly $0.088 per resolved conversation. A token-only estimate would have told you $0.024, you'd have under-counted your real cost by nearly four times.
The per-customer view is where it gets sharp. Customer A drives 2,000 resolutions a month at $0.088 each, about $176. Customer B drives the same 2,000 resolutions, but their tickets are long, document-heavy, and ambiguous: 8,000 input tokens per attempt, heavier retrieval, and a 30% resolution rate that pushes them to more than three attempts per resolution. Customer B costs roughly $0.22 per resolution, about $440. Identical conversation counts, two and a half times the cost. Charge both customers the same flat rate and Customer B is silently eroding your margin, and you will never see it without per-customer attribution. This is precisely how a healthy-looking product ends up losing money on its power users.
How to actually instrument this
You don't need a data-science project. You need five disciplines, in order: 1. Tag every event with customer, agent, and use-case IDs at the moment it's emitted, not reconstructed later. 2. Capture cost at the event level, model, tokens in and out, cached tokens, tool calls, instead of reading it off the monthly provider invoice. 3. Store the raw events, so you can recompute costs when prices change. They will: each major provider re-prices two to three times a year. 4. Roll the events up, cost per run, then per agent, then per customer, then per use case. 5. Put cost next to revenue, so the output is margin, not just spend.
That last step is what turns a cost report into a business decision. Knowing your true cost per customer is what lets you choose the right pricing model and decide how to price your agents at all, because every pricing decision is downstream of a cost you can actually see.
The teams that know their AI agent cost per customer can price deliberately, cap the expensive tail, and protect margin as they scale. The teams that only know their token price are navigating with the cheapest, least relevant number on the dashboard.
Paygent captures cost at the event level and attributes it down to per-agent, per-customer, and per-use-case margin, so the true cost of your agents is a live dashboard, not a quarterly reconciliation.