Thursday, 3 Dec 2026 Global Edition
Live Wire
AI Today Daily AI journalism & intelligence
Front Page Tips & Tutorials Baca versi Indonesia

Same Tokens, Slimmer Bill: Three Underused Technical Levers to Cut Your AI API Costs

Your AI bill keeps growing even with lean prompts? Time to switch on the three overlooked levers: prompt caching, batch API, and model routing.

Same Tokens, Slimmer Bill: Three Underused Technical Levers to Cut Your AI API Costs

You trimmed your prompts and use the small model when you can — yet the API bill still balloons every month. The problem probably isn't your prompt-writing habits; it's three mechanisms you haven't switched on: prompt caching, batch processing, and model routing. All three are available in the Claude, OpenAI, and Gemini APIs, but because they require touching code, many teams leave them idle. The payoff is concrete: repeated prompt sections can be billed at roughly one-tenth of the normal price, non-urgent work gets a flat 50 percent discount, and lightweight questions stop paying flagship rates. This guide installs all three — from reading your bill to keeping quality intact.

1. Read Your Bill: Three Numbers That Decide Everything

Before cutting costs, understand where the money flows. Nearly every provider charges three components: input tokens (the prompt you send), output tokens (the answer), and cached input (prompt sections served from cache). For chatbots and agent apps, input almost always dominates — every turn resends the entire history. A chatbot carrying a 3,000-token history over 20 turns has shipped 60,000+ input tokens, mostly identical across requests.

Do this now: open your provider's billing dashboard, note last month's three numbers — total input, cache reads, output — and drop them into a spreadsheet. That's your baseline, and the levers below work on it: caching attacks repeated input, batch cuts the per-token price, routing lowers the per-model rate.

2. Lever 1 — Prompt Caching: One-Tenth Price for Repeats

The principle is simple: the unchanged front section of your prompt — system instructions, reference documents, tool schemas, few-shot examples — should be processed at full price only once. Later requests simply reuse it.

Setup differs slightly per provider. In Claude, you mark static blocks with cache_control: writes cost 1.25x input price (five-minute TTL; a one-hour option costs more), but reads cost just 0.1x — 90 percent off. OpenAI caches automatically for prompts of at least 1,024 tokens, roughly 50 percent off the cached portion. Gemini gives about 75 percent off through implicit caching, more on explicit caches.

Three rules: static content first, dynamic last; never place timestamps or random IDs near the front — they break the cached prefix; keep the static block genuinely long, since caching pays off for thousands of tokens, not two sentences.

{
  "model": "claude-sonnet-4-5",
  "system": [{
    "type": "text",
    "text": "<SOP + product catalog ~8,000 tokens, never changes>",
    "cache_control": {"type": "ephemeral"}
  }],
  "messages": [
    {"role": "user", "content": "Customer asks: does the warranty cover water damage?"}
  ]
}

Once it's live, track your cache hit rate — the share of input served from cache. At an 80 percent hit rate, effective input cost collapses to about a quarter.

3. Lever 2 — Batch API: 50 Percent Off for Patient Work

Batch API flips the usual flow: collect hundreds of requests, submit them at once, and wait within a 24-hour window. Because the provider doesn't need capacity on demand, the entire request gets a flat 50 percent discount — all three providers run this scheme. OpenAI's discount even stacks with caching.

Best candidates: classifying thousands of feedback rows, embedding a document archive, summarizing old reports, or drafting content for tomorrow's review. The rule: if no human is waiting at the screen for the answer, it's a batch candidate. Customer chat and in-app search are not.

Rather than writing the script yourself, hand the job to an AI chat:

I have 1,200 customer feedback rows in feedback.csv (columns: id, text).
Write a Python script that uses the OpenAI Batch API to classify each row
into 6 categories + a 1-5 sentiment score with gpt-4o-mini, save results
to feedback_labeled.csv, and print a cost estimate assuming 150 input and
40 output tokens per row.

Test it on ten rows before the full run — half the bill disappears for work nobody stays up waiting for.

4. Lever 3 — Model Routing: Budget Rates for Easy Questions

The most expensive mistake in API work: paying flagship prices for tasks a small model handles fine. Requests aren't equal: topic tagging, date extraction, and binary classification are small-model jobs; summaries and drafts sit at the mid tier; only multi-step reasoning and gnarly code deserve the priciest model.

Install a three-tier pattern: pick the model by task type. When difficulty is unclear, use a cheap router — one small-model call that classifies the request and forwards it to the right tier. It costs cents, but total savings can reach tens of percent.

The fastest start: audit your own logs with an AI chat.

Here are 200 of my API requests from last week (task type, input length,
quality complaints): <paste log>.
Group them into light/medium/hard tiers, then recommend the cheapest
realistic model per tier, with a short reason for each.

That answer becomes routing table v1 — move it into your app config and recalibrate monthly.

5. Install the Brakes: Alerts and a Weekly Audit

Savings leak back if unmonitored. First, set spending limits — daily and monthly — in your provider dashboard; an emergency brake, not a strategy. Second, tag every request with feature metadata (feature: chat, feature: summary) to expose your biggest spender. Third, run a ten-minute weekly audit: which feature's tokens grew while the product didn't change?

The most common leaks: conversations that never reset, so history keeps growing; context that piles up without being summarized; and automatic retries without a cap. Fixes are quick: summarize long histories periodically, send only the last ten turns when that's enough, and cap retries.

Want a second opinion? Paste your monthly usage recap into an AI and ask for the three biggest waste sources and a fix for each.

6. Test Before, Compare After: Saving Without Quality Loss

Every lever above can degrade quality if installed blindly: small models miss nuance, batches mix up ordering, caches sometimes serve stale data. Treat saving like a feature release.

Prepare 30-50 test cases from real traffic — prioritize ones that failed before or are money-sensitive. Run the same set before and after each change, then compare. Consider it a pass if at least 9 of 10 cases still meet your standard. For answers that must not slip, don't economize.

The routine takes one afternoon to build, then acts as a safety net.

These three levers work underneath your application — prompt structure, delivery timing, model choice — so you never have to write shorter prompts or accept worse answers. A sensible order: caching first for the fastest impact, batch for patient work, then routing from your log audit. Measure cache hit rate weekly; the difference usually shows in the same month's invoice.

References

Partner Spotlight Explore today’s curated technology offers