Real-Time LLM Cost Tracking by Team, Project, and Model
Growing usage and pricier workloads are hiding cost increases that per-token discounts can't offset.

Enterprise AI spending is outrunning its own unit economics, and most finance teams still can't say why. Blended AI costs fell 67% year over year, from $18.40 down to $6.07 per unit of work, yet 73% of enterprises report their AI bill came in over projection anyway. The gap between those two facts comes down to usage growth and a shift toward pricier workloads, and it's why real-time cost tracking, broken down by team, project, and model, has stopped being a nice-to-have report. It's the thing standing between a finance team and a monthly surprise.
Average monthly enterprise AI spend hit $85,521 in 2025, up 36% year over year, based on a survey of software professionals at manager level and above. Total enterprise LLM spending more than doubled in under a year, from $3.5 billion to $8.4 billion between late 2024 and mid-2025. Worker access to sanctioned AI tools grew 50% in 2025, Deloitte's enterprise AI report states. More people sent more requests, even as each individual request got cheaper to run. Unit economics improved. Total spend didn't follow, because volume swamped the discount.
Workload mix makes it worse. Vercel's AI Gateway production index found total gateway spend rose 43% month over month in May while token volume grew only 20%. Teams weren't just sending more requests, they were sending pricier ones, tilted toward heavier tasks. Tool-call requests on Vercel's gateway network went from a small fraction of all tokens in October 2025 to a majority by April 2026, and tool-using requests run roughly 2.6 times more token-heavy than everything else. Falling per-token prices and rising per-task complexity pull the invoice in opposite directions, and right now, complexity is winning.
What the provider invoice cannot tell you
A provider invoice tells you spending went up. It never tells you why.
It won't say which customer triggered the spike, which feature shipped a longer system prompt, which retry loop fired repeatedly, or which agent run spun into a chain of tool calls nobody reviewed. Cost and cause live in two separate systems: one is the bill, the other is whatever logs your application happens to keep. By the time someone reconciles them, the billing cycle has closed. Diagnosis after the fact is an autopsy. It's an autopsy.
That gap is structural, and it exists because LLM costs don't behave like the API costs most teams already know how to track. A single request might cost a fraction of a cent, or it might cost real money, depending on which model answered it, how long the input ran, how many tokens came back, whether the model burned tokens on internal reasoning, and whether the input carried images or audio. Traditional APIs charge per call. LLMs charge per token, and token counts swing wildly based on decisions made inside the prompt, not just outside it.
Running one AI feature keeps that variance manageable. Running a dozen AI-powered products, each with its own team, its own model choices, its own prompt patterns, compounds the variance. All of it lands on one shared bill from one provider, flattened into a single number that hides where the money actually went.
Getting past that flattening means attaching metadata to every model call: which user made the request, which customer it served, which feature triggered it, which workflow it belonged to. Once cost and that metadata are on the same trace, someone can build a rollup that actually means something, one that supports a pricing decision, a margin calculation, or a fix to a broken workflow, not just a budget review that happens once a quarter.
Skipping that attribution makes three things impossible at once. Nobody can tell whether a cost spike came from a new feature's prompt design or a retry bug loose in an agent workflow. Nobody can hold a team to a budget, because there's no way to trace usage back to the team that generated it. And nobody can optimize spend, because nobody knows which model-task pairings are the expensive outliers dragging the average up.
What an LLM gateway does in production
An LLM gateway sits between an application and the model providers it calls. It's a proxy layer that puts every provider behind one interface, so instead of integrating separately with each provider's SDK, auth scheme, and billing quirks, the application talks to the gateway once. The gateway handles the translation underneath: formatting the request correctly, normalizing the response, managing whatever error handling each provider demands.
Most teams don't start here. Most start by routing LLM traffic through whatever cloud API gateway they already own, something like AWS API Gateway or Azure API Management. That works fine for a proof of concept, and it falls apart in production, because those tools were built for a different kind of traffic. AI workloads need token-based rate limiting instead of request counts, routing across multiple model providers, semantic caching, defenses against prompt injection, and support for protocols like MCP that agent workflows depend on. A generic API gateway was never built with any of that in mind, and bolting it on after the fact shows.
Since every LLM request has to pass through the gateway anyway, the gateway becomes the natural place to attach the metadata that makes cost tracking real: team, project, model, environment, tagged before the request ever reaches the provider. That's what turns cost visibility from something reconstructed after the invoice arrives into something visible the moment the request happens. It's also where budget enforcement lives: hard limits that block a request outright once a threshold is crossed, soft limits that throttle or alert before spend gets there. Enforcement beats alerting every time, because an alert just tells you the money is already gone.
Gateways carry a few other production jobs. Automatic failover kicks in when a provider errors out or goes down, rerouting the request instead of failing it. Semantic caching returns a previously computed answer for a prompt close enough to one already served, cutting cost and latency without touching application code. Virtual keys bundle access permissions, budget limits, and rate limits into a single governable unit, so a team's credentials carry its constraints built in from the start.
The four capabilities that make cost tracking operational rather than decorative
A dashboard showing spend by team looks nice. It only matters if it's tied to enforcement, tied to real attribution, and fast enough to change behavior before the damage is done. Four capabilities separate a system that works from one that just decorates a slide deck.
Enforced budgets come first. Hard limits block requests once a threshold hits. Soft limits alert or throttle before that threshold arrives. Granularity is what makes any of this useful: a single global spending cap tells you nothing about which team broke it. Budgets need to exist for each organization, team, application, and API key, because a retry loop with a bug in it can burn through a month's allocation in minutes. A gateway enforcing a limit at the key level is the only backstop fast enough to catch that.
Token-based rate limiting matters just as much, and this is where most teams get it wrong first. Limiting requests per minute doesn't control AI spend, because one request might use 50 tokens and another might use several hundred thousand. Rate limits denominated in requests miss the entire cost story. Limits belong in tokens instead, mapped to what a request actually costs, with per-key and per-team ceilings so one runaway workflow can't eat the capacity that belongs to everyone else.
Granular attribution ties it together. Cost has to map to teams, projects, customers, and environments individually, not pool into one number on a shared bill. Every request needs to carry metadata: which model answered it, which provider served it, input and output token counts, latency, a tag for the user or feature that triggered it. That's what makes a rollup trustworthy enough to run a chargeback or a margin analysis on a specific product line, rather than a guess dressed up as a report.
Putting those three together stops cost tracking from being a monthly ritual. It turns into something closer to a control system, catching problems while they're still cheap to fix, not after they've already shown up on an invoice nobody can unwind.
How model routing determines cost before tracking even begins
Cost tracking tells you what happened. Routing decides what happens in the first place, and it happens before a single dollar gets attributed to anything.
Without deliberate routing, a simple classification task and a complex multi-step reasoning task both land on the same expensive model, because that's the default nobody bothered to change. The fix is simple to state: send each task to the cheapest model that clears the quality bar reliably, and only escalate to something pricier when the task genuinely needs deeper reasoning or tighter output quality. Most teams skip this step entirely and pay a flat tax on every easy request for the rest of the year.
Benchmark numbers show how wide that cost spread runs. Gemini 2.5 Flash scored 97.1% quality at $0.003 per unit in one benchmark, with a median response time of 1.1 seconds, making it the cheapest viable production option measured. DeepSeek V3 came in at $0.008 with a lower quality score, and that's the tell: the cheapest model isn't automatically the right one, since a quality drop that's fine for one task disqualifies it for another. Organizations that built a tiered model architecture, routing easy tasks to cheap models and hard tasks up the chain, landed at a median blended cost of $2.31.
Academic work has formalized this tradeoff. RouteLLM, out of LMSYS and UC Berkeley, is an open-source framework built for exactly this problem, published as a research paper at ICLR 2025. It trains a classifier to predict whether a lightweight model can answer a given prompt as well as a frontier model would, then routes accordingly. The claimed result: cutting inference spend by more than 75% while holding onto 95% of the response quality a strong model would deliver, measured against standard benchmarks. Running the router means hosting an active scoring model, and that adds 50 to 200 milliseconds of classifier latency to every request. RouteLLM works as a complementary algorithmic layer on top of gateway infrastructure. It solves the routing decision. It doesn't touch auth, budgets, or failover.
At the infrastructure layer, LiteLLM offers multiple routing strategies across more than 100 providers, cost-based routing among them. LiteLLM picks the cheapest available deployment, but it doesn't weigh cost against quality the way RouteLLM's classifier does. Call that infrastructure-level routing: useful, necessary, and solving a narrower slice of the problem than people assume when they hear "routing" used as one word for both.
Ramp Router grew out of more than 100 internal AI use cases at Ramp, applying optimizations spanning caching, context compaction, and spend controls. Ramp reports the router cut its own LLM bill by 30% while improving speed and model fit. That's one company's account of its own infrastructure, not a general benchmark; it's a concrete number from a real deployment, which counts for more than another vendor's marketing slide.
What the 2026 gateway landscape looks like in practice
By 2026, the gateway market has settled around a handful of production-grade options, each trading off performance, deployment model, and governance depth differently. None of them are interchangeable once you look closely, and picking the wrong one causes a latency problem or a compliance gap months later that nobody budgeted time to fix.
LiteLLM remains the most widely adopted option for Python-centric teams, offering one interface across more than 100 LLM APIs through an OpenAI-compatible format. It supports virtual keys, per-user budgets, and Redis-based rate limiting for teams running on Kubernetes. The tradeoff appears under load: because it runs on Python, concurrent traffic brings overhead, and the GIL puts a throughput ceiling on multi-core hosts. For teams pushing real request volume, that's a real constraint, not a footnote to skip past. LiteLLM's routing strategies include cost-based routing, though as covered above, that optimizes for price alone, not the price-quality tradeoff RouteLLM handles.
The broader pattern across the 2026 landscape is specialization. Some gateways chase raw throughput and low-latency overhead. Others go after governance depth: SSO integration, role-based access control, audit logging built for compliance frameworks like SOC 2 or HIPAA. Others still optimize for breadth, supporting the widest possible set of models and providers behind one API. No gateway wins on every axis at once, and anyone shopping for one should stop looking for the one that does. Latency at scale, a compliance requirement that can't bend, or just wanting one API key instead of eight determines which constraint bites first.
The tools now exist to close the gap between falling unit costs and rising total spend. A gateway with real attribution, enforced budgets, token-based limits, and routing that actually weighs cost against quality turns an invoice from a monthly surprise into a number that was already predictable, weeks before it arrived.


