TechCompare LogoTechCompare

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

Prompt optimization is the fastest way to cut LLM costs. Start by removing politeness language and moving instructions to the system prompt. Then enable prompt caching. These two changes alone typically reduce costs by 30% or more.

Prompt optimization is the practice of getting the same or better results from an LLM with fewer input tokens. Since most API pricing charges per input token, trimming your prompts directly reduces your bill. A 30% reduction in token usage means a 30% reduction in cost, with no change to the model or provider.

By TechCompare · Updated

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

How this is calculated

Effective optimization techniques: remove politeness padding ('please', 'could you', 'I would like you to'), which can add 10-15% to token counts. Use system prompts for persistent instructions rather than repeating them in every user message. Compress few-shot examples to the minimum that demonstrates the pattern. Use the prompt cache feature (available on OpenAI, Anthropic, and DeepSeek) for static content like system prompts and few-shot examples, where cached tokens cost 50-90% less. For structured output, use the model's native JSON mode or structured output feature rather than lengthy formatting instructions in the prompt. For multi-turn conversations, prune conversation history aggressively.

Verdict

A 30% token reduction maps directly to a 30% bill reduction with no model or provider change. Politeness padding like 'please' and 'could you' quietly adds 10-15% to counts, and moving persistent instructions to the system prompt (which can be cached) compounds the savings. Structured output via JSON mode beats long formatting prompts, and aggressive history pruning in multi-turn chats trims dead weight.

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
Context window size is the maximum number of tokens a model can process in a single request, including both input and output.
View details ➜

Frequently asked questions

Does prompt length actually affect my API bill?
One-to-one. API pricing charges per input token, so a 30% shorter prompt is a 30% cheaper request with the same model and quality. Politeness padding alone (please, could you, I would like you to) commonly adds 10-15% to token counts, and it buys you nothing from the model.
How do I cut tokens without losing output quality?
Move persistent instructions into the system prompt instead of repeating them per message, compress few-shot examples to the smallest set that demonstrates the pattern, and use native JSON mode or structured output rather than prose format instructions. In multi-turn chats, prune history aggressively - models rarely need more than the last 5-10 exchanges.
What is prompt caching and how much does it save?
Prompt caching lets OpenAI, Anthropic, and DeepSeek store the tokenized prefix of your prompt (system prompt, long examples, shared documents) so repeat requests don't re-process it. Cached input tokens bill at 50-90% off. Any static content that every request shares should live in the cached prefix, not the varying user message.