How to cut OpenAI API costs

Practical ways to lower your OpenAI API bill with smaller models, prompt caching, the Batch API, flex processing and spend limits.

4 min read Prices checked October 2026

In this post

OpenAI charges for the API by the token. In practice that makes your bill a product of three things: how many requests you send, how long each one runs, and which model answers. Every idea below moves one of those numbers without changing what you ship. One note on numbers first. OpenAI's prices move often, and every figure here is as listed on the linked page when we checked it in October 2026.

Pick the model before you tune anything else

OpenAI's cost optimization guide boils it down to three levers: reduce requests, minimize tokens, and select a smaller model. The first two are what you'd guess. Do in one call what you now do in three, trim the prompt, and ask for shorter outputs.

The third lever has the most room in it, because the gap between models is wide. The OpenAI API pricing page lists GPT-5.6 Luna at $0.20 per 1M input tokens and GPT-5.6 Sol at $4.00 per 1M input tokens. Sol's price is a promotion, which the page says is available "at least through November 21, 2026." Before the promotion, OpenAI's GPT-5.6 announcement listed Sol at $5.00 per 1M input tokens. Even at the promotional price, Luna's input costs a twentieth of Sol's.

Don't take the small model on faith, though. Put two or three models through the same eval set, and if the small one holds up on the easy work (classification, extraction), send the easy work there. The one you want is the cheapest model that still meets your quality bar.

Prompt caching rewards a stable prefix

Prompt caching reuses work when requests share the same prompt prefix. OpenAI says it is enabled by default for supported models, and reused tokens are billed at the model's cached-input rate, "discounted up to 95%."

There is a catch. Per the same guide, the whole rendered prefix has to match, and it has to meet a minimum length, which for GPT-5.6 and later is 1,024 tokens. Change anything early in the prompt from one request to the next and you lose the match.

That turns prompt layout into a cost decision. Put the fixed content first: system instructions, tool definitions and examples. Put user input and fresh data at the end. Then keep your request settings stable, since the guide lists model, tools, structured output schemas and reasoning.effort among the settings that change the cached prefix.

Writes cost extra on newer models. For GPT-5.6 and later, the guide states that cache writes cost 1.25x the standard input rate for the default 30-minute lifetime, and reads cost 0.1x on most of these models. That looks like a penalty until you do the guide's own math: one write and nine full reads come to 2.15x the ordinary input cost (1.25 plus nine times 0.1), against 10x without caching.

The guide links to a Prompt Caching Dashboard where you can check your hit rate. Check it again after you reorder a prompt.

If it can wait a day, batch it

The Batch API offers a "50% cost discount compared to synchronous APIs." What you give up is time: each batch completes within 24 hours. Batches also get a separate pool of higher rate limits.

OpenAI names running evaluations, classifying large datasets and embedding content repositories as good fits. The flow is plain. You upload a .jsonl file of requests, start the batch, and fetch the results later. One rule to plan around is that each input file can only hold requests to one model.

Flex processing, for calls nobody is waiting on

Flex processing trades speed for price on Responses and Chat Completions requests. You set service_tier to flex, and in OpenAI's words, "Tokens are priced at Batch API rates, with additional discounts from prompt caching."

It comes with strings attached. It is in beta, with limited model availability. Responses are slower, so your client timeout may need to go up. And it can return a 429 Resource Unavailable error, although OpenAI says you are not charged when that happens. Retry with backoff, or fall back to standard processing for the requests where the result matters more than the cost.

Cap spend per project

The rate limits guide describes two spend controls for an organization or project. A spend alert sends a notification and lets traffic continue. A hard spend limit makes affected requests return a 429 error. We'd set both per project, so one runaway job can't drain the whole account.

Prepaid credits have their own rules, laid out in OpenAI's prepaid billing article. Purchased credits expire after 1 year, which is a good reason not to buy far more than you will use. The article also warns against relying on the prepaid balance as an instant spending cutoff, because usage can run the balance negative. If you use auto-reload, it has an optional monthly limit.

In what order

  1. Measure token use per feature before you optimize.
  2. Test a smaller model on each task.
  3. Move fixed prompt content to the front.
  4. Batch anything that can wait 24 hours.
  5. Use flex for low-priority calls on supported models.
  6. Set spend alerts and hard limits per project.

Where ernd fits

The ernd card is a charge card for US companies, with partners across the AI stack built in. Request early access.

Sources

The ernd card

The ernd card is a charge card for US companies, with partners across the AI stack built in.

Request your card