AI tokens: understanding and optimizing their cost
A token is the small piece of text (often part of a word) that AI models read and write, and it is the unit APIs bill you for. To lower the bill, you work on three things: what you send to the model, what you ask it to write, and which model you pick.
This article is for HR, training and operations managers, and for startup founders who are starting to connect ChatGPT, Claude or Gemini to their tools, or who just received a first API bill that was higher than expected. It explains where tokens come from, how to estimate a monthly budget before launching a project, and which levers actually bring the cost down without hurting answer quality. For the basics of writing instructions, the prompt engineering guide for SMEs is the place to start.
What is a token, in practice?
A token is a unit used to split text: not a letter, not a word, but a fragment whose size depends on the model and the language. A long word like "invoicing" may be split into two or three tokens, while a short, common word like "the" counts as one. Punctuation, spaces, numbers and formatting tags also use tokens.
A few rough figures, to be read as estimates rather than rules:
- in English, you often get around 4 characters per token, or about 750 words per 1,000 tokens;
- in French and several other European languages, words are split into slightly more pieces on average, so the same 1,000 tokens hold fewer words;
- a table, code or a JSON file uses more tokens than prose of the same length, because of symbols and indentation.
How text gets split depends on each large language model's (LLM) own "tokenizer". Anthropic, for instance, states in its pricing documentation that its most recent models use a new tokenizer that produces roughly 30% more tokens for the same text. The practical consequence: comparing two models on their price per million tokens is not enough. You need to count the tokens actually used on your own texts. The AI token glossary entry gives the full definition.
Subscription or API: where tokens show up on the bill
With a ChatGPT, Claude or Gemini subscription, you pay a flat price per user and tokens turn into usage limits; with the API, every token sent or generated is billed. That difference changes how you manage the budget.
| Per-user subscription | Pay-as-you-go API |
|---|
| Billing unit | Seat, per person per month | Million tokens, input and output priced separately |
| Who uses it | Employees, in the web interface or app | Your tools: chatbot, workflow, CRM, script |
| What tokens mean | Quotas: beyond them, the tool slows down or stops | A direct cost line |
| Predictability | High | Variable, depending on volume and design |
| Main risk | Paying for underused licences | A badly designed loop that consumes without limit |
For a team that writes, summarizes and analyzes every day, a subscription is the simplest option. Tokens become a real topic as soon as you connect a model to a business tool through an API: a chatbot on your website, an n8n workflow that sorts emails, an internal assistant plugged into your documents. For an overview of spending lines, see our article on how much AI costs an SME in 2026.
Four sources of tokens people forget
The user's question is often a small share of the tokens billed: most of them come from everything sent back to the model on each call. A model has no memory from one call to the next. With each message, the application resends the whole context.
- The system prompt. Role, tone and format instructions, sometimes with examples, go out with every request. A 3,000 token system prompt multiplied by 10,000 requests means 30 million input tokens a month before the first question is even asked. Our article on system prompts and user prompts covers what belongs there and what to leave out.
- Conversation history. In a ten-message exchange, the tenth call resends the previous nine. The cost of a conversation therefore grows faster than the number of messages.
- Injected documents. In a RAG assistant, the document excerpts retrieved are added to the prompt. Too many excerpts, or excerpts that are too long, and the bill rises with no gain in quality.
- Output and reasoning tokens. Generated text costs more than text that is read. At Anthropic, an output token costs five times as much as an input token on current models, according to its published price list. Models that "think" before answering also produce reasoning tokens, which are billed too.
How to estimate a project's cost before launching it
The method fits in one line: input tokens times the input price, plus output tokens times the output price, all multiplied by the number of calls over the period. The hard part is estimating volumes honestly.
Here is a worked example with made-up prices chosen for readability: €3 per million input tokens and €15 per million output tokens, which matches the usual one-to-five ratio between input and output. Replace these figures with the price list of the model you are considering.
An SME adds an assistant to its website to answer questions about its catalogue. Assumptions:
- 2,000 conversations a month, 5 exchanges on average, so 10,000 calls;
- per call: 4,000 fixed tokens (system prompt and catalogue sheet), 2,000 tokens of history and question on average, 400 tokens of answer.
Calculation:
- input: 10,000 × 6,000 = 60 million tokens, or €180;
- output: 10,000 × 400 = 4 million tokens, or €60;
- total: about €240 a month.
Two remarks. First, input weighs three times as much as output here, even though its unit price is five times lower. That is true of most conversational assistants, so that is where to look for savings. Second, this figure says nothing about the rest of the budget: design, maintenance, monitoring of answers. Our article on SME AI budgets helps put this line in context.
Before committing, measure on a real sample. Provider consoles show usage, and APIs return the number of tokens used in each response. One week of testing on 200 conversations beats any theoretical estimate.
Seven levers to cut the bill
The biggest savings rarely come from rewording prompts word by word; they come from model choice, caching and what you stop sending. Here are the levers, ranked from most to least profitable for an SME.
1. Pick the right model for each task
Sorting emails, extracting an amount from an invoice or classifying a ticket does not need the most powerful model. At Anthropic, the smallest model of the current generation costs up to 20 times less for input than the mid-tier model, according to its price list. A common setup is to give sorting to the small model and only call the large one for complex cases. To compare model families, see our ChatGPT, Claude and Gemini comparison.
2. Cache the fixed part of the prompt
Prompt caching means telling the provider that part of the prompt (instructions, catalogue, documentation) repeats from one call to the next. At Anthropic, reading cached content is billed at 10% of the normal input price on most models, versus 125% for writing it the first time into a 5-minute cache. Other providers use comparable mechanisms, sometimes applied automatically.
In our example, the 4,000 fixed tokens add up to 40 million tokens a month, or €120. Once cached, they cost around €12 when the cache is reused, plus the extra cost of writes. The total bill drops from about €240 to €130 or €150 depending on how often the cache is reused. One limit to keep in mind: caches expire. If your visitors trickle in, with more than five minutes between requests, the gain shrinks.
3. Batch whatever is not urgent
Overnight reports, classifying a backlog of tickets or generating product sheets do not need an answer in two seconds. Batch APIs run these requests asynchronously, with a 50% discount on input and output at Anthropic. OpenAI offers a comparable option. The trade-off: results may arrive several hours later.
4. Limit the history you resend
After a few exchanges, resending the whole conversation gets expensive and does not always help the model. Two simple techniques: keep only the latest messages, or replace older exchanges with a short summary. The context window, meaning the maximum amount of text a model can process at once, sets the upper limit; your budget usually sets a much lower one.
5. Send fewer documents, but the right ones
In a document assistant, going from ten to four injected excerpts cuts the document share of input tokens by 60%. Quality does not necessarily drop: poorly targeted excerpts actually raise the risk of made-up answers, as we explain in our article on AI hallucinations. To choose between injecting documents and instructions alone, read RAG vs prompting: which to choose. And for large reports or contracts, splitting them and summarizing section by section keeps each call small: the method is covered in our prompts for summarizing long documents.
Since output costs more, asking for "three sentences maximum" or "return only the JSON, no commentary" has a direct effect. Also set the maximum response length parameter in the API: it acts as a safety net if a prompt goes off track. The principles of structuring an instruction are covered in the anatomy of a good prompt.
7. Trim prompts without weakening them
Removing pleasantries, repetition and redundant examples saves a few hundred tokens per call. That matters at high volume, much less otherwise. Be careful not to remove the examples that drive quality: three well-chosen examples beat ten, as our article on few-shot prompting shows.
Monitoring usage over time
A project sized correctly at launch can drift within a few weeks: new uses, prompts that grow longer, a loop that repeats. Three habits are enough for most SMEs.
- Caps and alerts. The main providers' consoles let you set spending limits and alerts. Set them on day one, including during testing.
- One API key per project. With a key per use case (chatbot, accounting workflow, HR assistant), you can see at once which project uses what.
- A simple monthly review. Total cost, number of calls, average cost per call. If cost per call rises while usage stays flat, look at history or injected documents.
The most expensive scenario is not an overly long prompt, it is a poorly closed automation: a workflow that calls the model again on every error, or an agent that calls itself with no step limit. A spending cap keeps an unsupervised weekend from turning into a four-figure bill.
What token optimization does not solve
Lowering the cost per token only makes sense if the answer stays useful: a cheaper assistant that gets things wrong more often costs more in correction time. On many SME projects, the API bill weighs less than the time spent designing, testing and supervising the tool. Before chasing the last euro, check where the money actually goes.
Two points to watch. Confidentiality first: switching to a cheaper provider without checking how it processes your data is not a saving. Quality second: every change of model or prompt should be tested on a set of real questions before going live. Keep around twenty typical questions with their expected answers, and replay them after each change.
Frequently asked questions
How many words is a token?
In English, 1,000 tokens are roughly 750 words. Other languages, French included, usually fit fewer words into the same number of tokens, and the ratio varies by model and type of text. The only reliable figure is the one you measure on your own content.
Why do output tokens cost more?
The model reads the input in one pass, but it produces the output token by token, each new token requiring a full computation. Price lists reflect that gap, with a one-to-five ratio at Anthropic on current models. The technical term for this computation phase is inference.
Do tokens count with a ChatGPT or Claude subscription?
Yes, but indirectly. They are not billed per unit; they determine usage limits. A very long conversation or a large document reaches those limits faster.
Does prompt caching reduce answer quality?
No. The model receives exactly the same content; only the computation already done on the fixed part is reused. The cached content must, however, stay strictly identical from one call to the next and sit at the start of the prompt.
Is a self-hosted open source model cheaper?
Not necessarily. You no longer pay per token, but you pay for GPU servers, their maintenance and the skills to run them. For an SME with moderate volumes, the API is often cheaper. The calculation is worth redoing if your volumes become very large.
How can I know how many tokens a text uses before sending it?
Providers offer counting tools, either as a web interface or a dedicated API function. API responses also report the input and output tokens used, which is enough for regular monitoring.
How GrowthPerf can help
Controlling token costs is mostly about designing a lean assistant or workflow from the start, and that is a skill you can learn. GrowthPerf, a Qualiopi-certified training provider, trains teams in SMEs, startups and nonprofits to build AI uses that hold up, both technically and financially.
The Operational AI course covers prompt design, model choice and integrating AI into no-code tools such as n8n or Make. If your team works with Claude, the Claude Team course covers project setup and good usage practices. Depending on your situation, these courses may be funded by your OPCO (French skills funding body).
For the full set of prompting techniques, go back to the complete prompt engineering guide for SMEs.
Is your API bill growing faster than your usage, or do you want to cost a project before launching it? Book a free 30-minute audit of your API costs: we review your prompts, models and volumes, then identify with you the most profitable levers.