OpenAI API Pricing Calculator: 2026 Formula + Cost Table
An OpenAI API pricing calculator comes down to one formula: monthly cost = (input tokens × input rate + output tokens × output rate) ÷ 1,000,000 × requests per month. For example, take 1,000 requests a day, each with a 500-token prompt and a 300-token reply. On gpt-4o-mini that comes to about $7.65 a month. On gpt-5.5 the same traffic costs about $345 a month at the standard rates listed by OpenAI (as of October 2026; check the official page). The rest of this guide covers which model to price first, how to build the calculator, and the extra steps for voice, images, Batch and Azure.
Which option is right for you?
Pick a model by price first, then test quality on your own prompts. The table below uses only standard per-token rates from OpenAI's pricing page (as of October 2026; check the official page).
| Your situation | What to pick first | First page to open |
|---|---|---|
| Beginner, prototype or side project | gpt-6-luna ($0.10 in / $0.50 out per 1M), a current-generation model with very low rates | OpenAI pricing |
| Daily work use: production chat, support bot, internal tool | gpt-5.4-mini ($0.75 / $4.50) or gpt-6.1-sol ($2 / $10) if quality on hard prompts matters more | Usage dashboard to see real token counts |
| Tight budget, high volume, results can wait | gpt-5-nano ($0.05 / $0.40) via the Batch API at 50% off | Batch API Discount 2026 table |
| Voice agent | gpt-realtime-mini (audio $10 in / $20 out per 1M) | Realtime cost guide |
| Data residency or Microsoft contract required | Azure OpenAI Data Zone Standard | Azure OpenAI pricing |
Reasons in one line each. Luna-class pricing makes mistakes during prototyping cheap. The mini tier is the usual middle ground between cost and capability for user-facing apps. Batch halves the bill when you don't need answers in real time (OpenAI pricing). Realtime-mini audio costs less than a third of what full gpt-realtime charges. Azure suits teams whose compliance rules decide the provider before the price does.
These recommendations are based on price only. This page doesn't benchmark quality, so run 20–50 of your real prompts through two candidate models before you commit.
What Is OpenAI API Pricing?
OpenAI API pricing is a per-token charge, quoted per 1 million tokens, with separate rates for input, cached input and output that differ by model. There is no flat per-request fee (OpenAI pricing).
Here are standard text rates for widely used models, per 1M tokens (as of October 2026; check the official page):
| Model | Input | Cached input | Output |
|---|---|---|---|
| gpt-6-astra | $10.00 | $1.00 | $50.00 |
| gpt-6.1-sol | $2.00 | $0.10 | $10.00 |
| gpt-6-luna | $0.10 | $0.01 | $0.50 |
| gpt-5.5 (≤272K context) | $5.00 | $0.50 | $30.00 |
| gpt-5.4-mini | $0.75 | $0.075 | $4.50 |
| gpt-5-mini | $0.25 | $0.025 | $2.00 |
| gpt-5-nano | $0.05 | $0.005 | $0.40 |
| gpt-4.1-nano | $0.10 | $0.025 | $0.40 |
| gpt-4o | $2.50 | $1.25 | $10.00 |
| gpt-4o-mini | $0.15 | $0.075 | $0.60 |
| o1 | $15.00 | $7.50 | $60.00 |
Source: OpenAI API pricing.
Four modifiers change the effective rate:
- Batch: 50% off input and output tokens, with asynchronous results. Flex matches Batch rates on selected models (OpenAI pricing).
- Fast costs 2–4× standard rates and Ultrafast costs 6× (OpenAI pricing).
- Long context: "Short context: ≤272K input tokens. Long context: >272K input tokens." Some models, gpt-5.5 among them, charge a different rate above that line (OpenAI pricing).
- Regional processing (data residency) endpoints carry a 10% uplift for models released on or after , and so do FedRAMP endpoints (OpenAI pricing).
Tools have their own charges on top of tokens. Web search is listed at $10 per 1,000 calls plus model tokens, and code interpreter sessions start at $0.03 (OpenAI pricing).
Pitfall: output is the expensive side. On gpt-5.5, output costs 6× input ($30 vs $5), so a verbose reply style can cost more than a long prompt. Fix it by setting a maximum output length and asking for concise answers in the system prompt.
How Much Does the OpenAI API Actually Cost?
What you actually pay depends on tokens per request and requests per month. The sticker rate matters less than you'd think: a chatbot that re-sends long chat history can cost several times more than a short-answer app running on the same model.
OpenAI's Chat-style APIs are stateless from a billing point of view. Every turn you send counts as input, including earlier messages you include for context. The Realtime cost guide states it plainly for voice sessions: "The entire conversation is sent to the model for each Response," so "turns later in the session will be more expensive."
Here is an example on gpt-4o-mini, with 30,000 requests a month and a 300-token reply each time:
| App shape | Input tokens per request | Monthly input cost | Monthly output cost | Total |
|---|---|---|---|---|
| Short Q&A | 500 | $2.25 | $5.40 | $7.65 |
| Chat with 4,000-token history | 4,000 | $18.00 | $5.40 | $23.40 |
| Chat with 15,000-token history | 15,000 | $67.50 | $5.40 | $72.90 |
Same model, same reply length, and the bill is about 9.5× higher in the last row. All of the difference comes from context.
Two more line items get missed often:
- Reasoning tokens. Reasoning-capable models generate internal reasoning tokens that are billed as output tokens even though you don't see them in the reply (OpenAI reasoning guide). Check
usage.output_tokens_details.reasoning_tokensin responses to measure this. - Caching discounts. Repeated prompt prefixes can be billed at the cached-input rate. On GPT-5.6 and later, caching applies from 1,024 visible input tokens, and cached reads cost about 0.1× the normal input rate on most of those models (OpenAI prompt caching). Put static instructions first and variable user text last so the prefix stays identical.
Usage tiers cap how much you can spend before you've built up payment history. Free allows $100 a month. Build ($5 in credit purchases) allows $500, Launch ($100) allows $5,000, and Grow ($500) allows $200,000 (OpenAI rate limits). If your estimate is above your tier's cap, requests will fail before the bill ever gets that high.
Pricing Examples: How to Estimate Cost for a Real App
To estimate cost for a real app, multiply (input tokens × input rate + output tokens × output rate) by requests per month, then divide by 1,000,000.
Example scenario: a support assistant handles 1,000 requests per day for 30 days, so 30,000 requests. Each request has a 500-token prompt and a 300-token response.
- Monthly input tokens: 500 × 30,000 = 15,000,000 (15M).
- Monthly output tokens: 300 × 30,000 = 9,000,000 (9M).
- Input cost = 15 × input rate per 1M.
- Output cost = 9 × output rate per 1M.
- Add them together, then halve the result if the workload can run through Batch.
Applied to standard rates from OpenAI's pricing page (as of October 2026):
| Model | Input cost (15M) | Output cost (9M) | Monthly total | With Batch (−50%) |
|---|---|---|---|---|
| gpt-5-nano | $0.75 | $3.60 | $4.35 | $2.18 |
| gpt-4.1-nano | $1.50 | $3.60 | $5.10 | $2.55 |
| gpt-6-luna | $1.50 | $4.50 | $6.00 | $3.00 |
| gpt-4o-mini | $2.25 | $5.40 | $7.65 | $3.83 |
| gpt-5-mini | $3.75 | $18.00 | $21.75 | $10.88 |
| gpt-5.4-mini | $11.25 | $40.50 | $51.75 | $25.88 |
| gpt-6.1-sol | $30.00 | $90.00 | $120.00 | $60.00 |
| gpt-4o | $37.50 | $90.00 | $127.50 | $63.75 |
| gpt-5.5 | $75.00 | $270.00 | $345.00 | $172.50 |
| o1 | $225.00 | $540.00 | $765.00 | $382.50 |
The most and least expensive models in this table differ by a factor of 175 for the same traffic. On reasoning models, real output will usually be higher than 300 tokens because of reasoning tokens, so treat the o-series and GPT-5-family rows as a minimum.
If you want to see these numbers next to Anthropic, Google and other providers, the LLM API Pricing Comparison 2026 runs a similar method across five vendors, and Cheapest LLM API in 2026 sorts them by cost per 1M tokens.
How to Use an OpenAI API Cost Calculator
An OpenAI API cost calculator only needs five inputs: model rates, average input tokens, average output tokens, requests per day and a discount factor. A spreadsheet is enough.
Spreadsheet version (Google Sheets or Excel)
- Make these column headers in row 1:
Model,In rate,Out rate,In tokens,Out tokens,Req/day,Discount,Monthly $. - Copy the rates from OpenAI's pricing page into B and C, one model per row.
- Put measured averages in D and E. Don't guess here; the next section shows where to get the real numbers.
- Put
1in G for standard pricing and0.5for Batch or Flex. - In H2, enter:
=((B2*D2 + C2*E2)/1000000)*F2*30*G2 - Fill down. Add a row with your expected growth, for example
F2*3, to see what happens at three times the traffic.
Code version (Python)
# Rates per 1M tokens (as of Oct 2026; check developers.openai.com/api/docs/pricing)
PRICES = {
"gpt-6-luna": (0.10, 0.50),
"gpt-4o-mini": (0.15, 0.60),
"gpt-5.4-mini": (0.75, 4.50),
"gpt-6.1-sol": (2.00, 10.00),
}
def monthly_cost(model, in_tok, out_tok, req_per_day, days=30, discount=1.0):
in_rate, out_rate = PRICES[model]
per_request = (in_tok * in_rate + out_tok * out_rate) / 1_000_000
return per_request * req_per_day * days * discount
print(round(monthly_cost("gpt-4o-mini", 500, 300, 1000), 2)) # 7.65
Limitations: this calculator ignores cached-input discounts, tool fees and the long-context rate above 272K tokens. If more than half of your prompt is a fixed system prompt, add a cached-token column priced at the cached rate. Leave it out and your estimate will come in high.
Common mistake: using one blended token count for both input and output. Output costs 4–8× more on most current models, so a 50/50 guess can be far off. Pull the two numbers separately from the API's usage object.
Does Your OpenAI API Key Affect Pricing?
No. An API key has no price of its own. Usage is billed to the organization's billing account and summed across all keys and projects, so the practical question is how to track spend per key.
OpenAI's help center says the Usage Dashboard lets you export usage or cost data as CSV and group it by project, user, API key, model, batch or service tier (OpenAI Help: export monthly usage).
Steps to see spend per key:
- Sign in at platform.openai.com and select the organization and project.
- Click Usage in the sidebar (OpenAI Help).
- Export and group by API key (or by project). Use a 1-day interval to spot spikes.
- Go to Settings > Organization > Limits and set a spend alert, which notifies you while traffic continues, and a hard spend limit, which makes requests return a
429error once reached. Both can be set at the organization or project level (OpenAI rate limits).
Pitfalls and fixes:
- One key shared by every service. You can't tell which feature is driving cost. Create one project per app or environment, since projects show usage and support spend limits separately (OpenAI Help: projects).
- A leaked key running up charges. Never ship keys in client-side code, and rotate any key that has been exposed (OpenAI Help: key safety).
- A hard limit that breaks production. A
429at the cap stops your app. Set the alert well below the hard limit so someone can respond in time.
ChatGPT API Pricing vs ChatGPT Plus Subscription
ChatGPT subscriptions and the API are billed completely separately. A Plus or Pro plan includes no API usage, and the API charges per token whether or not you subscribe to ChatGPT (OpenAI Help: billing).
| ChatGPT (Go / Plus / Pro) | OpenAI API | |
|---|---|---|
| Billing | Flat monthly fee | Pay per token |
| Price | Go $8, Plus $20, Pro $100 or $200 per month, per third-party roundups (as of October 2026; confirm on chatgpt.com/pricing) | From $0.05 per 1M input tokens (gpt-5-nano) (OpenAI pricing) |
| Where you pay | ChatGPT settings | API platform billing settings |
| Best for | One person chatting in the app | Building features into your own product |
Which costs less depends on volume. The Plus fee of $20 buys 40M input tokens at gpt-4o-mini rates, which is roughly 50,000 short requests. A single person usually can't reach that by hand, but an app serving thousands of users can.
Pitfall: assuming a ChatGPT Business seat includes API credits. It doesn't; Business and the API platform are billed separately (OpenAI Help: billing). Add a payment method under API billing settings before you put API calls into production.
The same split applies to other vendors. If you're comparing against Anthropic, see Claude API Pricing vs Max Plan: Break-Even Table.
Azure OpenAI API Pricing Calculator: How It Differs from OpenAI's
Azure OpenAI sets its own prices by deployment type (Global, Data Zone, Regional) and billing mode (Standard pay-per-token, Batch, or Provisioned Throughput Units). These can differ from OpenAI's direct rates, so price both before you choose (Azure OpenAI pricing).
Example: gpt-4o-mini (0718) in East US 2, from the Azure Retail Prices API) (as of October 2026; check the official page):
| Option | Input per 1M | Cached input per 1M | Output per 1M |
|---|---|---|---|
| OpenAI direct | $0.15 | $0.075 | $0.60 |
| Azure Global Standard | $0.15 (third-party listing) | $0.075 | $0.60 |
| Azure Data Zone Standard | $0.165 | $0.083 | $0.66 |
Azure lists these as per-1K-token meters ($0.000165 per 1K for Data Zone input), so multiply by 1,000 before comparing them with OpenAI's per-1M figures.
Provisioned Throughput Units (PTUs) are billed per hour whether or not you send any tokens (Microsoft Learn). East US 2 list prices from the Azure Retail Prices API%20and%20armRegionName%20eq%20'eastus2'), as of October 2026:
| PTU type | Hourly | 1-month reservation | 1-year reservation |
|---|---|---|---|
| Global | $1.00 / PTU / hr | $260 / PTU | $2,652 / PTU |
| Data Zone | $1.10 / PTU / hr | $286 / PTU | $2,916 / PTU |
| Regional | $2.00 / PTU / hr | $286 / PTU | $2,916 / PTU |
Each model has a minimum PTU count per deployment, and a reservation doesn't guarantee capacity. Microsoft says to create the deployment first and then buy the reservation (Microsoft Learn). For sizing, use the PTU capacity calculator in the Foundry portal (linked from the same page).
Who PTUs suit: teams with steady, predictable traffic and strict latency needs. Who they don't suit: prototypes and spiky traffic. Microsoft itself says Standard deployments are the better fit for "development, testing, low-volume usage, or highly variable traffic" (Microsoft Learn).
Realtime API Pricing: What Changes with Voice/Streaming
The Realtime API bills audio tokens separately from text tokens, and audio rates are much higher. That changes the formula for voice apps.
Rates per 1M tokens (as of October 2026; check the official page):
| Model | Audio in | Audio out | Cached audio in | Text in | Text out |
|---|---|---|---|---|---|
| gpt-realtime-2.1 | $32 | $64 | $0.40 | $4 | $24 |
| gpt-realtime-2.1-mini | $10 | $20 | $0.30 | $0.60 | $2.40 |
| gpt-realtime-mini | $10 | $20 | $0.30 | $0.60 | $2.40 |
The conversion step is time to tokens. User audio is 1 token per 100 ms and assistant audio is 1 token per 50 ms (Realtime costs). So one minute of user speech is 600 tokens, and one minute of model speech is 1,200 tokens.
Example: a 5-minute call with 2.5 minutes of user speech (1,500 tokens) and 2.5 minutes of assistant speech (3,000 tokens).
- gpt-realtime-mini floor: 1,500 × $10/1M + 3,000 × $20/1M = $0.015 + $0.06 = $0.075 per call
- gpt-realtime-2.1 floor: 1,500 × $32/1M + 3,000 × $64/1M = $0.048 + $0.192 = $0.24 per call
These are minimums. Each turn re-sends the whole conversation as input, so input tokens grow as the call goes on. Much of that history is billed at the cached rate, provided you don't edit earlier items, because "removing or changing content in the conversation will 'bust' the cache" (Realtime costs). For budgeting, log usage from a few test calls and use the measured input-to-output ratio instead of the floor.
Vision API Pricing: How Image Inputs Are Counted as Tokens
Images are converted into a token count based on size and the detail setting, then billed at the model's normal input rate. Estimating cost therefore takes one extra step: image to tokens.
Per the OpenAI vision guide, detail can be low, high, original or auto, and it defaults to auto when omitted. Models use one of two counting methods.
Tile-based (gpt-4o, gpt-4o-mini, gpt-5.1): base tokens plus tokens per 512 px tile.
| Model | Base tokens | Per tile |
|---|---|---|
| gpt-5.1 | 70 | 140 |
| gpt-4o | 85 | 170 |
| gpt-4o-mini | 2,833 | 5,667 |
Steps for a 1024 × 1024 image at detail: high on gpt-4o:
- Scale it to fit inside 2048 × 2048. No change is needed.
- Scale so the shortest side is 768 px, which gives 768 × 768 (vision guide).
- Count 512 px tiles: 2 × 2 = 4.
- Tokens = 85 + 170 × 4 = 765.
- Cost = 765 × $2.50/1M ≈ $0.0019 per image.
On gpt-4o-mini the same image is 2,833 + 5,667 × 4 = 25,501 tokens. At $0.15/1M that's about $0.0038, which is double the gpt-4o price per image even though mini's text rates are far lower. If your app is image-heavy, compare per-image cost and not just per-token cost.
Patch-based (newer models): the image is split into 32 px patches, ceil(width/32) × ceil(height/32), then a model-specific multiplier between 1.2 and 2.46 is applied. The guide's example: a 1024 × 1024 image on gpt-6-astra at detail: high comes to 1,024 patches, or 1,229 billable tokens (vision guide). At $10/1M input, that's about $0.012 per image.
Common mistake: sending full-resolution screenshots when low detail would do, for example for classification. Resize images on your side first, or set detail: "low" where fine text doesn't matter.
How to Calculate Token Price for Any Model
To calculate token price for any model, convert text to tokens, multiply input and output tokens by their separate per-1M rates, and add the two.
- Count tokens. Paste sample text into the OpenAI Tokenizer, or use the open-source tiktoken library in code. A rough rule for English is about 4 characters, or ¾ of a word, per token (OpenAI Help: tokens). Non-English text often uses more tokens per word, so measure it rather than applying the English rule.
- Split input and output. Input includes the system prompt, chat history, tool definitions and any retrieved documents.
- Apply rates. Cost = input × in-rate / 1M + output × out-rate / 1M.
- Check against reality. After a few live calls, compare your estimate with the
usagefield in the response.
Quick reference, cost per single request (as of October 2026, OpenAI pricing):
| Request shape (example) | gpt-6-luna | gpt-5.4-mini | gpt-6.1-sol |
|---|---|---|---|
| 200 in / 100 out (short chat) | $0.00007 | $0.0006 | $0.0014 |
| 2,000 in / 500 out (RAG answer) | $0.00045 | $0.00375 | $0.009 |
| 20,000 in / 1,000 out (document summary) | $0.0025 | $0.0195 | $0.05 |
Multiply any cell by your monthly request count to get a monthly figure. For example, 100,000 RAG answers on gpt-5.4-mini come to $375.
Next steps
Your first move is to measure real token counts, plug them into the formula, and set a spend alert before launch.
Do it yourself today:
- Send 20 representative requests to your top two candidate models and record
input_tokens,output_tokensand any reasoning tokens from each response. - Put those averages into the spreadsheet formula above. Run the numbers at 1×, 3× and 10× your expected traffic, at standard and Batch rates.
- Open Settings > Organization > Limits and set a spend alert at about 50% of your budget, plus a hard limit above it (OpenAI rate limits).
If you'd rather not manage capacity yourself: Azure OpenAI Provisioned Throughput gives you a fixed monthly cost. For example, a Global PTU on a 1-month reservation lists at $260 per PTU (Azure Retail Prices API%20and%20armRegionName%20eq%20'eastus2'), as of October 2026; check the official page). It suits teams with steady, high, latency-sensitive traffic who are already on Azure. It doesn't suit prototypes, small apps or spiky usage, because you pay every hour whether tokens flow or not, model minimums apply, and capacity isn't guaranteed (Microsoft Learn). Most small teams are better off on pay-as-you-go with spend limits.
Related guides on this site:
- Batch API Discount 2026: OpenAI vs Claude vs Gemini Table
- LLM API Pricing Comparison 2026: 5 Providers, Real Costs
- Gemini API Pricing Free Tier 2026: Limits and Cost Math
FAQ
Is there an official OpenAI API cost calculator?
OpenAI publishes per-model rates on its pricing page and shows actual spend in the Usage dashboard. This guide doesn't point to a standalone official estimator because none was found during research. The spreadsheet formula above, ((in_rate × in_tokens + out_rate × out_tokens) / 1,000,000) × requests, gives you the same result.
How do I calculate the cost of a single OpenAI API call?
Read input_tokens and output_tokens from the response's usage object. Multiply each by its per-1M rate and divide by 1,000,000. For example, 500 input and 300 output tokens on gpt-4o-mini cost $0.000075 + $0.00018 = $0.000255.
Is Azure OpenAI cheaper than the OpenAI API?
Not by default. For gpt-4o-mini, Azure Global Standard matches OpenAI's $0.15/$0.60, and Data Zone costs 10% more at $0.165/$0.66 (Azure Retail Prices API)). Azure can come out cheaper only if your existing Microsoft agreement includes discounts.
Can I see API costs per API key?
Yes. In the Usage dashboard you can export cost data grouped by API key, project, user or model (OpenAI Help). The key has no price of its own; it's simply a label that billing usage gets attributed to.
Sources
- OpenAI API pricing
- OpenAI rate limits and usage tiers
- OpenAI prompt caching guide
- OpenAI reasoning models guide
- OpenAI Realtime API costs
- OpenAI images and vision guide
- OpenAI Tokenizer
- tiktoken on GitHub
- OpenAI Help: What are tokens and how to count them
- OpenAI Help: Managing billing for ChatGPT and the API platform
- OpenAI Help: Export monthly usage details
- OpenAI Help: Managing projects in the API platform
- OpenAI Help: Best practices for API key safety
- ChatGPT pricing
- ToolColumn: ChatGPT Free vs Go vs Plus vs Pro
- Azure OpenAI pricing
- Azure Retail Prices API: gpt-4o-mini meters, East US 2)
- Azure Retail Prices API: Provisioned Managed meters, East US 2%20and%20armRegionName%20eq%20'eastus2')
- AzureSpeed: GPT-4o mini 0718 Azure pricing
- Microsoft Learn: Provisioned throughput for Foundry Models
Spotted something out of date or wrong? Tell us at shigoto.ai.note@gmail.com. We check every guide against its official sources.