Skip to content

AI API Pricing Calculator

Compare token pricing across OpenAI, Anthropic, Google, DeepSeek, Perplexity, xAI, and Mistral models.

Calculate AI API Costs

Model Selection

OpenAI

Input Details

≈ 7,500 words

≈ 75,000 words

Documentation & Tips

Complete Guide to AI API Pricing

Quick Reference

Token Basics

  • 1 token ≈ 4 characters in English
  • 100 tokens ≈ 75 words
  • 1 page of text ≈ 750 words ≈ 1000 tokens

Cost Structure

  • Input tokens are cheaper
  • Output tokens cost more
  • Prices per million tokens

Understanding AI API Costs

AI language models process text in chunks called tokens. When using these APIs, you're charged based on the number of tokens processed, with separate pricing for input (your prompts) and output (the AI's responses). Understanding how tokens work is crucial for cost optimization.

Pricing verified on July 25, 2026.

Pricing assumptions for this calculator:

  • Uses base token tier pricing only.
  • Excludes request/search/reasoning/citation query fees.
  • Excludes batch, flex, priority, and time-window discounts.
  • Some providers apply higher rates for long-context requests.

AI Models Pricing (per 1M tokens)

ProviderModel NameInput Cost ($)Output Cost ($)
AnthropicClaude Opus 5 (Fast)$10.00$50.00
AnthropicClaude Fable 5$10.00$50.00
AnthropicClaude Opus 5$5.00$25.00
AnthropicClaude Opus 4.8$5.00$25.00
AnthropicClaude Opus 4.6$5.00$25.00
AnthropicClaude Opus 4.5$5.00$25.00
AnthropicClaude Sonnet 5 (from Sep 1, 2026)$3.00$15.00
AnthropicClaude Sonnet 4.6$3.00$15.00
AnthropicClaude Sonnet 4.5$3.00$15.00
AnthropicClaude Sonnet 5 (through Aug 31, 2026)$2.00$10.00
AnthropicClaude Haiku 4.5$1.00$5.00
DeepSeekDeepSeek V4 Pro$0.43$0.87
DeepSeekDeepSeek V4 Flash$0.14$0.28
GoogleGemini 3 Pro (Preview)$2.00$12.00
GoogleGemini 3.1 Pro (Preview)$2.00$12.00
GoogleGemini 3.6 Flash$1.50$7.50
GoogleGemini 3.5 Flash$1.50$9.00
GoogleGemini 2.5 Pro$1.25$10.00
GoogleGemini 3 Flash (Preview)$0.50$3.00
GoogleGemini 2.5 Flash$0.30$2.50
GoogleGemini 3.1 Flash-Lite$0.25$1.50
GoogleGemini 2.5 Flash-Lite$0.10$0.40
GoogleGemini 2.0 Flash$0.10$0.40
GoogleGemini 2.0 Flash-Lite$0.07$0.30
MistralMagistral Medium$2.00$5.00
MistralMistral Medium 3.5$1.50$7.50
MistralMagistral Small$0.50$1.50
MistralMistral Large 3$0.50$1.50
MistralMistral Medium 3$0.40$2.00
MistralDevstral 2$0.40$2.00
MistralCodestral$0.30$0.90
MistralMinistral 3 14B$0.20$0.20
MistralMistral Small 4$0.15$0.60
MistralMinistral 3 8B$0.15$0.15
MistralDevstral Small 2$0.10$0.30
MistralMinistral 3 3B$0.10$0.10
MistralVoxtral Small$0.10$0.40
OpenAIo1-pro$150.00$600.00
OpenAIGPT-realtime-2.1 (audio)$32.00$64.00
OpenAIGPT-5.5-pro$30.00$180.00
OpenAIGPT-5.4 Pro$30.00$180.00
OpenAIGPT-5.2 Pro$21.00$168.00
OpenAIo3-pro$20.00$80.00
OpenAIGPT-5 Pro$15.00$120.00
OpenAIo1$15.00$60.00
OpenAIGPT-5.6 Sol$5.00$30.00
OpenAIGPT-5.5$5.00$30.00
OpenAIGPT-realtime-2.1 (text)$4.00$24.00
OpenAIGPT-5.6 Terra$2.50$15.00
OpenAIGPT-5.4$2.50$15.00
OpenAIGPT-4o$2.50$10.00
OpenAIo3$2.00$8.00
OpenAIGPT-4.1$2.00$8.00
OpenAIGPT-5.2$1.75$14.00
OpenAIGPT-5.3 Codex$1.75$14.00
OpenAIGPT-5.2 Codex$1.75$14.00
OpenAIGPT-5.1$1.25$10.00
OpenAIGPT-5.1 Codex Max$1.25$10.00
OpenAIGPT-5.1 Codex$1.25$10.00
OpenAIGPT-5 Codex$1.25$10.00
OpenAIGPT-5$1.25$10.00
OpenAIo4-mini$1.10$4.40
OpenAIo3-mini$1.10$4.40
OpenAIGPT-5.6 Luna$1.00$6.00
OpenAIGPT-5.4 Mini$0.75$4.50
OpenAIGPT-4.1 mini$0.40$1.60
OpenAIGPT-5.1 Codex Mini$0.25$2.00
OpenAIGPT-5 mini$0.25$2.00
OpenAIGPT-5.4 Nano$0.20$1.25
OpenAIGPT-4o mini$0.15$0.60
OpenAIGPT-4.1 nano$0.10$0.40
OpenAIGPT-5 nano$0.05$0.40
PerplexitySonar Pro$3.00$15.00
PerplexitySonar Reasoning Pro$2.00$8.00
PerplexitySonar Deep Research$2.00$8.00
PerplexitySonar$1.00$1.00
xAIgrok-4.5$2.00$6.00
xAIgrok-4.3$1.25$2.50
xAIgrok-4.20-reasoning$1.25$2.50
xAIgrok-4.20-non-reasoning$1.25$2.50
xAIgrok-build-0.1$1.00$2.00

Token Counting Guide

What Counts as a Token?
  • Common English words: 1-2 tokens
  • Long or uncommon words: 2-3+ tokens
  • Numbers: ~1 token per 2-3 digits
  • Spaces and punctuation count
  • Special characters may use more tokens
Token Examples
  • "Hello" = 1 token
  • "artificial intelligence" = 3 tokens
  • "123456" = 2 tokens
  • "https://" = 2 tokens
  • Emojis: 1-3 tokens each

Note: The token count is an estimate and may vary slightly depending on the model. For additional details, please visit tiktokenizer.vercel.app.

Cost Optimization Strategies

1. Input Optimization

  • Use Clear, Concise Prompts: Shorter prompts mean fewer input tokens. Be specific but brief.
  • Leverage Input Caching: Some models offer discounted rates for cached inputs, perfect for repeated queries.
  • Batch Similar Requests: Combine related queries when possible to reduce overhead.

2. Output Management

  • Set Token Limits: Always specify maximum output tokens to prevent unexpected costs.
  • Choose the Right Model: Use cheaper models for drafts and more expensive ones for final versions.
  • Implement Retry Strategies: Handle API failures gracefully to avoid wasting tokens.

💡 Pro Tips for Cost Efficiency

  • Monitor token usage patterns to identify optimization opportunities
  • Use model-specific features like caching when available
  • Consider breaking long inputs into smaller chunks
  • Test with smaller outputs before scaling up
  • Keep track of costs across different models to optimize spending