Measuring and trimming the hidden weight inside each request

Developers moving to a new model generation often notice the same thing within days: prompts that used to fit comfortably now fill the context window much sooner, and the bill or plan allowance drains faster. Some measure it with real project files and find a clear jump. Others notice that every session starts with thousands of tokens already spent before they type anything.
This guide is for people who pay per token or work under a plan cap and want to understand where the weight comes from. You will learn the usual sources of token inflation, how to measure them with a few lines of code, which reductions are safe, and when the extra tokens are actually buying better results. Brand details stay general; for current numbers always check Anthropic's own documentation.
Frequently asked questions
What is a token in this context?
A token is the unit a model reads and writes, usually a word piece of a few characters. Prices, context windows and rate limits are all counted in tokens, so the same text can cost different amounts on models with different tokenizers.
How does a tokenizer change affect cost?
If a new model splits text into more pieces, the same document counts as more tokens. Code, non-English text and unusual symbols are where differences tend to show up most. The price per token may be unchanged while the cost per document rises.
What are tool schemas and why do they cost tokens?
Agent tools describe each available tool to the model as structured text: name, purpose and parameters. Those descriptions are sent with every request. A setup with many connected tools can spend thousands of tokens per call on descriptions of tools you never use.
Does asking for shorter answers really help?
Yes, for output cost and latency. Instructions to skip pleasantries, avoid restating the question and return only the changed code reduce output noticeably. For long sessions, though, input usually dominates, so trimming context matters more.
Which is better: a bigger context window or a smaller prompt?
A smaller prompt, almost always. A large window is a safety margin, not a target. Models also tend to pay less attention to material buried in the middle of a very long context, so relevance beats volume.
Does the free endpoint report token counts?
Yes. Responses from /v1/chat/completions include a usage object with prompt and completion tokens, the same shape as other OpenAI-compatible APIs. Note that free-ai uses its own tokenizer, so counts will not match Claude's exactly.
Can I count Claude tokens before sending a request?
Anthropic's API has offered a token counting facility; check their current documentation for how it works and what it costs. For rough planning, measuring real responses during a prototype is often enough.
Are reasoning tokens counted against the budget?
Generally yes. Thinking produced before the visible answer is billed as output on models that support it. That is why reasoning modes should be switched on per task rather than everywhere.
The symptom: same work, bigger numbers
The pattern is easy to recognise. A developer keeps the same project instructions, the same repository and the same kind of tasks, upgrades to a newer model and sees context fill up noticeably faster. Measurements shared by people testing with ordinary developer inputs, such as instruction files, git history and source code, point in the same direction: more tokens for the same material.
None of this means the new model is worse. It may well produce better results. But it changes the economics, and builders who planned a budget around the previous model need to remeasure instead of assuming last month's numbers still hold.
Why measurement beats intuition
Token use is invisible in a chat window. Logging the usage field of real responses for a week turns a vague feeling into a chart you can act on.
Look at medians, not single calls
One enormous request skews impressions. Compare the typical cost of each feature before and after a change.
Four sources of token inflation
Most growth comes from a short list of causes, and they stack. Fixing the biggest one usually takes an afternoon, while ignoring them can double the cost of a project without anyone deciding it should.
Tokenizer differences
A new generation may encode text differently. Code with lots of punctuation and text in languages other than English are typical places where counts shift.
Startup context
System prompts, instruction files, memory features and tool descriptions are loaded before you type. In agent tools this can reach many thousands of tokens per session.
Verbose output
Models tuned to be helpful often open with a friendly preamble, restate the request and close with a summary. Pleasant to read once, expensive across thousands of calls.
Reasoning overhead
Extended thinking adds output tokens before the answer. It helps on hard problems, as discussed in our piece on extended thinking, and wastes budget on easy ones.

Measuring where the tokens go
The simplest instrument is a wrapper that records the usage of every call along with a feature label. Prototype against any OpenAI-compatible endpoint, and you get the same numbers your production code will rely on later. Below, the free endpoint on this site is used because it needs no key; the pattern is identical for paid providers.
Run the same set of saved prompts through the wrapper whenever you change a model, a system prompt or a tool setup. If the totals move, you know exactly which change did it.
Label by feature
Totals per feature show which part of the product drives cost. Often one feature with a long prompt accounts for most of the spend.
import csv, time
from openai import OpenAI
client = OpenAI(base_url='https://api.anthropicapifreekey.com/v1', api_key='unused')
def call(feature: str, messages: list, **kw) -> str:
t0 = time.time()
r = client.chat.completions.create(model='free-ai', messages=messages, **kw)
with open('token_log.csv', 'a', newline='') as f:
csv.writer(f).writerow([
feature, r.usage.prompt_tokens, r.usage.completion_tokens,
round(time.time() - t0, 2),
])
return r.choices[0].message.content
system = {'role': 'system', 'content': 'Answer in at most three sentences.'}
print(call('faq', [system, {'role': 'user', 'content': 'What is a webhook?'}]))Trimming startup context safely
Agent tools load a lot before the first message: built-in tool definitions, connected servers, instruction files and sometimes memory. A common discovery is that disabling integrations you do not use, such as a browser controller or rich document features in a terminal-only workflow, removes a surprising amount of startup weight from every session.
The same principle applies to your own apps. Every tool you describe to the model costs tokens on every call, whether or not the model uses it. Load only the tools relevant to the current step, and keep descriptions short and concrete.
- Disable integrations and connected servers you are not using
- Keep project instruction files focused on rules, not history
- Move long reference material into files the agent reads on demand
- Shorten tool descriptions to one clear sentence each
- Remove example conversations from system prompts once behaviour is stable

Cutting verbosity without losing quality
Style instructions are cheap and effective. Asking for terse replies, no preamble and no closing summary can remove a large share of output in conversational tools. Community-made skills and prompt snippets that push a model toward clipped, minimal answers exist precisely because verbosity adds up.
There is a limit, though. Pushing a model to be extremely terse can make it skip explanations you actually needed, or compress code comments into nothing. The goal is to remove filler, not reasoning. Test style instructions on tasks where you know what a good answer looks like before rolling them out.
Ask for the delta
For code, request a diff or only the changed function. Regenerating a whole file to change three lines is one of the most common sources of waste.
Set max_tokens deliberately
A ceiling on output stops runaway answers and makes costs predictable. Choose a value per feature instead of one large default everywhere.
Keeping history under control
In multi-turn work, the history is resent with each request, so cost grows with the length of the thread. Summarising older turns into a short recap, dropping tool output that is no longer relevant, and starting fresh threads for new tasks keep the input from ballooning.
Stateless APIs make this explicit, which is helpful. The free endpoint on this site keeps no conversation state at all; you decide exactly what goes into each request. That discipline carries over directly when the same code later points at a paid provider. The handoff techniques in our guide to carrying context between models apply here too.
Rolling summary
After every few turns, ask the model to compress the conversation into key decisions and open questions, then continue with that summary instead of the full transcript.
Prune tool output
Command output and file listings are useful for one step and dead weight afterwards. Replace them with a one-line note once they have served their purpose.

When the extra tokens are worth it
Not every increase is waste. A model that reads more of the codebase before editing may break fewer things. Longer reasoning can be the difference between a correct migration and a subtle bug. If a newer model costs more per task but needs fewer retries, the total may still be lower.
The honest comparison is cost per successful task, not cost per request. Track how often each setup needs a second attempt or manual correction. Commercial frontier models often justify their higher token use on hard problems; on simple, repetitive ones they rarely do.
Count retries in the cost
A cheap call that fails half the time costs more than an expensive one that succeeds first time, once you add the second attempt and your own review. Log success or failure next to the token count so the comparison is fair.
Separate easy and hard tasks
Split your saved prompts into routine and difficult groups. Very often the new model costs more on both but only wins clearly on the difficult group, which tells you where to keep it and where to route elsewhere.
Prototype cheaply, then measure on the real model
A sensible order is to iterate on prompt structure and features using a free backend, then rerun the saved prompts on Claude once the design settles. The free endpoint here serves free-ai, an independent open-weight model of about 35B parameters; the site is not affiliated with Anthropic and the model is not Claude, so expect different token counts and lower quality on hard tasks.
What carries over is the shape of the work: how many calls a feature makes, how long its prompts are and how much history it keeps. Those structural numbers are what drive cost on any provider, and getting them right early is far cheaper than discovering them on a production invoice.
When you finally rerun the prompt set on Claude, compare three figures side by side: tokens in, tokens out and the share of answers you would accept without edits. That small table answers the question this article started with far better than any forum thread, because it reflects your own files, your own instructions and your own definition of a good result.
Context limits to design around
free-ai accepts up to 32,000 tokens of context and answers of up to 16,000. Designing within that ceiling tends to produce lean prompts that are also cheap elsewhere.

Send a prototype prompt from the chat box on the home page: no key, no account and no card needed, just the usual per-IP limits.
Read also
- How Should an AI Agent Handle API Rate Limits and Request Errors?
- Claude Code vs Open-Source Coding Agents: Which Fits Your Project?
- How to Keep Your App Working When the Claude API Has an Outage
- Are Cheap Claude API Resellers and Shared Accounts Safe to Use?
- Why Do Claude Usage Limits Seem to Run Out Faster Lately?