Skip to main content
Comparison7 min readPublished: 2026-07-29Updated: 2026-07-29

OpenAI API Pricing Explained (2026 Guide)

Understand OpenAI API pricing: GPT-4o and o-series model rates, token-based billing, input vs output pricing, cached prompt discounts, Batch API savings, and how to estimate your costs.

How OpenAI API Pricing Works

OpenAI charges per token, not per request. A token is roughly 4 characters of English text, or about 3/4 of a word. A 1,000-word English article is approximately 1,300 tokens.

Every API call has two token counts: input tokens (the prompt you send) and output tokens (the model's response). These are billed at different rates — output tokens are typically 3-4x more expensive than input tokens.

Chinese text uses more tokens per character than English because tokenizers are optimized for Latin scripts. A Chinese character typically costs 1-2 tokens, so factor this in when estimating costs for Chinese-language applications.

GPT-4o & GPT-4o-mini Pricing

GPT-4o is OpenAI's flagship multimodal model, supporting text, image, and audio inputs. GPT-4o-mini is the cost-optimized version, recommended for most general-purpose tasks.

  • GPT-4o: $2.50 / 1M input tokens, $10.00 / 1M output tokens
  • GPT-4o: $1.25 / 1M cached input tokens (50% discount)
  • GPT-4o-mini: $0.15 / 1M input tokens, $0.60 / 1M output tokens
  • GPT-4o-mini: $0.075 / 1M cached input tokens (50% discount)

o-Series Reasoning Model Pricing

The o-series models (o1, o3, o4-mini) are designed for complex reasoning tasks like math, coding, and scientific analysis. They use internal 'thinking' tokens that are billed as output tokens, which makes them significantly more expensive per call than GPT-4o models.

Because reasoning models generate extensive internal chain-of-thought before producing the final answer, the actual output token count can be much higher than the visible response length. Always test with real workloads to understand the actual cost.

  • o3: $10.00 / 1M input tokens, $40.00 / 1M output tokens
  • o3-mini: $1.10 / 1M input tokens, $4.40 / 1M output tokens
  • o4-mini: $1.10 / 1M input tokens, $4.40 / 1M output tokens
  • o-series cached input: 75% discount (e.g., o3-mini at $0.275 / 1M)

Cached Input Token Discount

OpenAI offers prompt caching for repeated prefixes. If your API requests share the same leading prompt (e.g., system instructions, few-shot examples), the cached portion is billed at a 50% discount for GPT-4o models and 75% for o-series models.

Caching is automatic — you don't need to configure anything. The cache typically persists for 5-10 minutes of inactivity, and the minimum cacheable prefix is 1,024 tokens. For applications with long system prompts, caching can significantly reduce costs.

Batch API (50% Discount)

If your use case doesn't require real-time responses, the Batch API offers a 50% discount on all models. You submit a batch of requests (up to 50,000 per file), and OpenAI processes them within 24 hours (typically much faster).

Batch API is ideal for bulk processing tasks like content classification, document summarization, data enrichment, and evaluation runs. The request format is identical to the standard API — you only need to wrap your requests in a JSONL file and submit it via the batch endpoint.

How to Estimate Your Costs

To estimate your monthly API cost, multiply your expected input tokens per request by the input price, plus the expected output tokens by the output price, then multiply by the number of requests per month.

For example, using GPT-4o-mini with an average of 500 input tokens and 200 output tokens per call, at 10,000 calls per month: (500 × $0.15 + 200 × $0.60) / 1,000,000 × 10,000 = $1.95/month. This makes GPT-4o-mini extremely affordable for most applications.

For reasoning models, be extra careful with estimates. A complex coding question on o3 might generate 5,000+ hidden reasoning tokens, making a single call cost $0.20+ instead of the $0.01 you might expect from the visible output alone.

python
# Cost estimation example for GPT-4o-mini
input_tokens_per_call = 500
output_tokens_per_call = 200
calls_per_month = 10_000

input_price = 0.15  # per 1M tokens
output_price = 0.60  # per 1M tokens

monthly_cost = (
    input_tokens_per_call * input_price
    + output_tokens_per_call * output_price
) / 1_000_000 * calls_per_month

print(f"Estimated monthly cost: ${monthly_cost:.2f}")
# Output: Estimated monthly cost: $1.95

Python script to estimate monthly OpenAI API costs

Free Credits & Trial

New OpenAI accounts may receive approximately $5 in trial credits. These credits expire a few months after account creation and are intended for testing the API before committing to paid usage.

There is no permanent free tier for the OpenAI API. Once trial credits are exhausted or expired, you must add funds to continue using the API. Set up billing alerts to avoid unexpected charges.

FAQ

Which OpenAI model is the cheapest?

GPT-4o-mini is the most affordable model in OpenAI's lineup at $0.15/1M input and $0.60/1M output tokens. For even lower costs, use the Batch API to get an additional 50% discount, bringing it down to $0.075/1M input and $0.30/1M output.

Why are reasoning models (o-series) so expensive?

Reasoning models generate internal chain-of-thought tokens before producing the visible answer. These hidden tokens are billed as output tokens, which can be 5-20x the length of the final response. This is the cost of deeper reasoning — o-series models are designed for tasks where accuracy matters more than cost.

How can I reduce my OpenAI API costs?

Use these strategies: (1) Switch to GPT-4o-mini for tasks that don't require GPT-4o-level intelligence. (2) Enable prompt caching by keeping system prompts consistent. (3) Use the Batch API for non-real-time workloads to get 50% off. (4) Set max_tokens limits to prevent runaway responses. (5) Cache API responses on your side for identical queries.

Are OpenAI API prices the same worldwide?

Yes, OpenAI API prices are the same globally and are charged in USD. However, your bank may charge foreign transaction fees or currency conversion fees depending on your card and country.

Does OpenAI charge for failed API requests?

You are not charged for requests that fail due to server errors (5xx). However, you are charged for requests that fail due to client errors (4xx, like invalid parameters) if the model already processed the input tokens. Rate-limited requests (429) are not billed.

Related Providers

Sources