OpenAI API cost calculator
Filtered to OpenAI’s current models. Set your tokens and traffic to see what GPT-5, GPT-5 mini, GPT-4.1 and GPT-4o cost per month, with cached input and the Batch API.
| Model | Per month |
|---|
Picking between GPT-5 and the smaller models
GPT-5 mini costs a fifth of GPT-5 for both input and output. For classification, extraction and short support replies it is usually enough; keep GPT-5 for reasoning-heavy or customer-visible writing.
GPT-4.1 has the largest context window in the lineup, about a million tokens, which matters for long documents more than its per-token price does.
Where the money goes
Output tokens cost eight times input on GPT-5. A chatbot that answers in long paragraphs can spend more on output than on the whole prompt. Capping response length is often the cheapest optimization.
OpenAI caches repeated prompt prefixes automatically for long prompts, at a tenth of the input price on GPT-5. Put stable instructions first so more of each request repeats.
| Model | Input | Cached input | Output | Context |
|---|---|---|---|---|
| GPT-5 | $1.25 | $0.125 | $10.00 | 400K |
| GPT-5 mini | $0.25 | $0.025 | $2.00 | 400K |
| GPT-4.1 | $2.00 | $0.50 | $8.00 | 1.05M |
| GPT-4.1 mini | $0.40 | $0.10 | $1.60 | 1.05M |
| GPT-4o | $2.50 | $1.25 | $10.00 | 128K |
Other AI setups
- OpenAI API cost calculator
- Claude API cost calculatorHaiku · Sonnet · Opus
- Gemini API cost calculatorFlash · Pro
- DeepSeek API cost calculatorOff-peak rates
- Prompt caching savings calculatorCached vs uncached
- AI agent cost calculator20 turns
- Context window calculator128K to 1M
- Private token counter
Related
Questions
Is GPT-5 cheaper than GPT-4o?
Yes, on input: $1.25 against $2.50 per million tokens. Output is the same at $10. For most workloads GPT-5 costs less than GPT-4o.
Does OpenAI charge for cached tokens?
Yes, at a discount: cached input on GPT-5 costs a tenth of normal input. Caching applies automatically to repeated prompt prefixes above a minimum length.
When is the Batch API worth it?
For work that can wait up to a day: nightly summaries, evaluations, bulk classification. It halves the price of both input and output.
Are reasoning tokens counted as output?
Yes. Reasoning models bill their internal reasoning as output tokens, so set the output estimate higher than the visible answer for reasoning-heavy tasks.