Cost & Capacity Engineering · 1 of 5
Unit Economics of Tokens
A practical guide to measuring what each token costs, what value it creates, and which levers actually change the bill.
A token is a small piece of text that an artificial intelligence system reads or writes. It might be a word, part of a word, a number, or a punctuation mark. The simple fact that models charge by tokens changes how software economics work: every longer prompt, retrieved document, reasoning step, tool result, and answer can become a metered unit. Good token economics is not about making every response short. It is about knowing when extra tokens buy better outcomes and when they are only expensive noise.
Start with the smallest billable unit
Before thinking about budgets, latency, or architecture, start with the unit being counted. Most large language models do not process text as full words. They break text into tokens, which are small chunks that are convenient for the model. The phrase “unit economics of tokens” means the cost, value, and behavior of one useful unit of model work.
A token is not the same as a character and not exactly the same as a word. “Running” might be one token in one model and two in another. A long legal clause, a code file, or a chat history can contain thousands of tokens. The exact split matters less than the habit of treating tokens as measurable input and output units.
There are usually two main categories: input tokens and output tokens. Input tokens are what you send to the model: user messages, system instructions, examples, retrieved passages, tool outputs, and prior conversation. Output tokens are what the model generates. They are often priced differently because generating text usually consumes more compute than reading it.
Cost is more than the visible prompt
A user may type one sentence, but the application may send much more. The hidden prompt can include policy instructions, formatting rules, examples, user profile details, retrieved documents, conversation memory, and the output of tools such as search or database queries. All of this can become input tokens.
The basic token cost for one request is straightforward: input tokens multiplied by the input price, plus output tokens multiplied by the output price. If the request uses multiple model calls, add the cost of each call. If it retries after an error, add the retry. If it asks a model to inspect its own answer, add that review call too.
Token prices also interact with infrastructure costs. A slower, longer request may hold a server connection open, increase queue time, or require more concurrency. For self-hosted models, the bill is not usually expressed as price per token, but the same idea still applies: tokens consume graphics processing unit time, memory, power, and operational attention.
- Input tokens: instructions, user text, retrieved context, chat history, and tool outputs.
- Output tokens: the model’s answer, intermediate drafts, reasoning traces when exposed or billed, and structured data it generates.
- Control tokens: retries, moderation calls, routing calls, evaluation calls, and summarization calls that support the main experience.
- Non-token costs: storage, networking, orchestration, monitoring, human review, and the engineering work needed to keep the system reliable.
Value depends on the job, not the token
A token has no value by itself. A token has value only when it helps complete a job: resolving a support case, drafting a contract clause, finding a defect, translating a document, qualifying a lead, or helping an employee make a better decision. The unit of value is usually the completed task, not the model call.
That distinction prevents a common mistake: optimizing for low token cost while damaging the business outcome. A short answer that causes the user to ask three follow-up questions may cost more than a longer, clearer answer. A small context window that omits the key policy paragraph may produce a cheap but wrong response.
The practical question is not “How do we use fewer tokens?” It is “Which tokens increase the probability of a successful outcome?” In some workloads, extra context is wasteful. In others, it is insurance against expensive mistakes.
Measure the full unit, not one call
A production artificial intelligence feature rarely consists of one prompt and one answer. It may classify the request, retrieve documents, call a smaller model to rewrite the query, call a larger model to answer, call a safety check, and store a summary. If you measure only the final model call, you will misunderstand the economics.
A better unit is the user-visible transaction. For a customer service bot, the unit may be one resolved case. For a coding assistant, it may be one accepted code suggestion. For an internal knowledge tool, it may be one answered question that did not require escalation. This unit should include successful attempts, failed attempts, abandoned sessions, and retries.
Once the unit is defined, track three numbers together: cost per transaction, success rate, and cost per successful transaction. The third number is often the most honest. A system that costs two cents per answer but succeeds half the time costs four cents per useful answer, before counting human cleanup.
The main levers are size, shape, and certainty
Token economics improves when you control three things: how much text you send, what form it takes, and how confident the system must be before it answers. These are design choices, not merely billing choices.
Size is the most obvious lever. Shorter instructions, trimmed history, deduplicated documents, and concise tool results reduce input tokens. Output limits, structured formats, and direct answer styles reduce output tokens. But crude cutting can remove facts the model needs, so reductions should be tested against quality.
Shape is about making tokens easier for the model to use. A clean table, short bullet list, or well-labeled excerpt may outperform a large raw document. Certainty is about matching model effort to risk. A low-risk drafting task may use a smaller model and shorter context. A high-risk compliance answer may justify a larger model, richer retrieval, and human review.
- Route simple requests to smaller or cheaper models when quality remains acceptable.
- Retrieve only the passages that are likely to matter, rather than attaching whole documents.
- Summarize old conversation history, but keep exact source text for facts that must not drift.
- Cache repeated answers, embeddings, or tool results when the same work is likely to recur.
- Set output budgets that match the job, such as a short label, a paragraph, or a full report.
- Evaluate changes with real examples, because token savings that reduce accuracy can raise total cost.
Leaders should ask economic design questions
Token economics affects product strategy, procurement, architecture, and governance. A leader does not need to inspect every prompt, but should insist that teams can explain the economic unit they are optimizing and the quality level they are protecting.
The important decisions are practical. Should the application use one general model or route between several models? Should it answer from a small curated knowledge base or search a large enterprise corpus? Should it keep long conversation memory or summarize aggressively? Should it allow free-form answers or constrain output to a schema? Each decision changes cost, latency, reliability, and user trust.
Platforms such as Microsoft Foundry can help teams build, evaluate, and monitor artificial intelligence applications, while Microsoft Entra ID can help control access to users and data. Those tools do not remove the need for unit economics. They make it easier to observe the system and enforce the choices the organization has made.
- What is the cost per successful task, not just the cost per call?
- Which requests deserve the most capable model, and which do not?
- What information must be exact, and what can be summarized?
- How much quality loss, if any, is acceptable for a lower bill?
- Where should the system stop and ask a human rather than spend more tokens guessing?
Build a measurement loop
Token economics is not a one-time spreadsheet. Prompts change, user behavior changes, documents grow, models improve, and pricing changes. The system needs a measurement loop that connects observed cost to observed quality.
Start by logging the minimum useful facts for each transaction: model used, input tokens, output tokens, number of calls, latency, route taken, success signal, and failure reason. Protect sensitive data and follow retention policies; the goal is economic visibility, not hoarding user content.
Then run experiments. Compare prompt versions, retrieval settings, model routes, cache strategies, and output limits. Keep the change that lowers cost per successful task without harming safety, accuracy, or user experience. Over time, this turns token management from guesswork into engineering.
Key takeaways
- Tokens are the metered units of model reading and writing, but the real economic unit is the completed task.
- Input tokens include hidden context such as instructions, history, retrieved documents, and tool outputs.
- Cost per successful task is more useful than cost per token because it includes quality, retries, and failure.
- The strongest levers are model routing, focused retrieval, concise prompts, controlled output, caching, and evaluation.
- Cutting tokens blindly can increase total cost if it lowers accuracy or creates extra follow-up work.
- Token economics should be managed as an ongoing measurement loop, not a one-time optimization exercise.
Glossary
- Token
- A small piece of text, such as a word, part of a word, number, or punctuation mark, that a model reads or writes.
- Input tokens
- The tokens sent to a model, including user text, instructions, retrieved context, conversation history, and tool results.
- Output tokens
- The tokens generated by a model as its answer or intermediate output.
- Unit economics
- The measurement of cost and value for one meaningful unit of activity, such as one resolved case or one accepted suggestion.
- Context window
- The maximum amount of text a model can consider in a single request, usually measured in tokens.
- Model routing
- The practice of sending different requests to different models based on difficulty, risk, cost, or required quality.
- Retrieval
- The process of finding relevant information from a knowledge source and adding it to the model’s input.
- Caching
- The practice of storing reusable results so the system does not repeat the same model or tool work.