Token pricing charges for the units of text or other content an AI model processes and generates. Input tokens, output tokens, and cached input can have different rates. This token pricing explained guide shows how those charges work and how to turn usage records into a cost estimate.
Token pricing explained: what counts as a token?
A token is a unit a model uses to represent content. For text, it can be a word, part of a word, punctuation, or a space combined with nearby characters. Tokens are not a fixed number of words.
OpenAI’s token-counting guide shows that different encodings can split the same text differently. Use the tokenizer for the selected model when estimating text usage, then reconcile the estimate with the provider’s reported usage.
For SaaS teams, tokens are a form of metered usage. They measure model consumption, but they do not automatically define what customers should pay for your product.
How input, output, and cached tokens are priced
Input tokens: the context sent to the model
Input tokens cover the content the model processes for a request. That can include instructions, the user’s question, conversation history, retrieved documents, and tool definitions. Counting only the words typed into a chat box can miss much of the input.
A longer conversation can send more context on later turns. Track the provider’s usage fields for each request instead of assuming that every turn has the same cost.
Output tokens: the generated response
Output tokens are generated by the model. Their rate can differ from the input rate, so two requests with similar prompts may cost different amounts when one produces a longer answer. Check the selected model’s billing rules for any reasoning tokens or other billed output.
A concise output format helps control response length. Set an output limit where the API supports it, but test whether that limit still allows the model to finish the task.
Cached input: reuse has its own conditions
Prompt caching reuses previously processed context when an eligible prefix matches an available cache entry. On supported models, a cache hit can use a lower cached-input rate. A repeated topic or similar wording is not enough to guarantee a hit.

OpenAI’s prompt-caching documentation describes matching-prefix, minimum-length, routing, and retention requirements. It also distinguishes cache reads from cache writes. For models with a separate cache-write rate, count that category separately; do not charge the same tokens again as ordinary uncached input.
How to calculate token costs
Start with the rate card for the exact model, service tier, and context length. Confirm whether prices are quoted per token, per thousand tokens, or per million tokens. A low advertised rate is useful only when it applies to the workload you plan to run.
For rates quoted per million tokens, the calculation is: token cost = sum of (tokens in each billing category ÷ 1,000,000 × that category’s rate). Use mutually exclusive input categories: uncached input, cached input, and cache writes where applicable. Add output at its own rate.
A support-summary example
Suppose a SaaS support tool summarizes tickets using a shared instruction prefix. The following invented usage record and rates illustrate the calculation; they are not a provider quote, customer result, or benchmark.
| Billing category | Illustrative tokens | Illustrative USD rate per million |
|---|---|---|
| Uncached input | 80,000 | $2.00 |
| Cached input | 20,000 | $0.50 |
| Output | 10,000 | $8.00 |
Apply the formula to each row and add the results. This example assumes no separately priced cache-write tokens, no context-length surcharge, and no tool or storage charges. If any apply, add them using their own billing units. Without a reported cache hit, move that input into the uncached category.
For production forecasts, sample representative tasks and keep the distribution of costs, not just an average. A short summary, a long document, and a conversation with repeated tool calls can have different consumption patterns. Estimate monthly spend from the expected task mix.
Keep provider cost separate from customer pricing
A provider’s token bill is one cost of delivering an AI feature. Your customer-facing usage-based pricing might charge by document, completed workflow, API request, or another unit that customers understand. A subscription can also include an allowance with usage charges above it.
Choose a unit that customers can track and that you can measure consistently. If you sell credits, explain what consumes them and when the balance changes. Avoid implying that a credit always equals one provider token unless your offer actually defines that relationship.
Keep usage events, your customer price rules, and provider costs traceable. Record request identifiers, the model, billable categories, and the rate version used. Handle retries and duplicate events deliberately so that a repeated technical request does not become an unintended customer charge.
Tridens Monetization supports recurring, usage-based, and hybrid charges, with configurable rating and API-first integration. For an AI service, evaluate how your usage events map to the supported rating and billing workflow. Do not assume a ready-made connector for every model provider.
What to check before choosing a model
- Match the rate card to the exact model and processing mode.
- Separate uncached input, cache reads, cache writes, and output.
- Check context-length rules and any separately billed tools or storage.
- Measure cache hits from usage records instead of assuming a discount.
- Compare cost per successful task alongside quality and latency.
- Version rate changes and reconcile estimated usage with provider bills.
OpenAI’s API rate card lists model, processing-mode, context-length, and tool charges separately. Use the relevant provider’s current documentation before making a buying decision.
FAQ about token pricing explained
What is the difference between input and output tokens?
Input tokens are the content a model processes for a request, including instructions and context. Output tokens are generated by the model. They can have different rates, so count and price them separately.
Does prompt caching always reduce token costs?
No. Reuse depends on the provider’s matching, minimum-length, routing, and retention rules. A reported cache hit can use a lower cached-input rate, while some models also have a separate cache-write rate. Use actual usage records and the applicable rate card.
Should SaaS customers be billed directly for tokens?
Only when tokens are a useful, understandable unit for the offer. Customer pricing can instead use documents, workflows, API requests, or a subscription with usage charges. Keep the chosen unit measurable and its charging rules clear.
Ready to get started?
Connect measured AI service usage to configurable pricing and billing workflows with Tridens Monetization.
