1 · Right-size the model per task
The single biggest lever. Route classification, routing, extraction and short-form replies to mini/flash models ($0.15–$1/M) and reserve flagships ($2.50–$15/M input) for genuinely hard reasoning. A two-tier setup routinely cuts spend 5–20× on the cheap tier's traffic.
2 · Turn on prompt caching
Repeated system prompts and documents are pure waste at full price. Caching drops repeated input by 50–90% — see our prompt caching guide for provider specifics.
3 · Use batch mode for async work
Backfills, embeddings refreshes, evals and nightly digests don't need real-time. Batch endpoints process within 24 hours at roughly half price on OpenAI-compatible APIs.
4 · Cap output tokens
Output is the expensive side of every call. Set max_output_tokens to a
realistic ceiling and ask for concise formats ("reply in under 100 words") — savings
of 20–50% on chatty workloads are common.
5 · Trim conversation history
Multi-turn chats re-send the whole transcript every turn — cost grows quadratically. Summarize old turns, keep only the last N messages verbatim, or offload history to retrieval. At 20+ turns this alone can save 60%+.
6 · Compress what you send
Strip boilerplate, deduplicate pasted logs, convert tables to compact formats, and retrieve only relevant chunks instead of stuffing entire documents. Every token you don't send is a 100% discount.
7 · Cache application-side
Identical questions deserve identical answers. Hash the normalized prompt and serve repeats from your own cache (Redis + TTL). Hit rates of 10–30% are typical in support and search scenarios — that's direct API savings.
8 · Consider open-weight models
Llama, DeepSeek, Mistral and Kimi models served hosted often undercut frontier APIs by 2–10× for mid-difficulty tasks. Benchmark quality on your own evals before switching anything user-facing.
9 · Set budgets and alerts
Provider dashboards let you set monthly hard limits and alert thresholds. One runaway retry loop can cost more than a month of optimization — guardrails first.
10 · Measure per-feature unit economics
Attribute token spend to features, not accounts. Knowing that "summarize thread" costs $0.004/call while "generate report" costs $0.09 tells you exactly where optimization effort pays. Our free token calculator gives you the per-call number in seconds, and the model pricing table keeps rates honest.