Cost Optimization

Your System Prompt Is Your Biggest LLM Cost Driver. Most Developers Don't Know This.

July 12, 20267 min readLLMtrack Blog
Quick Answer: A 4,000-token system prompt at 100,000 requests/month equals 400 million input tokens. At GPT-4o pricing that's roughly $1,000/month just to re-send the same instructions on every call. With Anthropic prompt caching (about a 90% discount on cached tokens), the same workload drops to roughly $100/month.
$1,000/mowithout caching
$100/mowith caching
90%typical cache discount

Why This Is Counterintuitive

Most cost conversations focus on which model you call or how long the output is. Nobody budgets for the system prompt because it "isn't the real work" — it's just instructions, persona, tool schemas, and formatting rules. But pricing doesn't care what tokens are for. A 4,000-token system prompt costs the same as 4,000 tokens of user content, and it gets billed on every request — including the 99% of requests where nothing in it changed since the last call.

Prompts grow organically: a sentence here, a tool schema there, a paragraph of edge-case handling. Most teams don't realize they've built a multi-thousand-token prefix that gets retransmitted and rebilled on every single interaction.

Interactive: System Prompt Tax Calculator

Paste your system prompt below for a live token estimate, or type a token count directly.

Client-side estimate only. Token estimate uses characters ÷ 4 as a rough proxy.

How Caching Works: OpenAI vs Anthropic

Both major providers offer prompt caching, but the mechanics differ:

  • Anthropic (Claude): you mark an explicit cache breakpoint. Tokens before it are cached for roughly 5 minutes and billed at about a 90% discount on cache hits, with a smaller write cost on cache misses.
  • OpenAI: caching is automatic for prompts over 1,024 tokens with an identical prefix — no explicit breakpoint needed. Cache hits depend on the prefix staying byte-identical, so dynamic content placed before static instructions breaks the cache.

Either way: put static content (system prompt, tool definitions, few-shot examples) first, and dynamic content (user input, retrieved context, timestamps) last. Order determines whether you get the discount at all.

Interactive: Prompt Audit Tool

Paste a system prompt to get a live audit — token estimate, projected cost at three volumes, verbosity flags, and an estimated trim savings.

100% client-side. Nothing you paste here is sent anywhere or stored.

Token Breakdown of a Typical Request

For a typical chat feature with a static system prompt, history, and a short user message, the token budget usually looks like this:

System prompt
55%
History
30%
User input
10%
Output
5%

The largest lever on input cost — by far — is the part of the request that never changes between calls.

// Anthropic-style cache breakpoint: static system prompt first
const response = await anthropic.messages.create({
  model: 'claude-sonnet-4-6',
  system: [
    {
      type: 'text',
      text: STATIC_SYSTEM_PROMPT,
      cache_control: { type: 'ephemeral' } // marks the cache breakpoint
    }
  ],
  messages: [{ role: 'user', content: userMessage }]
})
Tip: Audit your system prompt quarterly. Instructions that made sense for an earlier prompt version often become redundant once the model improves — and every redundant token is billed forever, on every request.
You cannot optimize what you cannot see.

Track token counts per request and separate system-prompt tokens from history and user input.

Start tracking free →

FAQ

No. Caching is a billing and latency optimization — the model receives the identical prompt either way. Quality and behavior are unaffected.

At low volume the absolute dollar savings are small, but trimming still matters — a bloated system prompt adds latency and crowds out context window space for real conversation history.

For OpenAI, as long as your static prefix is byte-identical, hits are common. For Anthropic, cache entries expire after a few minutes of inactivity, so steady traffic hits the cache far more often than bursty traffic.

See your real token breakdown — system prompt vs history vs output

Start free. One async tracking call. No proxy and no credit card required.

Start free →