5Guides Updated 1 December 2026 6 min read

OpenAI API pricing explained, with a worked example

OpenAI API pricing in plain numbers: what each model costs per million tokens, how caching, Batch and Fast change the bill, and how to watch spend live.

By AI Model Hub Desk · 1 December 2026

Small blue token chips feeding into a slate meter whose half-circle gauge has a mustard needle swung high.

OpenAI charges per token: you pay one rate per million input tokens and a higher rate per million output tokens, and the rate depends on the model. As of December 1, 2026, the flagship GPT-6.2 Astra costs $8 per million input tokens and $40 per million output tokens. GPT-6.2 Sol costs $2/$10 and GPT-6 Luna costs $0.10/$0.50 (OpenAI pricing). Your bill also depends on caching, the processing tier, prompt length and tool calls, and this guide covers each one.

Key takeaways

  • The bill is tokens × rate: input, cached input, cache writes and output (including reasoning tokens) each have their own price.
  • Prompts over 272K input tokens cost more. GPT-6.2 Sol goes from $2/$10 to $4/$15.
  • Batch halves the price if you can wait up to 24 hours. Cached input costs 95% less than fresh input on GPT-6.2 models.
  • You can see spend live: the Usage dashboard, the Usage API (down to 1-minute buckets) and the usage object on every response.
  • Set a hard spend limit per project. Requests then fail with a 429 instead of running up a bill.

How are costs calculated for OpenAI API usage?

Every response reports how many tokens it used. OpenAI multiplies each token type by the model's rate:

cost = uncached_input × input_rate
     + cached_input   × cached_rate
     + cache_writes   × write_rate
     + output         × output_rate        (output includes reasoning tokens)
     + tool fees      (web search, file search, containers)

Five details change the result:

  • Reasoning tokens count as output. The reasoning guide says they take up context space and are billed as output tokens. A response can even stop at max_output_tokens before any visible text appears, and you still pay for the reasoning.
  • Long prompts cost more. "Short context" means 272K input tokens or fewer. Above that, the long-context rates apply (pricing).
  • Cache writes are priced on GPT-5.6 and later. A default 30-minute write costs 1.25× the input rate, and a 12-hour write costs 2.5×. Reads cost 0.05× the input rate on GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Sol and GPT-6.1 Terra, and 0.1× on most other models. The smallest prefix that can be cached is 1,024 tokens (prompt caching guide).
  • Regional processing (data residency) adds 10% for models released on or after March 5, 2026.
  • Tools cost extra. Web search costs $10 per 1,000 calls plus the search content tokens. File search costs $2.50 per 1,000 calls plus $0.10 per GB per day of storage after 1 GB free.

What are the pricing tiers for current models?

Here are the standard short-context rates per million tokens, from OpenAI's pricing page as of December 1, 2026:

ModelInputCached inputOutputBatch input / output
gpt-6.2-astra$8.00$0.40$40.00$4.00 / $20.00
gpt-6.2-sol$2.00$0.10$10.00$1.00 / $5.00
gpt-6.1-terra$1.00$0.05$5.00$0.50 / $2.50
gpt-6-luna$0.10$0.01$0.50$0.05 / $0.25
gpt-5.4-mini$0.75$0.075$4.50$0.375 / $2.25
gpt-5-nano$0.05$0.005$0.40$0.025 / $0.20

OpenAI's models page recommends Astra for complex reasoning and coding, Sol to balance intelligence and cost, and Luna for "cost-sensitive, high-volume workloads".

The same model also has processing tiers:

  • Standard is the default rate.
  • Batch is 50% off with up to a 24-hour turnaround (Batch guide).
  • Background completion windows (public beta) take 30% off Standard for a 2h window and 40% off for 8h on GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Terra and GPT-6 Luna (background guide).
  • Flex is half price but is being wound down. OpenAI won't add it to new models.
  • Fast (formerly Priority) is 2× Standard.
  • Ultrafast for GPT-6.2 costs 3× Standard through February 28, 2027, and 6× from March 1, 2027.

Usage tiers are separate. They set your rate limits and a monthly usage cap based on how much credit you have bought. Build starts at $5 and caps at $500 per month; Grow starts at $500 and caps at $200,000 per month (rate limits).

What does a real workload cost? A worked example

Take a support assistant on gpt-6.2-sol that handles 50,000 requests a month. Each request has a 2,000-token system prompt and tool list that never changes, about 1,000 tokens of conversation, and a 400-token answer.

Without caching:

  • Input: 50,000 × 3,000 = 150M tokens × $2.00 = $300.00
  • Output: 50,000 × 400 = 20M tokens × $10.00 = $200.00
  • Total: $500.00 a month

With caching on the 2,000-token prefix. Assume the cache is rewritten once every 30 minutes, which is 1,440 writes a month:

  • Cache writes: 1,440 × 2,000 = 2.88M tokens × $2.50 = $7.20
  • Cache reads: (100M − 2.88M) = 97.12M tokens × $0.10 = $9.71
  • Fresh input: 50M tokens × $2.00 = $100.00
  • Output: unchanged at $200.00
  • Total: about $316.91 a month, 37% less

Output is now the biggest cost. Cap answer length and reasoning effort to bring it down. For comparison, the same uncached traffic would cost $2,000 on gpt-6.2-astra and $25 on gpt-6-luna. That is why it pays to route easy requests to a smaller model.

Is there a way to track API spending in real time?

Yes, at three levels:

  1. Per request. Every response includes a usage object. For caching, read usage.input_tokens_details.cached_tokens and cache_write_tokens. OpenAI recommends tracking cached tokens divided by total input tokens as your cache-hit rate (prompt caching guide).
  2. Per organization. The Usage API at GET /organization/usage/completions returns token counts in 1-minute, 1-hour or 1-day buckets. You can group the results by project, user, API key or model. The Costs API at GET /organization/costs returns dollar amounts in daily buckets, grouped by project or line item (API reference). Both need an Admin API key.
  3. In the dashboard. The usage page shows current spend for the organization.

Here is a minimal call to the Usage API (the timestamp is 00:00 UTC on December 1, 2026):

curl "https://api.openai.com/v1/organization/usage/completions?start_time=1796083200&bucket_width=1h" \
  -H "Authorization: Bearer $OPENAI_ADMIN_KEY"

How do you stop an OpenAI bill from running away?

OpenAI's spend limits guide offers two controls:

ControlWhat happens at the thresholdUse it for
Spend alertYou get a notification; traffic continuesEarly warning
Hard spend limitRequests return 429 with project_spend_limit_exceeded or organization_spend_limit_exceededA real monthly cap

Enforcement is not instant, so spend can go slightly over the limit before requests start failing.

Cost-control checklist

  • [ ] One project per product or environment, each with its own hard limit and alerts at 50% and 80%.
  • [ ] The cheapest model that passes your evals as the default; escalate to Sol or Astra only when needed.
  • [ ] Stable content (instructions, tools, examples) at the start of the prompt, at least 1,024 tokens, so it can be cached.
  • [ ] max_output_tokens and a sensible reasoning effort on every call.
  • [ ] Batch or a background window for anything that can wait: evals, backfills, nightly reports.
  • [ ] Prompts kept under 272K tokens unless you need the long-context rate.
  • [ ] Code that handles 429 spend-limit errors so users see a clear message instead of a silent failure.
  • [ ] A weekly look at the Costs API grouped by line item.

Sources

About the author

AI Model Hub Desk, Editors

The editors of AI Model Hub. We cover new models for the people who build with them.

Connecting services

  1. 5 Guides Guide

    Model Evaluation for LLMs: A Practical Guide

    A practical model evaluation workflow for LLMs: a 30–50 case golden set, cheap automatic checks, careful LLM-as-judge, cost and latency per case, and regression tests.

    30 NOV 6 min read