LLM API Pricing Calculator: Compare OpenAI, Claude, Gemini, Mistral & More

Estimate real LLM API costs from your expected input and output tokens. Compare current models from OpenAI, Claude, Gemini, Mistral, Cohere, DeepSeek, Grok and more — with pricing, context windows and total cost in one place.

tokens

Use-case presets

Choose a realistic starting point, then fine-tune token values.

Quick result for 100,000 input tokens + 100,000 output tokens

Cheapest overall

Command R7B

$0.0188

Best pure price

Cheapest OpenAI

GPT-5 nano

$0.0450

Low-cost OpenAI option

Cheapest Gemini

Gemini 2.5 Flash-Lite

$0.0500

Low-cost Gemini option

Best long context

DeepSeek V4 Flash

$0.0420

Large context window

CURRENT

Command R7B

Cohere

Cohere
Input Cost (per 1M) $0.0375
Output Cost (per 1M) $0.1500
Context Window 128k tokens
Input Cost (for 100.000 tokens) $0.0038
Output Cost (for 100.000 tokens) $0.0150
Total Cost $0.0188
View API Documentation →
CURRENT

Ministral 3 3B

Mistral

Mistral
Input Cost (per 1M) $0.1000
Output Cost (per 1M) $0.1000
Context Window 256k tokens
Input Cost (for 100.000 tokens) $0.0100
Output Cost (for 100.000 tokens) $0.0100
Total Cost $0.0200
View API Documentation →
CURRENT

Ministral 3 8B

Mistral

Mistral
Input Cost (per 1M) $0.1500
Output Cost (per 1M) $0.1500
Context Window 256k tokens
Input Cost (for 100.000 tokens) $0.0150
Output Cost (for 100.000 tokens) $0.0150
Total Cost $0.0300
View API Documentation →
CURRENT

Ministral 14 8B

Mistral

Mistral
Input Cost (per 1M) $0.2000
Output Cost (per 1M) $0.2000
Context Window 256k tokens
Input Cost (for 100.000 tokens) $0.0200
Output Cost (for 100.000 tokens) $0.0200
Total Cost $0.0400
View API Documentation →
CURRENT

DeepSeek V4 Flash

DeepSeek

DeepSeek
Input Cost (per 1M) $0.1400
Output Cost (per 1M) $0.2800
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.0140
Output Cost (for 100.000 tokens) $0.0280
Total Cost $0.0420
View API Documentation →
CURRENT

GPT-5 nano

OpenAI

OpenAI
Input Cost (per 1M) $0.0500
Output Cost (per 1M) $0.4000
Context Window 400k tokens
Input Cost (for 100.000 tokens) $0.0050
Output Cost (for 100.000 tokens) $0.0400
Total Cost $0.0450
View API Documentation →
CURRENT

Gemini 2.5 Flash-Lite

Google

Google
Input Cost (per 1M) $0.1000
Output Cost (per 1M) $0.4000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.0100
Output Cost (for 100.000 tokens) $0.0400
Total Cost $0.0500
View API Documentation →
CURRENT

GPT-4.1 nano

OpenAI

OpenAI
Input Cost (per 1M) $0.1000
Output Cost (per 1M) $0.4000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.0100
Output Cost (for 100.000 tokens) $0.0400
Total Cost $0.0500
View API Documentation →
CURRENT

Command R

Cohere

Cohere
Input Cost (per 1M) $0.1500
Output Cost (per 1M) $0.6000
Context Window 128k tokens
Input Cost (for 100.000 tokens) $0.0150
Output Cost (for 100.000 tokens) $0.0600
Total Cost $0.0750
View API Documentation →
CURRENT

Mistral Small 4

Mistral

Mistral
Input Cost (per 1M) $0.1500
Output Cost (per 1M) $0.6000
Context Window 256k tokens
Input Cost (for 100.000 tokens) $0.0150
Output Cost (for 100.000 tokens) $0.0600
Total Cost $0.0750
View API Documentation →
CURRENT

GPT-4o mini

OpenAI

OpenAI
Input Cost (per 1M) $0.1500
Output Cost (per 1M) $0.6000
Context Window 128k tokens
Input Cost (for 100.000 tokens) $0.0150
Output Cost (for 100.000 tokens) $0.0600
Total Cost $0.0750
View API Documentation →
CURRENT

GPT-5.4 nano

OpenAI

OpenAI
Input Cost (per 1M) $0.2000
Output Cost (per 1M) $1.2500
Context Window 400k tokens
Input Cost (for 100.000 tokens) $0.0200
Output Cost (for 100.000 tokens) $0.1250
Total Cost $0.1450
View API Documentation →
CURRENT

Gemini 3.1 Flash-Lite

Google

Google
Input Cost (per 1M) $0.2500
Output Cost (per 1M) $1.5000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.0250
Output Cost (for 100.000 tokens) $0.1500
Total Cost $0.1750
View API Documentation →
CURRENT

Mistral Large 3

Mistral

Mistral
Input Cost (per 1M) $0.5000
Output Cost (per 1M) $1.5000
Context Window 256k tokens
Input Cost (for 100.000 tokens) $0.0500
Output Cost (for 100.000 tokens) $0.1500
Total Cost $0.2000
View API Documentation →
CURRENT

GPT-4.1 mini

OpenAI

OpenAI
Input Cost (per 1M) $0.4000
Output Cost (per 1M) $1.6000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.0400
Output Cost (for 100.000 tokens) $0.1600
Total Cost $0.2000
View API Documentation →
CURRENT

GPT-5 mini

OpenAI

OpenAI
Input Cost (per 1M) $0.2500
Output Cost (per 1M) $2.0000
Context Window 400k tokens
Input Cost (for 100.000 tokens) $0.0250
Output Cost (for 100.000 tokens) $0.2000
Total Cost $0.2250
View API Documentation →
CURRENT

Mistral Medium 3.1

Mistral

Mistral
Input Cost (per 1M) $0.4000
Output Cost (per 1M) $2.0000
Context Window 128k tokens
Input Cost (for 100.000 tokens) $0.0400
Output Cost (for 100.000 tokens) $0.2000
Total Cost $0.2400
View API Documentation →
CURRENT

Gemini 2.5 Flash

Google

Google
Input Cost (per 1M) $0.3000
Output Cost (per 1M) $2.5000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.0300
Output Cost (for 100.000 tokens) $0.2500
Total Cost $0.2800
View API Documentation →
CURRENT

Grok 4.3

xAI

xAI
Input Cost (per 1M) $1.2500
Output Cost (per 1M) $2.5000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.1250
Output Cost (for 100.000 tokens) $0.2500
Total Cost $0.3750
View API Documentation →
CURRENT

DeepSeek V4 Pro

DeepSeek

DeepSeek
Input Cost (per 1M) $1.7400
Output Cost (per 1M) $3.4800
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.1740
Output Cost (for 100.000 tokens) $0.3480
Total Cost $0.5220
View API Documentation →
CURRENT

GPT-5.4 mini

OpenAI

OpenAI
Input Cost (per 1M) $0.7500
Output Cost (per 1M) $4.5000
Context Window 400k tokens
Input Cost (for 100.000 tokens) $0.0750
Output Cost (for 100.000 tokens) $0.4500
Total Cost $0.5250
View API Documentation →
CURRENT

o1-mini

OpenAI

OpenAI
Input Cost (per 1M) $1.1000
Output Cost (per 1M) $4.4000
Context Window 128k tokens
Input Cost (for 100.000 tokens) $0.1100
Output Cost (for 100.000 tokens) $0.4400
Total Cost $0.5500
View API Documentation →
CURRENT

o3-mini

OpenAI

OpenAI
Input Cost (per 1M) $1.1000
Output Cost (per 1M) $4.4000
Context Window 200k tokens
Input Cost (for 100.000 tokens) $0.1100
Output Cost (for 100.000 tokens) $0.4400
Total Cost $0.5500
View API Documentation →
CURRENT

o4-mini

OpenAI

OpenAI
Input Cost (per 1M) $1.1000
Output Cost (per 1M) $4.4000
Context Window 200k tokens
Input Cost (for 100.000 tokens) $0.1100
Output Cost (for 100.000 tokens) $0.4400
Total Cost $0.5500
View API Documentation →
CURRENT

Claude Haiku 4.5

Anthropic

Anthropic
Input Cost (per 1M) $1.0000
Output Cost (per 1M) $5.0000
Context Window 200k tokens
Input Cost (for 100.000 tokens) $0.1000
Output Cost (for 100.000 tokens) $0.5000
Total Cost $0.6000
View API Documentation →
CURRENT

Magistral Medium

Mistral

Mistral
Input Cost (per 1M) $2.0000
Output Cost (per 1M) $5.0000
Context Window 128k tokens
Input Cost (for 100.000 tokens) $0.2000
Output Cost (for 100.000 tokens) $0.5000
Total Cost $0.7000
View API Documentation →
CURRENT

Mistral Medium 3.5

Mistral

Mistral
Input Cost (per 1M) $1.5000
Output Cost (per 1M) $7.5000
Context Window 256k tokens
Input Cost (for 100.000 tokens) $0.1500
Output Cost (for 100.000 tokens) $0.7500
Total Cost $0.9000
View API Documentation →
CURRENT

GPT-4.1

OpenAI

OpenAI
Input Cost (per 1M) $2.0000
Output Cost (per 1M) $8.0000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.2000
Output Cost (for 100.000 tokens) $0.8000
Total Cost $1.0000
View API Documentation →
CURRENT

o3

OpenAI

OpenAI
Input Cost (per 1M) $2.0000
Output Cost (per 1M) $8.0000
Context Window 200k tokens
Input Cost (for 100.000 tokens) $0.2000
Output Cost (for 100.000 tokens) $0.8000
Total Cost $1.0000
View API Documentation →
CURRENT

Gemini 3.5 Flash

Google

Google
Input Cost (per 1M) $1.5000
Output Cost (per 1M) $9.0000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.1500
Output Cost (for 100.000 tokens) $0.9000
Total Cost $1.0500
View API Documentation →
CURRENT

Gemini 2.5 Pro

Google

Google
Input Cost (per 1M) $1.2500
Output Cost (per 1M) $10.0000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.1250
Output Cost (for 100.000 tokens) $1.0000
Total Cost $1.1250
View API Documentation →
CURRENT

GPT-5

OpenAI

OpenAI
Input Cost (per 1M) $1.2500
Output Cost (per 1M) $10.0000
Context Window 400k tokens
Input Cost (for 100.000 tokens) $0.1250
Output Cost (for 100.000 tokens) $1.0000
Total Cost $1.1250
View API Documentation →
CURRENT

GPT-5.1

OpenAI

OpenAI
Input Cost (per 1M) $1.2500
Output Cost (per 1M) $10.0000
Context Window 400k tokens
Input Cost (for 100.000 tokens) $0.1250
Output Cost (for 100.000 tokens) $1.0000
Total Cost $1.1250
View API Documentation →
CURRENT

Command A

Cohere

Cohere
Input Cost (per 1M) $2.5000
Output Cost (per 1M) $10.0000
Context Window 256k tokens
Input Cost (for 100.000 tokens) $0.2500
Output Cost (for 100.000 tokens) $1.0000
Total Cost $1.2500
View API Documentation →
CURRENT

Command R+

Cohere

Cohere
Input Cost (per 1M) $2.5000
Output Cost (per 1M) $10.0000
Context Window 128k tokens
Input Cost (for 100.000 tokens) $0.2500
Output Cost (for 100.000 tokens) $1.0000
Total Cost $1.2500
View API Documentation →
CURRENT

GPT-4o

OpenAI

OpenAI
Input Cost (per 1M) $2.5000
Output Cost (per 1M) $10.0000
Context Window 128k tokens
Input Cost (for 100.000 tokens) $0.2500
Output Cost (for 100.000 tokens) $1.0000
Total Cost $1.2500
View API Documentation →
CURRENT

Gemini 3.1 Pro

Google

Google
Input Cost (per 1M) $2.0000
Output Cost (per 1M) $12.0000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.2000
Output Cost (for 100.000 tokens) $1.2000
Total Cost $1.4000
View API Documentation →
CURRENT

GPT-5.2

OpenAI

OpenAI
Input Cost (per 1M) $1.7500
Output Cost (per 1M) $14.0000
Context Window 400k tokens
Input Cost (for 100.000 tokens) $0.1750
Output Cost (for 100.000 tokens) $1.4000
Total Cost $1.5750
View API Documentation →
CURRENT

GPT-5.4

OpenAI

OpenAI
Input Cost (per 1M) $2.5000
Output Cost (per 1M) $15.0000
Context Window 1.1m tokens
Input Cost (for 100.000 tokens) $0.2500
Output Cost (for 100.000 tokens) $1.5000
Total Cost $1.7500
View API Documentation →
CURRENT

Claude Sonnet 4.5

Anthropic

Anthropic
Input Cost (per 1M) $3.0000
Output Cost (per 1M) $15.0000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.3000
Output Cost (for 100.000 tokens) $1.5000
Total Cost $1.8000
View API Documentation →
CURRENT

Claude Sonnet 4.6

Anthropic

Anthropic
Input Cost (per 1M) $3.0000
Output Cost (per 1M) $15.0000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.3000
Output Cost (for 100.000 tokens) $1.5000
Total Cost $1.8000
View API Documentation →
CURRENT

Claude Opus 4.5

Anthropic

Anthropic
Input Cost (per 1M) $5.0000
Output Cost (per 1M) $25.0000
Context Window 200k tokens
Input Cost (for 100.000 tokens) $0.5000
Output Cost (for 100.000 tokens) $2.5000
Total Cost $3.0000
View API Documentation →
CURRENT

Claude Opus 4.6

Anthropic

Anthropic
Input Cost (per 1M) $5.0000
Output Cost (per 1M) $25.0000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.5000
Output Cost (for 100.000 tokens) $2.5000
Total Cost $3.0000
View API Documentation →
CURRENT

Claude Opus 4.7

Anthropic

Anthropic
Input Cost (per 1M) $5.0000
Output Cost (per 1M) $25.0000
Context Window 1m tokens
Input Cost (for 100.000 tokens) $0.5000
Output Cost (for 100.000 tokens) $2.5000
Total Cost $3.0000
View API Documentation →
CURRENT

GPT-5.5

OpenAI

OpenAI
Input Cost (per 1M) $5.0000
Output Cost (per 1M) $30.0000
Context Window 1.1m tokens
Input Cost (for 100.000 tokens) $0.5000
Output Cost (for 100.000 tokens) $3.0000
Total Cost $3.5000
View API Documentation →
CURRENT

o1

OpenAI

OpenAI
Input Cost (per 1M) $15.0000
Output Cost (per 1M) $60.0000
Context Window 200k tokens
Input Cost (for 100.000 tokens) $1.5000
Output Cost (for 100.000 tokens) $6.0000
Total Cost $7.5000
View API Documentation →
CURRENT

Claude Opus 4.1

Anthropic

Anthropic
Input Cost (per 1M) $15.0000
Output Cost (per 1M) $75.0000
Context Window 200k tokens
Input Cost (for 100.000 tokens) $1.5000
Output Cost (for 100.000 tokens) $7.5000
Total Cost $9.0000
View API Documentation →
CURRENT

o3-pro

OpenAI

OpenAI
Input Cost (per 1M) $20.0000
Output Cost (per 1M) $80.0000
Context Window 200k tokens
Input Cost (for 100.000 tokens) $2.0000
Output Cost (for 100.000 tokens) $8.0000
Total Cost $10.0000
View API Documentation →
CURRENT

GPT-5 pro

OpenAI

OpenAI
Input Cost (per 1M) $15.0000
Output Cost (per 1M) $120.0000
Context Window 400k tokens
Input Cost (for 100.000 tokens) $1.5000
Output Cost (for 100.000 tokens) $12.0000
Total Cost $13.5000
View API Documentation →
CURRENT

GPT-5.2 pro

OpenAI

OpenAI
Input Cost (per 1M) $21.0000
Output Cost (per 1M) $168.0000
Context Window 400k tokens
Input Cost (for 100.000 tokens) $2.1000
Output Cost (for 100.000 tokens) $16.8000
Total Cost $18.9000
View API Documentation →
CURRENT

GPT-5.4 pro

OpenAI

OpenAI
Input Cost (per 1M) $30.0000
Output Cost (per 1M) $180.0000
Context Window 1.1m tokens
Input Cost (for 100.000 tokens) $3.0000
Output Cost (for 100.000 tokens) $18.0000
Total Cost $21.0000
View API Documentation →
CURRENT

GPT-5.5 pro

OpenAI

OpenAI
Input Cost (per 1M) $30.0000
Output Cost (per 1M) $180.0000
Context Window 1.1m tokens
Input Cost (for 100.000 tokens) $3.0000
Output Cost (for 100.000 tokens) $18.0000
Total Cost $21.0000
View API Documentation →
CURRENT

o1-pro

OpenAI

OpenAI
Input Cost (per 1M) $150.0000
Output Cost (per 1M) $600.0000
Context Window 200k tokens
Input Cost (for 100.000 tokens) $15.0000
Output Cost (for 100.000 tokens) $60.0000
Total Cost $75.0000
View API Documentation →
Sponsored DigitalOcean

Building with these APIs?

You compared model costs. DigitalOcean can help host the rest of your stack — API backend, Laravel app, queues, workers, database, or small AI prototype.

This link is an affiliate link. This means that, at zero cost to you, we earn commissions when you shop through the link.

Explore DigitalOcean →

Frequently Asked Questions

Text generation API costs are calculated based on token usage - the fundamental unit of text processing. Providers charge for:

  • Input tokens: Text sent to the model (prompts, instructions, context)
  • Output tokens: Text generated by the model (completions, responses)

Each provider (OpenAI, Anthropic, Google Gemini, etc.) sets unique pricing tiers per 1,000,000 tokens, with premium models typically costing more than base models.

Input tokens represent the text you send to the LLM API (your prompt or context), while output tokens are what the model generates in response. For example:

  • Input: "Write a summary about Paris." (6 tokens)
  • Output: "Paris is the capital of France and a global center for art, fashion, and culture." (18 tokens)

Most providers charge different rates for input versus output tokens, with output tokens typically costing 2-5x more than input tokens.

Our Text generation API pricing database is monitored and updated regularly. We track official pricing pages, API documentation, and company announcements to try to ensure accuracy across all models from OpenAI, Anthropic, Google, Mistral, Cohere, and DeepSeek. If you notice any discrepancies, please feel free to send us a message to test@test.de.

The most cost-effective LLM depends on your specific requirements. OpenAI's GPT-4o-mini offers competitive pricing for general applications, while Anthropic's models excel at processing lengthy documents. Mistral and DeepSeek provide affordable alternatives for certain tasks. Our comparison tool helps you calculate exact costs based on your expected token usage and performance needs.

Yes, several strategies can optimize API costs:

  • Prompt engineering: Craft concise, effective prompts to reduce input tokens
  • Response parameters: Set maximum token limits for outputs
  • Caching: Store common responses to avoid redundant API calls
  • Model selection: Choose the most affordable model that meets your quality requirements
  • Batch processing: Combine multiple requests where possible

Each LLM has a maximum context window (the total tokens it can process at once). Context window sizes vary dramatically across providers, from Google Gemini's expansive 2M token capacity to more modest windows in other models. While OpenAI's GPT-4o and GPT-4o-mini share the same context window size, the mini version offers a more economical option. Similarly, Claude models offer large windows at different price points. Our calculator helps you determine if using a larger context model is more economical than breaking your task into multiple calls with a smaller-context, less expensive model.

While we strive to maintain accurate pricing information across all LLM providers, the rapid evolution of AI services means occasional discrepancies may occur. If you spot any errors in our pricing data or calculations, please feel free to contact us at test@test.de. We appreciate user feedback as it helps us maintain the most reliable comparison tool possible. However, we recommend that all users conduct their own due diligence and verify current pricing with the official provider documentation before making final decisions for production systems or budget-critical applications.