Reduce OpenAI API Costs: 8 Tactics Ranked by Effort

7 min read

The fastest way to reduce OpenAI API costs is usually not a new vendor. It is sending fewer and cheaper tokens to the vendor you have: a smaller model where it does the job, prompts structured so the cache can discount them, the Batch API for anything that can wait, and realistic output limits. Those changes are mostly configuration and can cut a bill by half or more without touching quality on the requests that matter.

The larger moves come after: caching whole responses, routing easy requests to cheap models, and, for steady high-volume work, running an open model on hardware with a fixed monthly cost.

Below are eight tactics, ordered from least to most effort. All OpenAI prices and discounts were checked on OpenAI's pricing page and docs in November 2026. They change often.

First, find where the money goes

Before changing anything, split last month's usage by feature, model, input tokens and output tokens. Two facts usually jump out.

Output tokens cost far more than input. On gpt-5.4, standard pricing in November 2026 is $2.50 per million input tokens and $15.00 per million output tokens, six times as much. A feature that writes long answers can cost more than one that reads long documents.

And a small number of features usually account for most of the spend. Fix those first.

Ways to reduce OpenAI API costs, ranked by effort

# Tactic Effort What it saves
1 Cap and shorten output Minutes Output tokens, the expensive ones
2 Use a smaller model Hours, plus testing 70-92% per token within one model family
3 Structure prompts for caching Hours Up to 90% on repeated input in the gpt-5.4 family
4 Trim prompts Hours to days Input tokens on every call
5 Batch API for offline work Days 50% on batched requests
6 Cache whole responses Days 100% of repeat requests
7 Route by difficulty Weeks Depends on your traffic mix
8 Self-host steady workloads Weeks Turns per-token cost into fixed cost

1. Cap and shorten output

Set max_tokens close to the length you actually need, and ask for the format you need: "Answer in at most three sentences", "Return only the JSON object". Models will happily write a preamble and a summary nobody reads, and you pay output prices for both.

There is a side benefit. OpenAI counts a request against your rate limit using the larger of max_tokens and the estimated request size, so a realistic max_tokens also leaves you more headroom. Our guide to OpenAI rate limits explains how that accounting works.

2. Use a smaller model

This is the single biggest lever for most teams. November 2026 standard prices per million tokens:

Model Input Cached input Output
gpt-5.4 $2.50 $0.25 $15.00
gpt-5.4-mini $0.75 $0.075 $4.50
gpt-5.4-nano $0.20 $0.02 $1.25

Moving from gpt-5.4 to gpt-5.4-mini cuts both input and output price by 70%. Moving to gpt-5.4-nano cuts input by 92%. Classification, extraction, short summaries and reformatting rarely need the largest model.

Do not switch on faith. Take 50 to 100 real requests from the feature, run them through both models, and have someone who owns the feature judge the outputs without knowing which is which. Our post on how to evaluate LLMs on your own data describes the method; it works the same for hosted models.

3. Structure prompts for OpenAI prompt caching

OpenAI's prompt caching is on by default for supported models. When the start of a prompt matches one it has seen recently, the reused tokens are billed at the cached-input rate, which the docs describe as discounted by up to 95%. In the table above, cached input is a tenth of the normal input price. It also cuts the time before the response starts.

You do not turn it on; you earn it by how you build prompts:

  • Put the stable parts first: system prompt, instructions, tool definitions, few-shot examples, shared documents. Put the user's question and anything that changes per request last.
  • Keep the stable prefix byte-for-byte identical. A timestamp or request ID near the top breaks the match for everything after it, because reuse requires the whole prefix to match.
  • Caching only applies above a minimum length: 1,024 tokens for GPT-5.6 and later models.

Check that it works by reading usage.input_tokens_details.cached_tokens in responses. One caveat for GPT-5.6 and later: cache writes are billed at 1.25 times the uncached input rate for the default 30-minute lifetime. A prefix that is written once and never reused costs slightly more than no caching. Earlier models have no write charge.

4. Trim prompts

Prompts grow by accretion. Someone adds an instruction to fix one bad answer, then another, and a year later every call carries 3,000 tokens of rules. Things worth checking:

  • Chat history: send a summary of older turns instead of the full transcript.
  • Retrieval: if your RAG pipeline stuffs ten chunks into every prompt, test whether four do as well.
  • Tool definitions: send only the tools relevant to the request.
  • Duplicate instructions: system prompts often say the same thing three ways.

Measure each cut against your test set. Trimming context is the tactic most likely to hurt quality quietly.

5. Use the Batch API for offline work

The Batch API gives a 50% discount compared with the synchronous API. You upload a file of up to 50,000 requests, and results come back within a 24-hour window. Batch jobs also do not count toward your standard per-model rate limits, so moving them off the synchronous API frees headroom for interactive traffic.

Good candidates are anything nobody is waiting on: nightly report generation, tagging a backlog of documents, running evaluations, enriching records. The 50% stacks with the smaller-model saving: gpt-5.4-mini batch output is $2.25 per million tokens against $15.00 for synchronous gpt-5.4.

6. Cache whole responses yourself

Prompt caching discounts repeated input. Your own response cache removes the call entirely. If the same question or document comes in twice, return the stored answer.

Exact-match caching (hash the model, prompt and parameters) is safe and simple to build in front of your client. Semantic caching, which returns a stored answer for a similar question, catches more traffic but can hand a user an answer to a question they did not ask. Use it only where a near-miss is harmless, and give entries an expiry so stale answers age out.

7. Route easy requests to cheaper models

Tactic 2 picks one smaller model per feature. Routing picks a model per request: short, routine requests go to a small model, and long or hard ones go to the large one. A cascade goes further, trying the small model first and escalating only when a check fails, such as JSON that does not validate.

The savings depend entirely on your mix, and the risk is a hard question answered confidently by a model that was not up to it. LLM routing explained covers the strategies and how to test a router before it goes live.

8. Move steady, high-volume work to a self-hosted model

Every tactic above lowers the price per token. Self-hosting changes the pricing model. You pay for GPUs by the hour or buy them, and each extra request costs close to nothing until the hardware is full. For low or spiky usage that is worse than paying per token. For a workload that runs all day at steady volume, it can be much cheaper, and it removes the per-minute quota at the same time.

We worked through the arithmetic, including GPU prices, power, operations time and utilization, in the self-hosted LLM cost break-even model, so it is not repeated here. The short version: utilization decides it. An idle GPU is the most expensive way to run a model.

Two conditions should both hold before you move a workload. An open-weight model must pass your quality test on real examples, and the volume must be steady enough to keep the hardware busy. Private LLM vs OpenAI API walks through that decision, including privacy and model-version control, which often matter as much as cost.

If you go that way, AI Refinery, a self-hosted LLM platform, runs open models inside your own cloud, VPC or on-premise network on GPUs you provide. Its catalog lists GPU memory and measured tokens per second for each quantization variant, which are the two numbers you need to size hardware for a break-even estimate. Each deployed model exposes an OpenAI-compatible /v1/chat/completions endpoint, so moving a feature over is a base URL and model name change. On Professional and Enterprise plans, smart routing sends each request to the best available model for the task. It is not the right fit if your volume is small or spiky, or if only a frontier model passes your tests; in that case tactics 1 to 7 are where your savings are.

A sensible order of work

  1. Pull a month of usage by feature, and split input from output tokens.
  2. Set realistic max_tokens and tighter output formats this week.
  3. Test a smaller model on your top two features by spend.
  4. Reorder prompts so stable content comes first, then confirm cached_tokens is rising.
  5. Move every non-interactive job to the Batch API.
  6. Add an exact-match response cache where requests repeat.
  7. Consider routing or self-hosting only after the cheap wins, using real numbers from steps 1 to 6.