Blog Post

Microsoft Mission Critical Blog
12 MIN READ

Tokenomics: the four levers that decide your Azure OpenAI bill

luciacasucci's avatar
luciacasucci
Icon for Microsoft rankMicrosoft
Sep 24, 2026

Which levers move your GenAI bill, what each one is for, and how to choose through the Well-Architected lens. 

September 2026. Views are my own, not Microsoft guidance. Pricing and product behavior change fast: everything below is accurate at time of writing. Verify against current pricing and docs before you design around it.

Your architecture diagram hides your biggest cost.

The boxes and arrows show data flow. They say nothing about token flow. And token flow is where cost, latency, and throughput get decided. Most teams learn this the same way: the first month runs fine, the pilot ships, then the invoice arrives and nobody can explain it.

That surprise has a name. Tokenomics. It is the discipline of treating tokens as the primary cost, latency, and scale lever in a GenAI system. Not an afterthought. The main thing.

Here is the part that makes it teachable. There are only four things you can do about a token.

  1. Send fewer input tokens.
  2. Generate fewer output tokens.
  3. Reuse tokens instead of paying for them twice.
  4. Pay less per token.

Every optimization you have ever read about is a tactic under one of these four levers. Learn the levers and you stop memorizing tricks. You start diagnosing.

Let me walk each one, Azure first, with a note on where other providers handle it differently.

 

 

                                                                                              [Diagram 1 – The four token levers]

Lever 1: send fewer input tokens

Input is the tax you pay before the model does any work for you. On GPT-4o, input runs about $2.50 per million tokens at time of writing. That sounds small until you multiply by a chatty retrieval pipeline running at production volume.

Two tactics do most of the work.

Prompt trimming. Every system prompt grows over time. Someone adds an instruction, then an example, then a guardrail, and nobody ever deletes anything. Audit the prompt. Cut the tokens that do not change the output. The impact is direct: fewer input tokens on every single call, forever.

RAG chunk discipline. Retrieval is the quiet budget killer. Teams stuff ten chunks into context when three would answer the question. Each extra chunk is input tokens you pay for on every request, plus latency the user feels while the model reads them. Tighten your retrieval. Rank harder. Send less.

The customer-experience angle matters as much as the cost angle. Shorter input is faster time to first token. The user notices the speed before they notice anything else.

Lever 2: generate fewer output tokens

This is the lever teams skip, and it is the one with the highest return per unit of effort.

Look at the pricing. On GPT-4o, output costs about $10 per million tokens against $2.50 for input at time of writing. Output is roughly four times more expensive than input. A generated token is the most expensive token you buy.

Yet output is the knob nobody touches, because it feels like a quality tradeoff. It is not. Most of the time it is a discipline problem.

  • Set max_tokens deliberately. An unbounded response is an unbounded bill.
  • Ask for the format you need. “Answer in one sentence” and “return only the JSON” are cost controls, not style notes.
  • Stop the model from narrating. Preambles, restated questions, and closing summaries are tokens you pay four times over to produce.

The cheapest optimization in your whole system is the one people are scared to touch. Start here.

Lever 3: reuse tokens instead of paying twice

If you send the same 2,000-token system prompt on every request, you are paying to process it every time. Caching stops that.

Prompt caching on Azure. This is largely automatic. For supported models, cached input reads are billed at a discount on the input price, and up to 100% off on provisioned deployments, at time of writing. You do not opt in. You earn cache hits by structure.

The rules are worth knowing because they change how you write prompts:

  • A request needs at least 1,024 tokens to be eligible.
  • The first 1,024 tokens must be identical to hit the cache. After that, hits occur every 128 additional identical tokens.
  • One character change in that prefix is a cache miss.
  • In-memory caches clear after 5 to 10 minutes of inactivity, and within an hour of last use.

The design rule that falls out of this: put stable content first. System instructions, examples, and tool definitions go at the top. Variable content goes at the end. Structure the prompt so the reusable part never moves.

 

                                                                                  [Diagram 2 – How prompt caching sees your prompt]

Semantic caching. Prompt caching matches identical prefixes. Semantic caching matches meaning. If two users ask the same question in different words, a semantic cache can serve the stored answer and skip the model call entirely. That is not a discount on a token. That is zero tokens. The tradeoff is a similarity threshold you have to tune, because a match that is too loose returns the wrong answer. Used well, it removes whole calls from your highest-traffic paths.

Where this looks different elsewhere. Azure prompt caching is implicit: you get it by keeping prefixes stable. Some providers make it explicit instead. Anthropic’s Claude, also available in Foundry, uses cache breakpoints you set yourself, and prices the two sides separately. At time of writing a cache write costs about 1.25 times the base input price and a cache read costs about 0.1 times, roughly a 90% discount on the cached portion. The takeaway is not which is cheaper. It is that caching is a universal pattern with two design styles: implicit by structure, or explicit by breakpoint. Know which one your platform uses, because it changes how you lay out a prompt.

 

Lever 4: pay less per token

Same tokens, lower unit price. Three moves, and the first two belong to two different people.

Model routing, the code-side move. Not every request needs your most expensive model. Classification, extraction, and short factual answers often run fine on a smaller, cheaper model. Routing sends each request to the cheapest model that can do the job, and reserves the frontier model for the calls that need it. This is what an engineer can change on Monday. The hard part is not the routing logic. It is deciding the quality bar for each path and testing that the cheaper model clears it.

Provisioned throughput, the capacity-side move. Pay-as-you-go bills per token and costs nothing when idle. Provisioned throughput reserves dedicated capacity for a fixed price, which lowers your effective per-token cost when you run that capacity hard. It is the same lever as routing, one level up: routing changes what you send, provisioned throughput changes what you pay for the pipe.

The decision is about traffic shape, not procurement. Provisioned capacity only pays off at high, steady utilization. Idle reserved capacity is worse than pay-as-you-go, because you pay for the hours nobody is using it. Industry estimates put the crossover somewhere around 40 to 60% sustained utilization for current frontier models, at time of writing, but do not design against someone else’s number. The official guidance is the right method: run pay-as-you-go for a few weeks, measure your real peak throughput, then model provisioned capacity against that baseline. Let your own traffic decide.

 

                                                                                       [Diagram 3 – PTU vs pay-as-you-go crossover]

Batch processing, the patience move. Not every workload needs an answer now. Nightly document extraction, embedding pipelines, bulk classification: these can wait. The Azure OpenAI Batch API returns results within 24 hours for about 50% off Global Standard pricing, at time of writing. If a job does not need real-time latency, running it on demand is paying double for speed you are not using.

Now add an agent: the multiplier problem

Everything so far assumed one request, one call. Agents break that assumption.

An agent turns a single user request into a chain of calls: one to plan, several to use tools, more to check its own work. One question can become dozens of model calls before the user sees an answer. The four levers still apply to each call. But now a fifth sits on top of them: control how many calls you make.

Three things make agent bills explode.

Workflow multipliers. A single request fans out into planning, tool calls, and validation. Each step is billable. The cost of one interaction is the cost per call times a number you do not directly see.

Context bloat. Every step carries the growing conversation and any retrieved documents as input. Because models are stateless, the full context ships with every request, so cost climbs even when the user only asks a simple follow-up. Input tokens dominate the bill in most agent workloads. Practitioner guides put input at 60 to 70% of spend. Treat that as directional, not a promise, but the direction is right: the prompt, not the answer, is where agent money goes.

Runaway loops. Without a hard stop, an agent that cannot solve a task can retry forever, burning tokens until a budget or a timeout catches it. A single stuck agent can outspend a thousand normal requests.

 The lever that answers all three: make fewer calls.

  • Put a supervisor in front. One orchestrator that enforces step limits and deterministic exit conditions beats agents coordinating peer to peer with no ceiling.
  • Cap the loop. Every agent needs a maximum step count and a clear definition of done.
  • Audit tool use. An agent calling an expensive search API or reading a large file on every step is a cost leak you can see once you look.

Then move non-real-time agent work to the Batch API. Much of what agents do at scale, extraction, enrichment, summarization, does not need an answer this second.

Stacked, these moves compound. Practitioner guides report 47 to 85% savings from combining them without hurting quality. Take the range as directional, since your result depends on your workload, but the lesson holds: no single lever wins, the stack does.

Guardrails: treat cost like a production discipline

The teams that keep agent costs sane stopped treating cost as a cleanup task. They treat it as a production practice, the way they treat latency or uptime. Some call it AI FinOps. The name matters less than the shift, from build-and-ship to measured-and-governed.

Two kinds of limit, both automated.

  • Soft limits: budget alerts that page someone when spend crosses a threshold.
  • Hard limits: a cutoff that pauses agent operations when spend exceeds the ceiling, before a loop drains the account.

Two metrics worth more than a raw token count.

  • Cost per session: what one complete user interaction costs, end to end. This is the number that scales with your business.
  • Token ratio: input against output. A ratio that skews hard toward input points straight at context bloat and tells you which lever to pull.

None of this is one-time work at launch. Prompts change, traffic shifts, a new tool gets added, and the cost profile moves with it. Cost-to-value is something you measure on every agentic step, not once.

Run AI as a managed investment system

Microsoft’s Foundry team frames the end state cleanly: stop running AI as a string of one-off pilots and start running it as a managed investment system, where every request is sized to its job, every agent improves as it runs, and every dollar is bounded and accounted for. The money is already moving. In a Microsoft-commissioned IDC survey of more than 4,000 business leaders, 71% said they plan to increase AI budgets. The budgets are growing. The open question is whether the discipline grows with them.

That system makes three decisions, each at a different speed.

  • Optimize the request, at runtime. Right-size every call so simple work never pays frontier prices. This is routing, caching, and tighter context.
  • Optimize the workflow, over time. Make each agent cheaper as you learn what works. This is step caps, tool audits, and promoting the cheapest configuration that holds quality.
  • Govern the spend, continuously. Set limits and budgets that never sleep, so no agent runs away with the bill.

Foundry ships capabilities for each of these, from a model router across cost, quality, and balanced modes, to prompt and semantic caching, to an agent optimizer that promotes the best configuration, to Azure API Management acting as an AI gateway that meters traffic and enforces token rate limits. You do not need all of it to start. You need to know which of the three decisions each tool serves.

Bring four questions to your next budget review. If you cannot answer one, that is where to start.

  1. Do we know what we are paying for? Spend should break down by model, agent, and workflow, not hide in one invoice line.
  2. Are we paying the right amount for each request? Most requests do not need a frontier model.
  3. Are our agents operating efficiently? Agent cost should fall over time, not drift up.
  4. Do our limits hold when usage spikes? Controls that only work at normal load are not controls.

The managed-investment framing, the three-speed loop, the four questions, and the 71% figure come from Microsoft’s Economics of Agent Optimization (see References). The 60 to 70% input share and the 47 to 85% stacked-savings range come from the two practitioner guides in References, and are theirs and directional.

Where this sits in the Well-Architected Framework

Tokenomics reads like a cost story. It is wider than that. It touches four of the five Well-Architected Framework pillars, and treating it as cost-only is how teams miss half the value.

Cost Optimization. The obvious one. Every lever above lowers spend directly. Token cost is not overhead you trim at the end. It is a design input from day one.

Performance Efficiency. Cost and speed move together here. Shorter input is faster time to first token. A cache hit is a response the user waits less for. Routing a simple call to a smaller model returns faster and cheaper at once. The user feels the latency before they ever see the bill.

Reliability. Capacity is a reliability decision, not only a cost one. Pay-as-you-go can hit rate limits under a traffic spike, which shows up to the customer as a failed request. Provisioned throughput reserves headroom, so the tradeoff is dedicated capacity against elastic scale. And any cache you add is a dependency you now have to reason about when it is cold or unavailable.

Operational Excellence. You cannot manage what you do not measure. Instrument token usage per request. The API returns cached_tokens in the response, so cache hit rate is a metric you can watch, not a guess. Track cost per session and the input-to-output token ratio, not raw totals alone: those two catch context bloat and runaway agents early. Set budgets and alerts on token spend the way you would on any other resource. A cost regression should page someone before the invoice does.

Security. Caching and data residency intersect. In-memory prompt caching is compatible with all data residency regions at time of writing. Extended caching temporarily stores data on GPU machines, and that data stays within the data zone boundary for Data Zone deployments and within the regional boundary for Regional deployments. For a regulated workload, that boundary is a design constraint, not a footnote. Confirm it before you turn on extended retention.

 

                                                                                      [Diagram 4 – Tokenomics across the five pillars]

The decision matrix: which lever, when

Lever

The move

Reach for it when

Watch out for

Send fewer input tokens

Trim prompts, tighten RAG retrieval

Every workload, especially chatty RAG pipelines

Cutting context the model needs

Generate fewer output tokens

Set max_tokens, request tight formats, cut narration

Output-heavy responses; highest return per unit of effort

Trimming output that carries real value

Reuse tokens

Prompt caching (stable prefix first), semantic caching

Repeated system prompts; high-traffic similar queries

Moving prefixes cause misses; loose semantic thresholds return wrong answers

Pay less per token

Model routing, provisioned throughput, Batch API

Mixed workloads; steady high volume; non-real-time jobs

Routing quality bar; idle PTU; 24-hour batch latency

Make fewer calls (agents)

Supervisor, step caps, tool-use audits

Any agentic workflow

Runaway loops; unbounded or expensive tool calls

Govern the spend

Soft and hard budget limits, cost per session, token ratio

Always, from day one

Limits that only hold at normal load

How to sequence this

Do not try everything at once. Diagnose, then act in order of return.

  1. Cap output. Highest return, lowest effort, start today.
  2. Trim input and tighten retrieval. Direct savings on every call.
  3. Structure prompts for cache hits. Nearly free once the layout is fixed.
  4. Add semantic caching on your highest-traffic paths.
  5. Route to smaller models where the quality bar allows.
  6. Move non-real-time work to the Batch API.
  7. If you run agents, cap steps and put a supervisor in front. Fewer calls beats cheaper calls.
  8. Model provisioned throughput once your volume is steady and high.
  9. Wire budget guardrails and track cost per session, so the next regression pages you instead of surprising you.

The order matters because early moves are cheap and compounding, and the capacity commitment near the end is one you should only make with data behind it.

Your architecture diagram will still hide your token flow. But now you know where to look, and which lever to pull first.

Disclaimer

The views expressed in this article are those of the author and do not necessarily reflect the official policy or position of Microsoft. The author is a Microsoft employee.

References

Published Sep 24, 2026
Version 1.0
No CommentsBe the first to comment