N
NexusDigitalLabs
All articles
LLM CostJul 2026·6 min read

OpenAI API Pricing Explained: What You Actually Pay

OpenAI charges per token, not per request. Understanding how that works — and how input, output, and cached tokens are priced differently — is essential for managing API costs at any scale.

Every time you make an API call to OpenAI, you are charged for the number of tokens processed — both the tokens you send (input) and the tokens the model generates (output). The exact price depends on which model you use.

How Token Pricing Works

OpenAI prices are listed per 1 million tokens (per MTok). A token is roughly 4 characters of English text — about ¾ of a word. The phrase "the quick brown fox" is approximately 4 tokens.

Key prices for common models (approximate — check OpenAI's pricing page for current rates):

  • GPT-4o — Input: ~$2.50/MTok · Output: ~$10.00/MTok
  • GPT-4o mini — Input: ~$0.15/MTok · Output: ~$0.60/MTok
  • GPT-4.1 — Input: ~$2.00/MTok · Output: ~$8.00/MTok
  • o3-mini — Input: ~$1.10/MTok · Output: ~$4.40/MTok

Input vs Output Token Cost

Output tokens are consistently 3–5× more expensive than input tokens. This is a critical design consideration. An application that generates long responses will cost dramatically more than one that generates short, structured outputs for the same input length.

Practical implication: if you can get the same information from a 50-token response vs a 300-token response, instruct the model explicitly: "Respond in under 50 words." This alone can reduce per-call cost by 70–80%.

Real-World Cost Estimates

  • Simple classification (100 tokens in, 10 tokens out) on GPT-4o mini: ~$0.000021 per call. At 1M calls/month: ~$21.
  • Customer support reply (500 tokens in, 200 tokens out) on GPT-4o: ~$0.00325 per call. At 10,000 calls/month: ~$32.50.
  • Long-form content generation (1,000 tokens in, 1,500 tokens out) on GPT-4o: ~$0.0175 per call. At 1,000 calls/month: ~$17.50.

Three Ways to Reduce Your Bill Without Changing Models

  • Trim your system prompt — most system prompts contain redundant instructions. Every unnecessary sentence adds to input cost on every single call.
  • Use structured output — instruct the model to respond in JSON with defined keys. Short structured responses cost less than verbose prose answers.
  • Cache repeated context — if your system prompt or knowledge base context is static, take advantage of prompt caching to reduce input cost by ~50%.

When to Choose a Smaller Model

GPT-4o mini handles most tasks that do not require complex reasoning — classification, entity extraction, summarisation, simple Q&A, template filling. It costs roughly 15–17× less than GPT-4o. Running a quick A/B test on your specific use case with both models before committing to the expensive one is always worth 30 minutes of effort.

Frequently Asked Questions

What counts as one token?

Roughly 4 characters of English text, or about ¾ of a word. "Hello world" is approximately 3 tokens. "The quick brown fox jumps over the lazy dog" is approximately 10 tokens. Code and non-English languages are often more token-dense.

Are input and output tokens priced the same?

No. Output tokens (the model's response) are typically 3–4× more expensive than input tokens across OpenAI models. This matters for applications that generate long responses — optimising output length has a disproportionate impact on cost.

What is prompt caching and does it save money?

OpenAI offers discounted rates for repeated prompt prefixes via caching. If your system prompt stays the same across many calls, cached input tokens cost roughly 50% less. Caching is particularly valuable for large system prompts or RAG pipelines with static context.

How do I estimate costs before building?

Estimate your average prompt length in tokens, add your expected average response length, and multiply by the per-token rate for your chosen model. Then multiply by your expected request volume. Use the Prompt Architect tool to measure token counts for your specific prompts.

Is GPT-4o always the best choice?

Not for every use case. GPT-4o mini costs roughly 15× less than GPT-4o and handles the majority of classification, extraction, summarisation, and conversational tasks with comparable quality. Use GPT-4o when you need complex reasoning, nuanced writing, or difficult code generation.

Free tool

Prompt Architect — Token Counter & Cost Estimator

Paste your prompt and see its exact token count plus real-time cost estimates for GPT-4o, GPT-4o mini, Claude, and Gemini — all client-side, nothing sent to any server.

Open Prompt Architect
Buy me a coffee?