Is trimming the prompt usually the biggest cost lever on a chat endpoint?
No — output tokens are priced several times higher and generated one at a time, so capping and structuring output usually beats trimming the prompt as a cost lever.
Imagine a printer where loading paper is cheap but the ink for each printed line is expensive, and the printer prints one slow line at a time. If your bill is high, buying slightly less paper barely helps — using less ink is what moves it. An LLM is similar. The words you feed in are the cheap paper. The words it prints back are the expensive ink, and they come out one at a time, so they also make you wait. To cut cost and waiting, the smart move is to make the answer shorter and tighter, not to shave a few words off the question you asked.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
"Our LLM bill is too high — where do we cut?" The instinctive answer points at the prompt, because the prompt is the part engineers wrote and can see growing: system instructions, few-shot examples, retrieved context. It feels like the obvious fat to trim. On most chat endpoints that instinct sends you to optimize the cheaper side first.
The correction hinges on one fact that's easy to overlook: input and output tokens are not priced the same. Output is the premium resource, usually several times the input rate, and it's also the part that's generated slowly and sequentially. Those two facts compound, so output ends up driving both the invoice and the latency a user feels.
This walkthrough makes the price asymmetry concrete, shows with numbers how output can dominate the bill on fewer tokens, explains why the same side also dominates latency, and then ranks the real-world levers — including the case where prompt-side work does win, and why even then the right tool is caching rather than trimming.
Why output is the premium resource
Token-billed APIs publish two prices, and the output price is consistently the larger one. Across 2026 frontier models the output rate typically runs three to five times the input rate. The reason traces back to serving economics: generating output is the sequential, memory bandwidth bound decode phase that ties up a GPU one token at a time, whereas reading the prompt is a single parallel prefill pass that uses the hardware efficiently. Providers price the scarcer, slower work higher.
Write the cost as two terms and the consequence is immediate:
The multiplier on p_out means the output term carries far more cost per token than the input term. So token count alone is a misleading proxy for cost. A request can have a comfortably larger prompt than answer and still spend the majority of its money on the answer, simply because each answer token is worth several prompt tokens at the register.
This is the crux the question tests. Someone who reasons from token counts assumes the prompt is the cost. Someone who reasons from the rate card knows the output is, until proven otherwise by an unusually prompt-heavy workload.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
| Lever | Side it targets | Why it's higher or lower leverage |
|---|---|---|
| Cap max_tokens / structured output | Output | Hits the priced-higher, latency-driving side directly |
| Prompt caching | Input (reused prefix) | Discounts repeated input on RAG/agent workloads |
| Naive prompt trimming | Input | Cheapest side per token; usually the smaller saving |
Real products, models, and research that use this idea.
- OpenAI and Anthropic both list output token prices several times higher than input on their pricing pages.
- Structured outputs / JSON mode on OpenAI and tool use on Claude let apps cap output to compact fields instead of prose.
What an interviewer would ask next. Try answering before peeking at the approach.
QWhen does the input term actually dominate the bill?
Look at the prompt to output ratio: huge reused prefixes in RAG or agents can make input the larger term.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Assuming the prompt is the cost because it has more tokens — output is priced several times higher per token, so it usually dominates the bill on fewer tokens.
60 second bullets to scan on the way to the call.
Why output tokens are priced higher than input on typical rate cards
How the price asymmetry flips which side dominates the bill
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.