SpyBara
Go Premium

guides/cost-optimization.md 2026-07-27 17:02 UTC to 2026-07-28 23:01 UTC

2 added, 0 removed.

2026
Fri 31 05:58 Thu 30 23:58 Wed 29 22:58 Tue 28 23:01 Mon 27 17:02 Sat 25 05:59 Fri 24 19:01 Thu 23 03:02 Wed 22 20:02 Tue 21 15:00 Mon 20 21:59 Sat 18 22:00 Fri 17 19:58 Thu 16 17:00 Wed 15 16:58 Tue 14 21:58 Mon 13 21:58 Sat 11 07:01 Fri 10 23:02 Thu 9 17:03 Wed 8 22:02 Mon 6 22:58 Sat 4 16:59

Cost optimization

For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.

There are several ways to reduce costs when using OpenAI models. Cost and latency are typically interconnected; reducing tokens and requests generally leads to faster processing. OpenAI's Batch API and flex processing are additional ways to lower costs.

Cost and latency

To reduce latency and cost, consider the following strategies:

  • Reduce requests: Limit the number of necessary requests to complete tasks.
  • Minimize tokens: Lower the number of input tokens and optimize for shorter model outputs.
  • Select a smaller model: Use models that balance reduced costs and latency with maintained accuracy.

To dive deeper into these, please refer to our guide on latency optimization.

Batch API

Process jobs asynchronously. The Batch API offers a straightforward set of endpoints that allow you to collect a set of requests into a single file, kick off a batch processing job to execute these requests, query for the status of that batch while the underlying requests execute, and eventually retrieve the collected results when the batch is complete.

Get started with the Batch API →

Flex processing

Get significantly lower costs for Chat Completions or Responses requests in exchange for slower response times and occasional resource unavailability. Ieal for non-production or lower-priority tasks such as model evaluations, data enrichment, or asynchronous workloads.

Get started with flex processing →