onema
AI solutions
MVP
Web development
Mobile apps
UX/UI design
Branding
Find out your project cost
office@onema.ru
Questions and suggestions
Get a cost estimate

What are tokens in LLMs, and what are you really paying for?

Tokens are the unit in which a model reads and writes text and in which the provider bills you. How the cost is calculated and how architecture reduces it.
Sergey A.
COO at onema
What are tokens in LLMs, and what are you really paying for? — illustration for the onema article
A token is the unit a language model splits text into: part of a word, a word or a character. The model reads the request and writes the response in tokens, and cloud providers bill for the work in tokens too: you pay for input and output tokens, at a single price for some models and with output costing more for others. That's why tokens are both the technology and the economics of an AI product.

How text turns into money


Every call to a cloud model means request tokens plus response tokens. The request includes not only the user's question but also instructions, the conversation history and any retrieved documents, if you're running RAG. All of this has to fit into the context window: as of November 2026, OpenAI's flagship gpt-6.2-astra accepts up to 272k tokens, and every model has its own limit.

Three details that affect the bill the most:
  • Output can cost more than input. With OpenAI gpt-6.2-astra, 1M input tokens cost $8 and 1M output tokens $40, five times more. Anthropic Claude Fable 5.2 and Google gemini-4-carbon keep the same 1:5 ratio, while Mistral's small Ministral 3 3B charges a single price per token (list prices as of November 2026).
  • Reasoning tokens. Reasoning models “think” in hidden tokens before answering. You don't see them, but they take up context and are billed as output tokens, so a short answer can cost as much as a long one.
  • Caching. The provider can cache a repeated request prefix: with OpenAI, cached input is up to 90% cheaper, and it works automatically. That's why it pays to put the unchanging part of the request at the beginning.

Illustrative calculation


A typical assistant response: instructions — 1,000 tokens, conversation history — 2,000, question — 100, answer — 300. On gpt-6.2-astra, that's 3,100 input × $8 + 300 output × $40 per million ≈ $0.037 per response. 10,000 such responses a day come to about $370 a day, roughly $11,000 a month. On Ministral 3 3B ($0.10 per 1M tokens), the same volume would cost around $100 a month. The figures are illustrative: list prices as of November 2026, excluding VAT or sales tax.

The budget implication: the bill grows with traffic and context length. A naive assistant, where every question goes to the model with the full history, gets more expensive the more successful it becomes.

How architecture cuts the bill


Handle typical requests without generation, using scenarios and caching. Pass context selectively rather than “the whole conversation”. Use expensive models only where needed (see our insight on the three levels of AI assistant). The radical option is a local model: no per-token fees, but you pay for hardware and support.

Where to start


If your AI bill is already hurting, start by auditing how requests are routed: what share of them actually needs the model. That's usually where the main savings are, not in switching to a cheaper model.

A real-world example

This is how Sigma.AI, the assistant for a grocery marketplace, is built. Typical scenarios are handled by deterministic logic (up to 6 seconds), popular recipes come from the cache (about 4 seconds), and neither uses a single token. Non-typical requests are handled by its own local model: there is no per-message fee, just a dedicated 4 CPU / 8 GB server. Gemini and OpenAI are connected only for specific scenarios via orchestration in n8n, and only there is the bill counted in tokens. More details in the Sigma.AI case study.
How much will your assistant cost to run?
Describe your task in the estimate form — we'll work out the architecture and token budget before development starts. Our approach is on our AI development page, and a live example is in the Sigma.AI case study.

FAQs

Cost calculation
Tell us where your product has hit a wall, in the estimate form
After the audit, we'll tell you what to migrate, what to keep and how much it costs
More articles