← Back to WeighMyPrompt

GPT-4o Pricing Calculator

Last updated: April 15, 2026 · 5 min read

GPT-4o is OpenAI's most capable general-purpose model. This guide breaks down its exact pricing and shows you how to calculate costs before making API calls.

GPT-4o pricing

MetricValue
Input price$5.00 per million tokens ($0.000005 per token)
Output price$15.00 per million tokens ($0.000015 per token)
Context window128,000 tokens
Encodingo200k_base
Speed~95 tokens/second output

Quick cost examples

ScenarioInput tokensOutput tokensCost
Short question + answer50150$0.0025
Code review (1 file)5001,500$0.025
Long document summary5,000500$0.0325
Full codebase analysis50,00010,000$0.40

GPT-4o vs alternatives

ModelInput/1MOutput/1MCost for 1K in + 3K out
GPT-4o$5.00$15.00$0.050
GPT-4o mini$0.15$0.60$0.002
Claude 3.5 Sonnet$3.00$15.00$0.048
Gemini 1.5 Pro$3.50$10.50$0.035
Gemini 2.0 Flash$0.10$0.40$0.001

How to reduce GPT-4o costs

  1. Use GPT-4o mini for simple tasks — it's 33x cheaper and often just as good for classification, extraction, and simple Q&A.
  2. Optimize your prompts — remove filler words, shorten instructions. WeighMyPrompt's optimizer does this automatically.
  3. Cache system prompts — OpenAI supports prompt caching. Reuse the same system prompt across requests to save on input tokens.
  4. Limit output length — set max_tokens in your API call to prevent unexpectedly long responses.
  5. Batch requests — OpenAI's Batch API offers 50% discount on eligible requests.

Calculate your exact cost

Use WeighMyPrompt to paste your prompt and see the exact token count and cost for GPT-4o — plus compare instantly with 15 other models. 100% free, runs in your browser.