cd /news/large-language-models/the-hidden-math-how-your-prompt-desi… · home topics large-language-models article
[ARTICLE · art-66690] src=blog.devgenius.io ↗ pub= topic=large-language-models verified=true sentiment=· neutral

The Hidden Math: How Your Prompt Design Silently 6x’s Your LLM Bill

Prompt design can silently multiply an LLM API bill by six times, according to a cost analysis using Claude Sonnet 5 pricing. The analysis shows that output tokens cost roughly 5x more per token than input tokens, and cached tokens cost a tenth of the normal input price, making prompt structure the dominant cost driver over model choice. The author demonstrates that a first-draft system prompt grown by accretion can inflate token usage and cost far more than switching to a cheaper model.

read1 min views3 publishedJul 21, 2026
The Hidden Math: How Your Prompt Design Silently 6x’s Your LLM Bill
Image: Blog (auto-discovered)

Member-only story

For a while I assumed the model choice was the big lever on our API bill. Switch to something cheaper, save money — simple. Then I actually sat down and ran the numbers on our prompts themselves, and the model was barely the story. The prompt was. Here’s the math, worked out on a realistic example, because the gap surprised me enough that I wanted to see it in black and white.

The formula is dead simple. Cost per request is just (input tokens × input price) + (output tokens × output price)

. The part people forget: output tokens usually cost about 5x more per token than input tokens. And cached tokens cost roughly a tenth of the normal input price on a hit. Those two facts alone explain most of what follows.

I’m using Claude Sonnet 5 pricing for this — $3 per million input tokens, $15 per million output — but the method transfers to whatever model you’re actually running. Token counts below are ballparked at about 1.3 tokens per English word, which is close enough for illustration; for your real numbers, run your actual prompts through the model’s token counter instead of eyeballing it.

Exhibit A: the prompt nobody’s touched since launch. This is the classic first-draft system prompt — the one that grew by accretion, a sentence patched in every time

── more in #large-language-models 4 stories · sorted by recency
── more on @claude sonnet 5 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/the-hidden-math-how-…] indexed:0 read:1min 2026-07-21 ·