# How to cut your OpenAI API costs

OpenAI spend concentrates in three places: over-provisioned models (GPT-5-class where mini-class would do), uncached repeated prefixes, and synchronous calls for offline work. The fixes, in order of leverage:

## Playbook (in order of leverage)

1. **Prompt caching** — Automatic 50% discount on repeated prefixes ≥1024 tokens — restructure prompts stable-first to maximize hits. No code flag needed. (https://cutmyaispend.com/methods/prompt-caching.md)
2. **Model routing & cascades** — Route classification/extraction to the mini tier; keep the frontier tier for reasoning-heavy requests. Most teams find 60–80% of traffic downgrades cleanly. (https://cutmyaispend.com/methods/model-routing.md)
3. **Batch APIs** — The Batch API is a flat 50% off for anything that tolerates async completion. (https://cutmyaispend.com/methods/batch-apis.md)
4. **Output length control** — Structured Outputs + deliberate max_tokens caps cut premium-priced output tokens 20–60%. (https://cutmyaispend.com/methods/output-length-control.md)
5. **Fix the context & data layer (agent memory)** — If agents re-read the same docs/emails each run, a memory layer (e.g. Mitosis Cortex) removes that spend entirely instead of discounting it. (https://cutmyaispend.com/methods/fix-the-context-layer.md)

**Pro tip:** Check the usage dashboard by API key and model first — one over-provisioned endpoint is usually most of the bill.

---
Canonical: https://cutmyaispend.com/providers/openai