TechCompare LogoTechCompare

How to reduce token usage: practical prompt optimization that saves money

Start by removing repeated instructions and examples that don't help the answer. Then measure input and output charges separately. A provider's prompt cache can discount eligible reused input, but a cache hit and the provider's current rates determine the savings.

Prompt optimization aims to get the same or better results with fewer input tokens. A 30% reduction in input tokens cuts the input charge by 30% at the same rate, but it doesn't reduce output-token charges. The total bill falls by a different amount depending on the request's input and output costs.

By TechCompare · Updated

Knowledge area
Best Practices
Practical token optimization advice
Topic focus
Prompt optimization
prompt-optimization

How this is calculated

Remove truly repeated text and shorten examples that don't change the result. System or developer messages can organize persistent instructions, but moving text there doesn't remove its tokens from the request. Supported prompt caching may lower the price of eligible repeated input after a cache hit. For structured output, use the model's native JSON mode or structured output feature rather than lengthy formatting instructions. For multi-turn conversations, trim history only when earlier context isn't needed.

Verdict

A 30% reduction in input tokens cuts the input charge by 30%, not necessarily the total request bill, since output tokens are charged separately. Moving instructions to a system prompt doesn't by itself remove tokens. Removing duplicated text can lower the input count, and a supported cache may discount an eligible repeated prefix after a hit. Keep instructions clear, use structured output when it fits, and trim only history that the task no longer needs.

More Tokens scenarios

What are tokens
A token is the atomic unit of text that a language model processes.
View details ➜
OpenAI vs Llama tokenizer
A sentence that costs 50 tokens on GPT-5 might cost 55 tokens on Llama 4 or 48 on Claude.
View details ➜
Token limits by model
A model context limit is a token budget, but providers may publish separate input and output limits.
View details ➜

Frequently asked questions

Does prompt length actually affect my API bill?
Yes. Shorter input reduces the input-token charge at the same rate. A 30% shorter input means 30% less input cost, but the total request bill also includes output tokens and their separate rate.
How do I cut tokens without losing output quality?
Remove duplicated instructions and examples that aren't needed, and use native structured output when it fits. Putting instructions in a system prompt can organize the request, but doesn't reduce the token count by itself. In multi-turn chats, remove history only when the model no longer needs it.
What is prompt caching and how much does it save?
Some APIs can reuse eligible repeated input prefixes and charge a lower rate for cached input tokens after a cache hit. The discount and minimum prefix depend on the provider and model. Cached tokens still count as input, and moving text to a system prompt alone doesn't guarantee a cache hit.