How Are Tokens Actually Counted? From Measurement Units to Cost Governance
Token usage is moving from API documentation and billing logs into everyday AI products, where it appears as quotas, subscriptions, and usage credits. This article explains what tokens are, why seemingly simple tasks can consume very different amounts, how to evaluate token plans, and how individuals and organizations can track, control, and optimize token costs.
“Stockpiling tokens” is becoming a new phenomenon as AI applications become more widely adopted. In the past, tokens mainly appeared in model API documentation, request logs, and technical bills. Today, as conversational assistants, intelligent office tools, content-generation services, and AI agents become part of everyday work, tokens are increasingly sold to consumers as packages, quotas, or membership benefits.
Tokens are not the same as traditional “requests,” nor can they be directly equated with the number of characters. A seemingly short question may consume far more tokens than expected because of context, conversation history, system instructions, tool calls, and model output. To determine whether a token package is worthwhile, the key is not simply how many tokens it advertises, but how usage is calculated, billed, and tracked.
1. What Exactly Is a Token?
Large language models do not process text directly as “words” or “characters.” They first split text into smaller units and then convert those units into numerical sequences that the model can process. These units are generally called tokens.
A Chinese character, a word, a punctuation mark, or a sequence of English characters may correspond to one or more tokens. The exact segmentation depends on the tokenizer used by the model, so there is no fixed conversion between characters and tokens.
Tokens are generally divided into two categories:
- Input tokens: The user’s prompt, conversation history, system instructions, text from uploaded documents, and other information passed to the model during task execution.
- Output tokens: The model’s response, summary, code, structured data, or other generated content.
The total usage for a single request can usually be represented as:
Total tokens = Input tokens + Output tokens
If an application includes multi-turn conversations, retrieval from a knowledge base, function calls, or agent loops, every request and response in every round must be counted. In other words, what appears to the user as one interaction may involve multiple model calls in the background.
2. Why Can the Same Question Consume Very Different Amounts?
The first major factor is context length.
A user may enter only one sentence, such as “Please revise this text.” However, the application may also send a role definition, writing requirements, conversation history, formatting constraints, and the original text to be revised. The model may therefore receive much more than the few words visible in the input box.
The second factor is output length. Asking a model to “answer briefly” is very different from asking it to “analyze the issue step by step, list risks, provide examples, and generate a complete plan.” Tasks involving code, reports, long documents, or multi-step reasoning may produce significantly more output tokens than input tokens.
The third factor is multi-turn conversation. Many applications resend previous messages with each new request to preserve context. As a conversation grows, each request may carry more historical content, causing input-token usage per call to increase over time.
The fourth factor is additional data. Uploaded documents, web pages, spreadsheets, image-recognition results, and retrieved knowledge snippets may be converted into text or other model-readable representations before processing. The user may click “Summarize” only once, while the system loads a large amount of content behind the scenes.
For this reason, token usage cannot be calculated from the text entered in the input box alone. It must be measured across the complete request chain.
3. The Difference Between Ordinary Chat and Agent Calls
A typical chat follows a simple pattern: the user asks a question and the model responds, either once or through a small number of turns. An AI agent, by contrast, may analyze the task, create a plan, call search, database, code-execution, or file-management tools, and then summarize the results.
A seemingly simple task may involve the following steps:
- The model interprets the user’s goal.
- The model breaks the task into multiple steps.
- An external tool is called to retrieve data.
- The tool’s response is submitted to the model again.
- The model adjusts its plan based on intermediate results.
- The model generates the final answer or execution result.
Each model call may generate both input and output tokens. Data returned by a tool may become part of the input for the next round. If the task includes retries, error correction, or repeated execution loops, total consumption can increase further.
This is one reason token demand has grown rapidly in recent years. AI applications are shifting from simply answering questions to continuously completing tasks, which increases both call frequency and context size.
4. How Should Tokens in a Usage Plan Be Understood?
When purchasing a token plan, consumers should look beyond the total quota and confirm the following points.
1. Are tokens charged directly or converted into feature-based units?
Some services display a token balance directly. Others convert tokens into generated responses, task counts, or membership benefits. The latter may be easier to understand, but it can provide less transparency. Users should know how many tokens correspond to one task and whether different features use different consumption rules.
2. Are input and output tokens counted separately?
Some billing systems combine input and output tokens, while others track them separately. If generated responses are long, charging output tokens separately can make actual consumption significantly higher than expected.
3. Do different models use different quotas?
An application may offer both lightweight models and more capable models. They may differ in task complexity, context length, and output quality, as well as in their consumption rules. Before purchasing a plan, users should confirm whether the quota is shared across models or limited to specific models or features.
4. Are there expiration dates or usage restrictions?
Token plans may be subject to expiration dates, concurrency limits, maximum input length per request, or maximum output length per request. A large quota does not necessarily mean unlimited usage. If the validity period is short, accumulating tokens over time may result in waste.
5. Can the balance be viewed and exported?
A reliable service should provide balance information, usage history, per-call details, or at least verifiable consumption records. Enterprise users should also be able to distinguish usage by application, department, user, or project.
5. How Enterprises Can Build a Token Cost Accounting System
Organizations should not treat tokens as an unexplained “AI miscellaneous expense.” They should establish a cost-management system similar to cloud resource billing.
First, standardize the recording of request metadata, including application name, business scenario, model type, request time, input tokens, output tokens, request status, and task ID. Logs should be anonymized where necessary to avoid writing user privacy data, credentials, or complete business content into ordinary log systems.
Next, establish cost attribution. Each request should be linked to at least one department, project, user, or business process. Otherwise, the organization may see only a total bill at the end of the month without knowing whether the cost came from customer-service conversations, document generation, or automated workflows.
Organizations should also distinguish normal budget consumption from abnormal usage. Routine question answering may have relatively stable usage, while a software defect could create an infinite loop and trigger thousands of repeated calls in a short period. Systems should implement rate limits, per-task caps, and anomaly alerts.
A simplified cost-estimation model can be expressed as:
Monthly token demand= Average daily task count× Average calls per task× Average tokens per call× Number of working or usage days× Growth factor
The growth factor accounts for business growth, retries, peak traffic, and changes in the proportion of complex tasks. Estimates should not rely only on an ideal average. It is better to calculate conservative, baseline, and peak scenarios.
6. Practical Ways to Reduce Token Waste
Compress the context
Not every historical message needs to be sent continuously. A system can periodically summarize older conversation history and retain only the information required for the current task. For long documents, it can retrieve relevant sections first instead of sending the complete document with every request.
Limit output length
When business requirements allow it, define the required output format, length, and fields. Asking the model to return a fixed set of structured fields is usually easier to control than allowing unrestricted output.
Choose an appropriate model
Simple classification, field extraction, and format conversion do not always require a highly capable model. Complex planning, long-text analysis, and multi-step reasoning may require a stronger model. Routing requests according to task difficulty is often more economical than using the same model for every request.
Reduce unnecessary retries
Applications should distinguish between network failures, business-logic failures, and model outputs that do not meet requirements. They should not automatically retry every type of error. Retry mechanisms need a maximum retry count and should record the reason for each retry.
Optimize agent workflows
An agent should not repeatedly plan when handling a simple task. Stable and repetitive steps can be implemented as program logic, while the model is reserved for tasks that genuinely require interpretation and judgment. This can reduce unnecessary looped calls.
7. How to Determine Whether a Token Bill Is Trustworthy
A verifiable token bill should answer at least four questions: When was the request made? Who initiated it? How many input and output tokens were used? How many credits or tokens were ultimately deducted?
Developers can add request IDs at the application layer and record estimated usage before a call and actual usage after the response. For batch jobs, they should also save the total task count, number of successful tasks, number of failed tasks, and retry count.
If the platform provides a usage API or detailed billing console, platform data should be compared regularly with application logs. When discrepancies appear, check for issues such as:
- System prompts being injected repeatedly;
- Conversation history not being truncated as expected;
- Tool responses being excessively long;
- Failed requests still generating charges;
- Multiple applications sharing the same account;
- Different reporting time windows being used.
Tokens become genuinely manageable only when there is an account at the platform level, an account in the application, and an account tied to the underlying business activity.
8. Both Consumers and Enterprises Should Avoid Blind Stockpiling
Tokens are different from physical goods. They do not represent a standardized inventory and cannot be used independently of a specific model, service policy, or expiration period. Before purchasing a quota, users should estimate their real usage: how many tasks they complete each month, the average length of each task, how often they upload materials, and whether they need an agent to execute tasks continuously.
For individual users, the key considerations are balance visibility, expiration dates, supported features, and refund or expiration policies. For enterprises, the priorities are access control, detailed usage records, budget limits, auditing capabilities, and data security.
The growing visibility of token consumption shows that AI is moving from an experimental tool to continuously running digital infrastructure. In the future, the most important question will not be who owns the most tokens, but who can complete the same tasks with lower costs, more consistent quality, and clearer accounting.
Token governance therefore requires more than calculating how many tokens were purchased. It must also determine how many were actually used, why they were used, whether the usage was worthwhile, and whether it can be verified as reasonable. Only with transparent measurement, accounting, and governance can tokens become a predictable and controllable technical resource rather than merely a marketing concept.
