OpenAI · Updated 2026-07-22

OpenAI API Pricing 2026: GPT-4o, o3, o4-mini Costs

Complete per-million-token pricing for every current OpenAI API model — GPT-4o, GPT-4o-mini, o3 and o4-mini. Compare standard, cached and batch rates side by side, then cross-reference against Anthropic, Google and DeepSeek on the main calculator.

Cheapest OpenAI model for coding

GPT-4o-mini $0.15 input / $0.60output per million tokens. Supports code generation, review and agentic coding at a fraction of GPT-4o's price.

OpenAI pricing per million tokens

USD per 1,000,000 tokens. Cached rate applies to repeated input prefixes; Batch rate requires 24-hour async turnaround.

ModelInput $/MOutput $/MCached $/MBatch in $/MBatch out $/MContext
GPT-4o-mini$0.15$0.60$0.075$0.075$0.30128K
o4-mini$1.10$4.40$0.55$0.55$2.20200K
GPT-4o$2.50$10.00$1.25$1.25$5.00128K
o3$10.00$40.00$5.00$5.00$20.00200K

GPT-4o-mini

$0.15 in / $0.60 out · 128K context

ChatCodeVision

Cache saves 50% on input

o4-mini

$1.10 in / $4.40 out · 200K context

CodeReasoningVision

Cache saves 50% on input

GPT-4o

$2.50 in / $10.00 out · 128K context

ChatCodeVisionReasoning

Cache saves 50% on input

o3

$10.00 in / $40.00 out · 200K context

CodeReasoning

Cache saves 50% on input

OpenAI cost-saving levers

  • Prompt caching: repeated prefixes billed at 50% of input — automatic for prefixes of 1,024+ tokens.
  • Batch API: exactly 50% off both input and output, in exchange for 24-hour async turnaround.
  • Model tiering: route easy traffic to GPT-4o-mini and reserve GPT-4o / o3 for hard prompts — typically cuts total spend 60–80%.

Compare OpenAI against other providers

Frequently asked questions

How much does GPT-4o cost?

GPT-4o lists at $2.50 per million input tokens and $10.00 per million output tokens. With prompt caching enabled, repeated input drops to $1.25/M (50% off); via the Batch API (24-hour turnaround) both input and output halve to $1.25/M input and $5.00/M output.

Is o3 worth it?

OpenAI o3 is the most expensive model in the lineup at $10/M input and $40/M output — roughly 4× GPT-4o. It is worth it only for workloads that genuinely need frontier multi-step reasoning (competition-level math, deep code refactoring, agentic planning). For typical chat and code generation, GPT-4o or o4-mini deliver comparable output at a fraction of the cost.

Does OpenAI offer a batch API discount?

Yes. OpenAI Batch API gives exactly 50% off both input and output pricing in exchange for asynchronous (up to 24-hour) completion. Every model listed here supports it. Batch is ideal for non-latency-sensitive workloads like offline classification, evaluation, and bulk content generation.

Which OpenAI model is cheapest for coding?

GPT-4o-mini is the cheapest OpenAI model that supports code generation, at $0.15 input / $0.60 output per million tokens. For high-volume code workloads where quality is acceptable, it dramatically undercuts GPT-4o.

How does OpenAI prompt caching work?

OpenAI automatically caches repeated input prefixes (minimum 1,024 tokens) and serves cached input at 50% of the standard rate. Caching is applied automatically — no code change required — and is most valuable for long system prompts, few-shot examples, and conversational context that recurs across requests.