← 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
| Metric | Value |
| Input price | $5.00 per million tokens ($0.000005 per token) |
| Output price | $15.00 per million tokens ($0.000015 per token) |
| Context window | 128,000 tokens |
| Encoding | o200k_base |
| Speed | ~95 tokens/second output |
Quick cost examples
| Scenario | Input tokens | Output tokens | Cost |
| Short question + answer | 50 | 150 | $0.0025 |
| Code review (1 file) | 500 | 1,500 | $0.025 |
| Long document summary | 5,000 | 500 | $0.0325 |
| Full codebase analysis | 50,000 | 10,000 | $0.40 |
GPT-4o vs alternatives
| Model | Input/1M | Output/1M | Cost 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
- Use GPT-4o mini for simple tasks — it's 33x cheaper and often just as good for classification, extraction, and simple Q&A.
- Optimize your prompts — remove filler words, shorten instructions. WeighMyPrompt's optimizer does this automatically.
- Cache system prompts — OpenAI supports prompt caching. Reuse the same system prompt across requests to save on input tokens.
- Limit output length — set
max_tokens in your API call to prevent unexpectedly long responses.
- 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.