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 February 24, 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 4.6$5.00$25.00
AnthropicClaude Opus 4.5$5.00$25.00
AnthropicClaude Sonnet 4.6$3.00$15.00
AnthropicClaude Sonnet 4.5$3.00$15.00
AnthropicClaude Haiku 4.5$1.00$5.00
DeepSeekdeepseek-chat$0.28$0.42
DeepSeekdeepseek-reasoner$0.28$0.42
GoogleGemini 3 Pro (Preview)$2.00$12.00
GoogleGemini 3.1 Pro (Preview)$2.00$12.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 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 1.2$2.00$5.00
MistralMistral Large 2.1$2.00$6.00
MistralPixtral Large$2.00$6.00
MistralMagistral Small 1.2$0.50$1.50
MistralMistral Large 3$0.50$1.50
MistralMistral Medium 3.1$0.40$2.00
MistralMistral Medium 3$0.40$2.00
MistralDevstral 2$0.40$2.00
MistralDevstral Medium 1.0$0.40$2.00
MistralCodestral$0.30$0.90
MistralMinistral 3 14B$0.20$0.20
MistralMinistral 3 8B$0.15$0.15
MistralDevstral Small 2$0.10$0.30
MistralMistral Small 3.2$0.10$0.30
MistralMistral Small Creative$0.10$0.30
MistralVoxtral Small$0.10$0.30
MistralMinistral 3 3B$0.10$0.10
MistralVoxtral Mini$0.04$0.04
OpenAIo1-pro$150.00$600.00
OpenAIGPT-realtime (audio)$32.00$64.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-realtime (text)$4.00$16.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-4.1 mini$0.40$1.60
OpenAIGPT-5.1 Codex Mini$0.25$2.00
OpenAIGPT-5 mini$0.25$2.00
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$3.00$15.00
xAIgrok-3$3.00$15.00
xAIgrok-3-mini$0.30$0.50
xAIgrok-4-fast-reasoning$0.20$0.50
xAIgrok-4-fast-non-reasoning$0.20$0.50
xAIgrok-4-1-fast-reasoning$0.20$0.50
xAIgrok-4-1-fast-non-reasoning$0.20$0.50
xAIgrok-code-fast-1$0.20$1.50

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