Cost, Billing, and OpsOctober 12, 2026Cxj

OpenAI API Cost in 2026: Pricing Table and Calculator

A current OpenAI API cost guide with GPT-6 pricing tables, a copyable calculator, worked examples, hidden fees, and optimization checks.

OpenAI API Cost in 2026: Pricing Table and Calculator

OpenAI API cost depends on five things: the model, uncached input tokens, cached input tokens, cache-write tokens, and output tokens. Service tier, context length, tools, retries, media, and regional processing can add more.

Price check: October 12, 2026. OpenAI changes models and prices frequently. Use the official OpenAI API pricing page as the final source before a budget or production launch.

OpenAI API cost: quick answer

For Standard processing, OpenAI's current flagship table lists the following short-context prices per 1 million tokens:

Model Input Cached input Cache writes Output
GPT-6 Astra $10.00 $1.00 $12.50 $50.00
GPT-6.1 Sol $2.00 $0.10 $2.50 $10.00
GPT-6 Luna $0.10 $0.01 $0.125 $0.50

The same Standard table currently shows higher long-context rates:

Model Input Cached input Cache writes Output
GPT-6 Astra $20.00 $2.00 $25.00 $75.00
GPT-6.1 Sol $4.00 $0.20 $5.00 $15.00
GPT-6 Luna $0.20 $0.02 $0.25 $0.75

Do not copy only the cheapest row into a forecast. A lower-priced model can cost more per accepted result if it generates longer answers, fails validation, or triggers retries and fallback calls.

OpenAI API cost formula

Use this formula for a token-priced request:

request cost =
  (uncached input tokens / 1,000,000 × input rate)
  + (cached input tokens / 1,000,000 × cached-input rate)
  + (cache-write tokens / 1,000,000 × cache-write rate)
  + (output tokens / 1,000,000 × output rate)
  + tool, media, container, and regional charges

For a monthly estimate, calculate each workload separately and then add retries, fallback attempts, evaluation traffic, and non-token charges.

monthly cost =
  requests per month
  × average token cost per request
  × average upstream attempts per request
  + tool and infrastructure charges

The attempt multiplier matters. If one user action creates a primary request, one retry, and one fallback call, the bill can include three upstream attempts even though the product records one workflow.

Three worked OpenAI API cost examples

Assume a short-context workload uses 10 million uncached input tokens and 2 million output tokens with Standard processing.

Model Calculation Estimated token cost
GPT-6 Astra 10 × $10 + 2 × $50 $200.00
GPT-6.1 Sol 10 × $2 + 2 × $10 $40.00
GPT-6 Luna 10 × $0.10 + 2 × $0.50 $2.00

This is a price comparison, not a quality comparison. Use the same evaluation set and acceptance rule before deciding whether a cheaper route can perform the workload.

Example with cached input

Suppose the GPT-6.1 Sol workload has 10 million input tokens, 60% of which are served at the cached-input rate, plus 2 million output tokens:

uncached input: 4 × $2.00 = $8.00
cached input:   6 × $0.10 = $0.60
output:         2 × $10.00 = $20.00
estimated total:             $28.60

That estimate excludes any cache-write charge needed to create or refresh the cached prefix. Measure cache hits and cache writes separately; do not assume every repeated prompt receives the cached rate.

Short context versus long context

The current pricing page separates short- and long-context rates for flagship models. A request that crosses the applicable context threshold can change the rate for the request, so average prompt size is not enough for forecasting.

Track a distribution instead:

  • p50, p90, and p99 input tokens;
  • the share of requests entering the long-context tier;
  • cached and uncached input tokens;
  • output and reasoning tokens;
  • retries and fallback attempts;
  • cost per accepted result.

A few very large prompts can dominate the monthly bill even when the median request is small.

Standard, Batch, Flex, Fast, and Ultrafast pricing

OpenAI currently exposes multiple processing modes on its pricing page. The right mode depends on the workload's deadline and availability requirements.

Mode Practical fit Cost planning question
Standard Normal interactive and production traffic Does the model and context tier meet the latency budget?
Batch Offline jobs that can wait Can the workflow accept delayed completion and batch semantics?
Flex Cost-sensitive work that can tolerate variable service Can the job wait or retry without harming the user?
Fast Latency-sensitive production paths Is the latency gain worth the higher rate?
Ultrafast The most latency-sensitive supported routes Is the premium limited to requests that truly need it?

Read the selected tab on the official pricing page before copying a number. A rate from Batch, Flex, Fast, or Ultrafast is not a Standard rate.

Responses API versus Chat Completions cost

OpenAI states that the Responses API and Chat Completions API are not priced as separate products. Token usage is billed at the selected model's rates. Built-in tools and other capabilities can add their own fees.

Choose the endpoint for the contract your application needs, then calculate:

  • model tokens;
  • cache reads and writes;
  • web or file search calls;
  • container or code-execution sessions;
  • image, audio, or realtime usage;
  • retry and fallback amplification.

Do not assume an endpoint migration is free just because there is no endpoint fee. Tool behavior, longer context, reasoning, or larger outputs can change total usage.

Extra OpenAI API charges teams miss

Tool calls

The official pricing page lists separate charges for tools such as web search and file search. Retrieved content can also create model input tokens. A single product action may therefore include both a tool-call fee and model token charges.

Containers and code execution

Hosted Shell and Code Interpreter containers have session charges and minimum billing rules. Reusing a session or ending it promptly can matter more than the token rate for tool-heavy agents.

Regional processing and FedRAMP

OpenAI's current pricing notes a 10% uplift for eligible regional processing endpoints released on or after March 5, 2026, and a 10% uplift for FedRAMP endpoints. Confirm whether the workload actually uses one of those endpoints.

Realtime, audio, images, and video

Multimodal services use different units and rates. Do not estimate a voice or image workflow from a text-token table.

Retries and multiple candidates

A retry is another billable attempt. Multiple completions or candidates can also increase generated tokens. Record upstream attempts, not only user-visible requests.

Seven ways to reduce OpenAI API cost

  1. Route by workload. Use the smallest model that passes the task's quality and contract checks.
  2. Cache stable prefixes. Keep reusable instructions, tool schemas, and shared context at the beginning when the API and model support caching.
  3. Control output length. Set a realistic output limit and ask for concise schemas instead of open-ended prose.
  4. Use Batch or Flex for delayed work. Move evaluations, enrichment, and other offline jobs away from interactive tiers when the operating contract allows it.
  5. Bound retries. Classify authentication, validation, quota, timeout, and upstream failures before retrying.
  6. Measure accepted results. Include invalid JSON, failed tool calls, manual repair, and fallback traffic in the cost metric.
  7. Review tools separately. Track web search, file search, containers, media, and agent loops as their own cost drivers.

For a broader workload framework, use the AI API cost optimization guide.

Direct OpenAI API or a multi-model gateway?

Direct OpenAI access is usually the cleanest choice when your product depends on OpenAI-native features, one provider is enough, and the team is comfortable managing the account, keys, usage, and fallback path.

A multi-model gateway is useful when the application needs OpenAI beside Claude, Gemini, DeepSeek, Qwen, image, audio, or video models and wants one application-facing key, one compatible base URL, and one usage review surface.

Flatkey should not be evaluated only on whether one list price is lower. Compare the full workflow:

  • model availability and exact model IDs;
  • endpoint and feature compatibility;
  • request success and accepted-output rate;
  • latency, retries, and fallback behavior;
  • usage visibility and cost attribution;
  • provider account and billing operations;
  • rollback effort.

Review the live Flatkey model catalog and pricing page, then test one reversible workload before moving production traffic.

OpenAI API cost checklist

Before approving a budget, confirm:

  • [ ] The model ID and service tier are explicit.
  • [ ] Short- and long-context traffic are forecast separately.
  • [ ] Cached input and cache writes are measured separately.
  • [ ] Output and reasoning tokens are included.
  • [ ] Tool, media, and container charges are included.
  • [ ] Retries and fallback attempts are counted.
  • [ ] Regional or FedRAMP uplift is included when applicable.
  • [ ] Cost is measured per accepted task, not only per request.
  • [ ] The price table has a checked date and an owner for refreshes.
  • [ ] A usage alert and rollback path exist before launch.

For every current GPT-6 and GPT-5.6 token rate, including Batch, Flex, and cached input, see our OpenAI API pricing guide.

To see how OpenAI compares with Claude, Gemini, Qwen, DeepSeek, and Kimi, read our AI API pricing comparison.

Frequently asked questions

How do I calculate OpenAI API cost?

Multiply each token category by its price per 1 million tokens, then add tool, media, container, regional, retry, and fallback charges. Separate uncached input, cached input, cache writes, and output tokens.

Is the Responses API more expensive than Chat Completions?

OpenAI says the endpoints are not priced separately; tokens are billed at the selected model's rates. Total cost can still differ if one implementation uses more context, reasoning, tools, or output.

What is the cheapest OpenAI API model?

The live pricing table currently shows GPT-6 Luna with the lowest flagship token rates. That does not make it the cheapest route for every task. Test quality and calculate cost per accepted result.

Does prompt caching reduce OpenAI API cost?

It can reduce repeated-input cost when a request receives the cached-input rate. Include cache-write charges and actual hit rate before forecasting savings.

Why is my OpenAI bill higher than my token estimate?

Common causes are long-context pricing, cache writes, reasoning or long outputs, tools, containers, media, retries, multiple candidates, fallback calls, and regional processing.

Can an OpenAI API alternative reduce cost?

Possibly. A different provider, gateway, self-hosted proxy, or smaller model may reduce one cost component, but migration work, retries, quality failures, and operations also count. Use the OpenAI API alternatives migration guide and benchmark the same workload.

Sources

Prices are a dated snapshot, not a permanent quote. Verify the official OpenAI page and the live Flatkey pricing surface before launch.