OpenAI API Monthly Cost Calculator
API costs can spiral fast if you're not tracking token usage carefully. This calculator estimates your monthly OpenAI API bill based on model choice, average input/output tokens per request, and daily request volume. It also shows the 50% Batch API discount impact and compares your projected cost against Claude 3.5 Sonnet and Gemini 1.5 Pro so you can make an informed model choice.
When to use this calculator
- Estimating monthly API budget before launching a new AI-powered product
- Comparing cost impact of upgrading from GPT-4o-mini to GPT-4o or o3
- Calculating Batch API savings for offline or asynchronous workloads
- Projecting costs as daily request volume scales up over time
- Benchmarking OpenAI pricing against Claude and Gemini for a given workload
- Planning infrastructure spend for a SaaS product with AI features
How it works
2 min readWhat is OpenAI API cost?
OpenAI API cost is the charge per token used when calling language models like GPT-4o or GPT-4o-mini. Pricing varies by model: GPT-4o costs $5 per 1M input tokens and $15 per 1M output tokens, while GPT-4o-mini costs $0.15 and $0.60 respectively. The Batch API offers 50% discounts for non-urgent requests.
How the Cost Formula Works
OpenAI charges separately for input tokens (the prompt + context you send) and output tokens (the completion the model generates). Prices are expressed per 1 million tokens.
Pricing Table (2026)
| Model | Input ($/M tokens) | Output ($/M tokens) |
|---|---|---|
| GPT-4o | $5.00 | $15.00 |
| GPT-4o mini | $0.15 | $0.60 |
| o3 | $15.00 | $60.00 |
Core Formula
daily_input_cost = (input_tokens × requests_per_day / 1,000,000) × input_price
daily_output_cost = (output_tokens × requests_per_day / 1,000,000) × output_price
cost_per_day = (daily_input_cost + daily_output_cost) × discount_factor
cost_per_month = cost_per_day × 30.44 // avg days per monthdiscount_factor = 0.50 when Batch API is enabled, 1.0 otherwise.
Worked Example
Assume: GPT-4o, 500 input tokens, 500 output tokens, 1,000 requests/day, no batch.
daily_input = (500 × 1000 / 1,000,000) × $5.00 = 0.5M tokens × $5 = $2.50
daily_output = (500 × 1000 / 1,000,000) × $15.00 = 0.5M tokens × $15 = $7.50
cost_per_day = $2.50 + $7.50 = $10.00
cost_per_month = $10.00 × 30.44 = $304.40With Batch API enabled, that drops to $5.00/day → $152.20/month.
Comparison Models (same workload)
For reference, the calculator also estimates cost using:
These are shown as informational comparisons only — exact pricing depends on your tier and may differ.
Limitations & When NOT to Rely on This Estimate
Frequently asked questions
What is a token?
A token is roughly 4 characters or ¾ of a word in English. The sentence 'OpenAI charges per token' is about 6 tokens. You can count tokens precisely using OpenAI's open-source tiktoken library or the Tokenizer tool in the OpenAI Playground.
What is the Batch API and when should I use it?
The OpenAI Batch API lets you submit a file of requests that are processed asynchronously within 24 hours. In exchange, you get a 50% discount on all input and output tokens. It's ideal for data processing, evals, content generation pipelines, and any workload that doesn't require a real-time response.
Does this calculator include image or audio tokens?
No. This calculator covers text tokens only. Image inputs (vision) are priced differently based on image size and detail level. Audio via Whisper or TTS is priced per minute of audio, not per token.
How accurate is the monthly estimate?
It assumes the same request volume every day of the month (×30.44 days). Real usage often has weekday/weekend variation. Treat this as a planning estimate, not a billing guarantee. Your actual invoice may differ due to caching, retries, and tier pricing.
Why is o3 so much more expensive than GPT-4o?
o3 is OpenAI's reasoning model. It runs an internal chain-of-thought process (called 'thinking tokens') before producing a final answer, which consumes substantially more compute. It's best suited for complex coding, math, and multi-step logic tasks where accuracy justifies the cost.
Does OpenAI offer volume discounts?
OpenAI's public API pricing (shown here) applies to pay-as-you-go users. Enterprise contracts may include negotiated discounts not reflected in these figures. Prompt Caching (automatic for prompts >1,024 tokens) can reduce effective input cost by ~50% for repeated context.
How do Claude and Gemini prices compare?
For a text-only workload in 2026, Gemini 1.5 Pro is generally the cheapest of the three at $1.25/M input and $5.00/M output (up to 128K context). Claude 3.5 Sonnet sits at $3.00/M input and $15.00/M output. GPT-4o is $5.00/$15.00. o3 is the most expensive at $15.00/$60.00.
What if my input-to-output token ratio is very different?
Adjust the 'Avg Input Tokens' and 'Avg Output Tokens' fields to match your actual workload. RAG pipelines typically have large inputs (retrieved context) and short outputs. Chatbots often have moderate input and longer outputs. The ratio dramatically affects cost, especially on models with asymmetric pricing like o3.
Are there free tiers I should know about?
OpenAI's free tier (when available) provides a limited credit for new accounts, not a recurring free allowance. This calculator assumes you are past any free credit and paying standard per-token rates.