Home / Providers / OpenAI
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:
The playbook, in order of leverage
- Prompt caching — Automatic 50% discount on repeated prefixes ≥1024 tokens — restructure prompts stable-first to maximize hits. No code flag needed.
- 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.
- Batch APIs — The Batch API is a flat 50% off for anything that tolerates async completion.
- Output length control — Structured Outputs + deliberate max_tokens caps cut premium-priced output tokens 20–60%.
- 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.
Pro tip
Check the usage dashboard by API key and model first — one over-provisioned endpoint is usually most of the bill.