Cost Optimisation OpenAI API Apps: Caching, Batching and Model Choice

Cut your OpenAI API bill with model routing, prompt caching, the 50%-off Batch API and output control — with current GPT-5 and GPT-6 prices.

By Galactic News Editorial · Published 2026-11-27T02:13:44+00:00 · Updated 2026-11-27T02:13:44+00:00

Cost optimisation for OpenAI API apps: caching, batching and model choice

Cost Optimisation OpenAI API Apps: Caching, Batching and Model Choice

OpenAI API bills are driven by three choices: which model answers, how much context you send, and whether the work needs an answer now. Get those three right and most apps cut their bill by half or more without changing what the app does. The levers are model choice, prompt caching, the Batch API, and output control. This guide walks through each one with current prices from OpenAI's own pricing pages.

Prices change, so treat the figures below as a snapshot read from OpenAI's pricing page on 27 November 2026, and check the official page before budgeting.

Cost Optimisation OpenAI API Apps: Start With Model Choice

Model choice moves the bill further than any discount. The spread across current models is enormous: the cheapest text model costs a fraction of the flagship. Pick the smallest model that handles the task well, and route tasks by difficulty instead of sending everything to the flagship.

ModelInput per 1M tokensOutput per 1M tokensCached input per 1MBest for
gpt-5-nano$0.05$0.40$0.005Classification, routing, extraction
gpt-5-mini$0.25$2.00$0.025High-volume chat and product features
gpt-5$1.25$10.00$0.125Production agents and complex generation
gpt-6.2-sol$2.00$10.00$0.10Everyday production work
gpt-6.1-sol$2.00$10.00$0.10Everyday production work
gpt-6.2-astra$8.00$40.00$0.40Flagship reasoning and agents
gpt-6-astra$10.00$50.00$1.00Flagship reasoning and agents

The pattern is clear. A classification call on gpt-5-nano costs $0.05 per million input tokens against $8.00 on gpt-6.2-astra. That is a 160-fold difference on input. Output matters even more: output tokens cost far more than input tokens on every model, so a model that writes long answers costs more than its input price suggests.

Three routing rules follow from this:

  1. Classify and route with the cheapest model. Intent detection, moderation, tagging, and extraction rarely need a flagship.
  2. Use a mid-tier model for the bulk of the work. Most chatbot and summarisation calls run well on a mini or sol-class model.
  3. Reserve the flagship for the hard cases. Complex reasoning, agents, and high-stakes generation are where the flagship earns its price.

Prompt Caching: Pay Less for Repeated Context

Prompt caching reuses work when requests share the same prompt prefix. OpenAI caches the key-value state of the unchanged beginning of a prompt, so later requests with the same prefix skip reprocessing it. Cached input tokens are billed at a reduced rate, discounted by up to 95% according to OpenAI's own guide. On the current pricing page, cached input for gpt-6.2-astra costs $0.40 per million against $8.00 uncached, and for gpt-5 it costs $0.125 against $1.25.

Caching is enabled by default on supported models. To make it work for your app:

Monitor the cache hit rate in the Prompt Caching Dashboard on the OpenAI platform. If hits are low, the prompt prefix is probably changing between requests, and the fix is usually prompt structure, not more spending.

Batch API: 50% Off for Work That Can Wait

The Batch API cuts token costs by 50% compared with synchronous calls. The trade is time: batches complete within 24 hours, and most finish much faster. Any workload that does not need an immediate answer belongs here.

Good batch candidates include nightly summarisation, classifying large datasets, running evaluations, embedding a content repository, and weekly report generation. Anything interactive stays on the standard endpoint.

The mechanics are straightforward:

  1. Prepare a .jsonl file. Each line holds one request with a unique custom_id, the method, the URL, and the body. One file targets one model. A single batch can include up to 50,000 requests, and the input file can be up to 200 MB.
  2. Upload the file through the Files API with purpose set to batch.
  3. Create the batch with the file ID, the endpoint, and a 24-hour completion window.
  4. Poll the status until it reads completed, then download the output file. Use custom_id to map each result back to its request, because output order may not match input order.

Batch jobs do not count toward standard per-model request or token rate limits, and they share a separate queued-token limit. Failed or expired requests are written to an error file, and you are charged only for tokens consumed by completed requests.

Cut Output Tokens and Reasoning Effort

Output tokens are the expensive side of every call. On gpt-6.2-astra, output costs $40.00 per million against $8.00 for input. Five habits cut output spend:

Measure, Budget and Alert

Optimisation without measurement is guessing. Set up the controls before the bill surprises you:

  1. Tag requests by feature. Use metadata or separate API keys per feature so you can see which part of the app spends the money.
  2. Track cost per request. Log input tokens, cached tokens, and output tokens for every call. Cost per request is the number that matters, not the monthly total.
  3. Set usage limits. Use the platform's spend limits and alerts. A runaway loop should hit a limit, not an invoice.
  4. Review weekly. Look for the most expensive feature, the model with the worst cost per result, and any prompt whose cache hit rate dropped.

Bottom Line: Cost Optimisation OpenAI API Apps

Cost optimisation for OpenAI API apps comes down to four moves: route each task to the cheapest model that handles it, structure prompts so caching applies, send non-urgent work through the Batch API for 50% off, and control output length. Together these routinely halve a bill. Measure cost per request, set limits, and check the official pricing page regularly, because model prices and the lineup change often.