API Cost Router & Optimizer
Calculate exact cost per 1K runs across GPT-4o, Claude, Gemini, Grok, DeepSeek, and 12+ other models. Find the cheapest routing path.
Usage parameters
| Model | Quality | Per 1K runs | Monthly |
|---|---|---|---|
DeepSeek R1 DeepSeek · medium · 64K ctx | 91 | $1.370 | $41.10 |
gpt-4.1 OpenAI · medium · 1047K ctx | 93 | $5.000 | $150.00 |
o4-mini OpenAI · medium · 200K ctx | 89 | $2.750 | $82.50 |
gpt-4o OpenAI · medium · 128K ctx | 92 | $6.250 | $187.50 |
Gemini 2.5 Pro Google · medium · 1000K ctx | 91 | $5.625 | $168.75 |
o3-mini OpenAI · medium · 200K ctx | 88 | $2.750 | $82.50 |
gpt-4.1-mini OpenAI · fast · 1047K ctx | 86 | $1.000 | $30.00 |
Claude Sonnet 4 Anthropic · medium · 200K ctx | 94 | $9.000 | $270.00 |
Codestral Mistral · fast · 256K ctx | 84 | $0.600 | $18.00 |
Llama 4 Maverick Meta (Groq) · fast · 128K ctx | 84 | $0.635 | $19.05 |
Llama 3.3 70B Meta (Groq) · fast · 128K ctx | 84 | $0.690 | $20.70 |
Claude Haiku 3.5 Anthropic · fast · 200K ctx | 85 | $2.400 | $72.00 |
DeepSeek V3 DeepSeek · fast · 64K ctx | 83 | $0.685 | $20.55 |
Gemini 2.5 Flash Google · fast · 1000K ctx | 82 | $0.375 | $11.25 |
Grok 3 xAI · medium · 131K ctx | 90 | $9.000 | $270.00 |
Mistral Large Mistral · medium · 128K ctx | 85 | $4.000 | $120.00 |
Nova Pro Amazon · medium · 300K ctx | 82 | $2.000 | $60.00 |
gpt-4o-mini OpenAI · fast · 128K ctx | 80 | $0.375 | $11.25 |
Grok 3 Mini xAI · fast · 131K ctx | 80 | $0.400 | $12.00 |
Gemini 2.0 Flash Google · fast · 1000K ctx | 79 | $0.250 | $7.50 |
gpt-4.1-nano OpenAI · fast · 1047K ctx | 75 | $0.250 | $7.50 |
Mistral Small Mistral · fast · 32K ctx | 74 | $0.200 | $6.00 |
o3 OpenAI · slow · 200K ctx | 97 | $25.000 | $750.00 |
Nova Lite Amazon · fast · 300K ctx | 72 | $0.150 | $4.50 |
Claude Opus 4 Anthropic · slow · 200K ctx | 97 | $45.000 | $1350.00 |
curl -X POST https://api.openai.com/v1/chat/completions \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"DeepSeek R1","messages":[{"role":"user","content":"YOUR_PROMPT"}]}'from openai import OpenAI
client = OpenAI()
r = client.chat.completions.create(
model="DeepSeek R1",
messages=[{"role":"user","content":"YOUR_PROMPT"}]
)Frequently asked questions
How are the costs calculated?+
The calculator multiplies your input and output tokens per run by each model’s published per-million-token rates, then scales by your runs per day (and 30 days for the monthly figure). It is straightforward list-price math — it does not include prompt caching, batch API discounts, or negotiated volume pricing, which can lower real-world costs significantly.
Is the pricing data up to date?+
The rates are a static snapshot of each provider’s published API pricing (the "as of" date is shown below the table). Providers change prices and release new models frequently, so before committing to a model, verify the current rate on the provider’s official pricing page.
How does the token estimate from sample text work?+
It uses a rough heuristic of about 4 characters per token and assumes output length is around 60% of input. Real tokenizers vary by model and language, and your actual output length depends on the task, so treat the estimate as a ballpark and use measured token counts from real API responses when you have them.
What does the quality score mean?+
It is a relative 0-100 rating we assign to help compare models within this tool, informed by public benchmarks and general reputation. It is not an official metric from any provider, and the best model for your specific task may differ — always test candidate models on your own workload.
Is my sample text sent to a server?+
No. The entire calculator runs in your browser — token estimation, cost math, and ranking all happen client-side, and nothing you type is uploaded anywhere.
How does the optimization priority setting work?+
"Cost" ranks models purely by your projected monthly spend, "Quality" ranks purely by quality score, and "Balanced" blends the two with roughly 60% weight on quality and 40% on cost. Changing the priority reorders the table but does not change the cost figures themselves.