OpenAI API pricing

What does the OpenAI API cost per million tokens?

Standard pricing for the OpenAI API ranges from $0.05 per million input tokens on lightweight models like gpt-5-nano to $50.00 per million output tokens on flagship models like gpt-6-astra in short context. If you run your workloads through the Batch API instead of real-time requests, you get an automatic 50% discount on inputs and outputs by letting jobs finish over 24 hours.

OpenAI divides context pricing into two distinct brackets: short context covers 272K input tokens or fewer, while long context applies whenever a prompt exceeds 272K input tokens. Crossing that boundary increases both input and output prices across every supported model tier, so tracking your prompt sizes matters immediately.

Standard model pricing and context tiers

OpenAI bills for tokens consumed by prompt inputs, generated outputs, and cached inputs. The Responses API, Chat Completions API, Realtime API, Batch API, and Assistants API aren't priced as separate services; tokens are billed at the chosen model's input and output rates regardless of which endpoint you target. Playground usage also bills at these exact same token rates.

The table below outlines Standard pricing for the primary text and reasoning models across both short context (≤272K input tokens) and long context (>272K input tokens). All figures represent costs per 1 million tokens.

ModelShort InputShort OutputShort CachedLong InputLong OutputLong Cached
gpt-6-astra$10.00$50.00$1.00$20.00$75.00$2.00
gpt-6.1-sol$2.00$10.00$0.10$4.00$15.00$0.20
gpt-6.1-terra$1.00$5.00$0.05$2.00$7.50$0.10
gpt-6-luna$0.10$0.50$0.01$0.20$0.75$0.02
gpt-6-sol$2.00$10.00$0.20$4.00$15.00$0.40
gpt-5.6-sol$4.00$20.00$0.40$8.00$30.00$0.80
gpt-5.6-terra$2.00$12.00$0.20$4.00$18.00$0.40
gpt-5.6-luna$0.20$1.20$0.02$0.40$1.80$0.04
gpt-5.5$5.00$30.00$0.50$10.00$45.00$1.00
gpt-5.5-pro$30.00$180.00-$60.00$270.00-
gpt-5.4-pro$30.00$180.00-$60.00$270.00-
gpt-5.4$2.50$15.00$0.25$5.00$22.50$0.50
gpt-5.4-mini$0.75$4.50$0.075---
gpt-5.4-nano$0.20$1.25$0.02---
gpt-5.2$1.75$14.00$0.175---
gpt-5.1 / gpt-5$1.25$10.00$0.125---
gpt-5-mini$0.25$2.00$0.025---
gpt-5-nano$0.05$0.40$0.005---
gpt-4.1 / o3$2.00$8.00$0.50---
gpt-4.1-mini$0.40$1.60$0.10---
gpt-4o$2.50$10.00$1.25---
gpt-4o-mini$0.15$0.60$0.075---
o3-pro$20.00$80.00----

Promotional pricing for gpt-5.6-sol is available until November 30, 2026. If you're comparing against other ecosystems, check out our breakdowns for What does the Claude API cost per million tokens?, What does the Gemini API cost per million tokens?, or What does the DeepSeek API cost?.

Domain and specialized models

OpenAI also maintains specialized configurations with dedicated pricing:

  • gpt-6-cyber costs $20.00 input, $100.00 output, and $2.00 cached input per 1M tokens in short context.
  • gpt-6-rosalind (life sciences) costs $15.00 input, $75.00 output, and $1.50 cached input in short context, rising to $30.00 input, $112.50 output, and $3.00 cached input in long context.
  • gpt-6-astra-law costs $10.00 input, $50.00 output, and $1.00 cached input per 1M tokens under promotional pricing available at least through December 31, 2026.
  • gpt-5.3-codex costs $1.75 input, $14.00 output, and $0.175 cached input per 1M tokens on Standard pricing (or $3.50 input, $28.00 output, and $0.35 cached under Fast pricing).
  • text-embedding-3-small costs $0.02 per 1M tokens, text-embedding-3-large is $0.13, and text-embedding-ada-002 is $0.10. omni-moderation-latest is free.

OpenAI is winding down its fine-tuning platform. It's no longer accessible to new users, though existing users can run training jobs for the coming months. Fine-tuned variants like gpt-4.1-2025-04-14 cost $25.00 per 1M training tokens, $3.00 for input, and $12.00 for output.

Prompt caching, Batch, Flex, and execution tiers

Understanding how and when requests run can slash your monthly token bill by half or more.

Prompt caching and cache writes

Prompt caching reads identical prefixes at a fraction of standard input cost. For models supporting extended cache retention, cache writes carry a separate charge:

  • On gpt-6-astra, cache writes cost $12.50 per 1M tokens for a 30m cache write and $25.00 per 1M tokens for a 12h cache write in short context ($25.00 and $50.00 in long context).
  • On gpt-6.1-sol, cache writes cost $2.50 per 1M tokens for a 30m write and $5.00 for a 12h write in short context ($5.00 and $10.00 in long context).
  • On gpt-6.1-terra, cache writes cost $1.25 per 1M tokens for 30m and $2.50 for 12h in short context.
  • On gpt-6-luna, cache writes cost $0.125 per 1M tokens for 30m and $0.25 for 12h in short context.

Batch and Flex pricing

The Batch API offers a straight 50% discount on inputs and outputs by running tasks asynchronously over 24 hours. For example, under Batch pricing, gpt-6-astra short context drops to $5.00 input and $25.00 output per 1M tokens, while gpt-6.1-sol drops to $1.00 input and $5.00 output.

Flex processing provides lower request costs in exchange for slower response times and occasional resource unavailability, making it suitable for non-production or lower priority tasks. Flex matches Batch token prices for models like gpt-6-astra and gpt-6.1-sol. However, caching rules vary: under Batch pricing, gpt-4.1, gpt-4.1-mini, gpt-4o, gpt-4o-mini, o3-pro, and o3 do not offer cached input discounts, whereas under Flex pricing, o3 offers cached input at $0.25 per 1M tokens.

Fast, Ultrafast, and Regional uplifts

If you need low latency under high load, you can pay a premium:

  • Priority processing was renamed Fast mode on July 30, 2026. Under Fast pricing, gpt-6-astra short context doubles to $20.00 input and $100.00 output per 1M tokens.
  • Ultrafast pricing pushes rates higher: gpt-6-astra reaches $60.00 input and $300.00 output per 1M tokens in short context, while gpt-6.1-sol costs $12.00 input and $60.00 output.
  • Regional processing (data residency) endpoints charge a 10% price uplift for models released on or after March 5, 2026. FedRAMP endpoints also carry a 10% uplift.

Tool calls, multimodal audio, and containers

Non-token charges often surprise developers building automated agents.

Tools and search

  • Web search: The standard Web search tool (including all models, Image Web search, and Web search preview on reasoning models like gpt-5 and the o-series) costs $10.00 per 1,000 calls plus search content tokens billed at the chosen model's rates. When using gpt-4o-mini or gpt-4.1-mini with the non-preview web search tool, search content tokens are billed as a fixed block of 8,000 input tokens per call.
  • Web search preview: On non-reasoning models, this tool costs $25.00 per 1,000 calls, but search content tokens are free.
  • File search: Tool calls cost $2.50 per 1,000 calls (applicable to the Responses API only). Vector storage costs $0.10 per GB per day with the first 1 GB free. In OpenAI tool pricing, GB refers to binary gigabytes (gibibytes), where 1 GB equals 2^30 bytes.
  • Agent Kit: ChatKit file and image upload storage costs $0.10 per GB-day after 1 GB free per account per month.

Containers

Hosted Shell and Code Interpreter containers cost:

  • 1 GB: $0.03 per 20-minute session
  • 4 GB: $0.12 per 20-minute session
  • 16 GB: $0.48 per 20-minute session
  • 64 GB: $1.92 per 20-minute session

Eligible container sessions are billed by the minute with a 5-minute minimum per session.

Realtime voice and audio

  • gpt-live-1 voice sessions cost $0.05 per minute ($0.00083 per second) billed per second without rounding up to a whole minute. Backend model and tool usage is charged separately.
  • For gpt-realtime-2.1 and gpt-realtime-2, audio tokens cost $32.00 input, $64.00 output, and $0.40 cached per 1M tokens. Text tokens cost $4.00 input and $24.00 output.
  • For gpt-realtime-2.1-mini and gpt-realtime-mini, audio tokens drop to $10.00 input, $20.00 output, and $0.30 cached per 1M tokens. Text tokens cost $0.60 input and $2.40 output.
  • Text-to-speech: tts-1 costs $15.00 per 1M characters, and tts-1-hd costs $30.00 per 1M characters.
  • Transcription: gpt-realtime-translate is $0.034 per minute, gpt-live-transcribe and gpt-realtime-whisper are $0.017 per minute, Whisper is $0.006 per minute, and gpt-4o-mini-transcribe is $0.003 per minute.

A worked cost calculation

Let's look at an indexing pipeline processing customer support tickets using gpt-6.1-sol under Standard short-context pricing.

Assume your daily workload consists of:

  1. 3,000,000 fresh prompt input tokens.
  2. 2,000,000 cached prompt input tokens hitting your system prompt.
  3. 500,000 generated output tokens.
  4. 200 standard Web search tool calls, where search content tokens total 400,000 input tokens.

Here is how the daily billing breaks down:

  • Fresh input: 3M tokens * $2.00 / 1M = $6.00
  • Cached input: 2M tokens * $0.10 / 1M = $0.20
  • Output: 0.5M tokens * $10.00 / 1M = $5.00
  • Web search tool fees: (200 calls / 1,000) * $10.00 = $2.00
  • Web search content tokens: 0.4M tokens * $2.00 / 1M = $0.80

Your total daily bill is $14.00. Across 30 days, that's $420.00. If you migrated the non-urgent background batch part to the Batch API, input and output prices on those requests would drop by 50%.

Spending limits and opt-in brakes

OpenAI lets you configure a monthly budget in your billing settings to stop serving requests once reached, along with email alert thresholds and project-level restrictions. But there is a catch: OpenAI's official docs explicitly state there may be a delay in enforcing the limit, and you remain responsible for any overage incurred during that window. A runaway script firing concurrent requests can rack up significant bills before the enforcement kicks in.

That's where Costbrake fits in. Costbrake tracks your spend across cloud, AI and SaaS providers (including AWS, Azure, Google Cloud, Anthropic, and OpenAI). It checks usage hourly on the Free plan, every 5 minutes on Pro and Team, and ramps up to every 2 minutes during an active spike (triggered when an hour costs over 3x the 7-day hourly baseline and at least $5 more than usual).

For OpenAI, Costbrake connects via a Read only Admin key to poll the Usage and Costs APIs without having permission to run models or generate new keys. If you opt into killswitch brakes, you provide a separate Admin key with spend limit permissions.

When you confirm a brake in the dashboard:

  • Freeze project spend: Sets that specific project's hard monthly spend limit to $0.01. Once OpenAI enforces it (usually within minutes), calls in that project fail with a 429 project_spend_limit_exceeded error, leaving other projects running.
  • Freeze organization spend: Sets the organization-wide hard monthly limit to $0.01, throwing a 429 organization_spend_limit_exceeded across all projects.

Costbrake never executes brakes automatically; an admin must explicitly confirm the action, and every brake records prior state with an undo option. You can configure this by telling your coding agent to follow the agent setup instructions, or connect manually. For step-by-step guidance on setting limits directly in the OpenAI console, see How do I set a hard spending limit on the OpenAI API?. Check Costbrake pricing for details on plans and features.

Questions and answers

Is the OpenAI API free?

No, the OpenAI API is not free. All requests are billed per token or per tool call, though omni-moderation-latest is free and File search includes 1 GB of storage at no cost.

Does a ChatGPT Plus subscription cover OpenAI API usage?

No, API access is billed separately from ChatGPT Plus, Business, Enterprise, and Edu subscriptions. You must fund an API platform account to make API calls.

What is the difference between short context and long context pricing?

Short context applies to requests with 272K input tokens or fewer, while long context applies to requests with more than 272K input tokens. Long context rates are significantly higher for both inputs and outputs across all supported models.

How much can I save using the Batch API?

The Batch API provides an automatic 50% discount on input and output token rates across models. In exchange, jobs run asynchronously and return results within a 24-hour turnaround window.

What happens when an OpenAI monthly budget limit is reached?

OpenAI attempts to stop serving requests once your monthly hard limit is reached. However, enforcement can be delayed by several minutes, and your account is liable for any overage costs incurred before the cutoff takes effect.

Sources

Updated