See what your prompt actually costs across every major AI model. No API key needed.
Built by @JuanAtLarge because I got tired of guessing.
No install needed:
npx llm-cost-compare "your prompt here"# Basic cost comparison
npx llm-cost-compare "Summarize this article in 3 bullet points"
# With a file
npx llm-cost-compare "Summarize this: $(cat mydoc.txt)"
# Specify expected output length
npx llm-cost-compare "Write a blog post about AI agents" --output=1000
# Filter by provider
npx llm-cost-compare "Hello world" --provider=Anthropic
# Show all models (default shows top 10 cheapest)
npx llm-cost-compare "Hello world" --all
# Pipe input
echo "Explain quantum computing simply" | npx llm-cost-compareπ° llm-cost β prompt cost calculator
by @JuanAtLarge | github.com/JuanAtLarge/llm-cost
π Prompt: "Write a blog post about AI agents"
π Estimated tokens: ~8 input / ~4 output
Model Provider Per call Per 1k calls
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Gemini 1.5 Flash Google $0.000002 $0.0016/1k calls
Mistral Small Mistral $0.000002 $0.0022/1k calls
Deepseek V3 Deepseek $0.000003 $0.0026/1k calls
GPT-4o mini OpenAI $0.000003 $0.0030/1k calls
...
π Cheapest: Gemini 1.5 Flash (Google) β $0.000002/call
πΈ Most exp: Claude 3 Opus (Anthropic) β $0.000180/call
π Cost spread: 90Γ difference between cheapest and most expensive
| Provider | Models |
|---|---|
| OpenAI | GPT-5.2 Pro, GPT-5.2, GPT-5, GPT-5 Mini, GPT-5 Nano, GPT-4o, GPT-4o mini, GPT-4 Turbo, o1, o1 mini, o3 mini |
| Anthropic | Claude Opus 4.6, Claude Sonnet 4.6, Claude Haiku 4.5, Claude 3.5 Sonnet, Claude 3.5 Haiku, Claude 3 Opus |
| Gemini 3.1 Pro, Gemini 3 Flash, Gemini 2.5 Pro/Flash/Flash-Lite, Gemini 2.0 Flash, Gemini 1.5 Pro/Flash/Flash-8B | |
| Meta/OSS | Llama 3.3 70B, Llama 3.1 405B, Llama 3 70B, Llama 3 8B |
| Mistral | Mistral Large, Mistral Small |
| Deepseek | Deepseek V3, Deepseek R1 |
| xAI | Grok 2, Grok 3, Grok 3 Mini |
Pricing updated March 2026. PRs welcome to keep it current.
- Token count is estimated (~4 chars per token for English)
- Output tokens default to ~50% of input β use
--output=Nfor accuracy - Prices are API list prices and may not reflect your negotiated rates
MIT