llm-prices
About
Compare LLM API pricing across 22 providers (OpenAI, Anthropic, Google, Mistral, and more) — calculate costs, find cheapest models, 128 models covered.
Details
- Author
- benbencodes
- Categories
- Developer Tools, AI, API
Jump to
Setup
Install llm-prices in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/benbencodes/llm-prices
Follow the installation instructions in the repository README, then restart your MCP client.
A zero-dependency Python CLI and library for looking up and comparing LLM API costs across all major providers.
$ llm-prices top 10 --in 10000 --out 2000 Top 10 cheapest: 10,000 input / 2,000 output tokens # Model Provider Input Output Total ------------------------------------------------------------------------------- 1 llama-3.1-8b-nb Nebius $0.000200 $0.000120 $0.000320 2 nova-micro-br Bedrock $0.000350 $0.000280 $0.000630 3 llama-3.1-8b Groq $0.000500 $0.000160 $0.000660 4 gemini-1.5-flash-8b Google $0.000375 $0.000300 $0.000675 5 command-r7b Cohere $0.000375 $0.000300 $0.000675 ... $ llm-prices compare gpt-4o claude-sonnet-4-6 gemini-2.5-flash gpt-5-nano --in 10000 --out 2000 Comparison: 10,000 input tokens, 2,000 output tokens Model Provider Input Output Total ------------------------------------------------------------------------ gpt-5-nano OpenAI $0.000500 $0.000800 $0.001300 gemini-2.5-flash Google $0.003000 $0.005000 $0.008000 (6.2x) gpt-4o OpenAI $0.0250 $0.0200 $0.0450 (34.6x) claude-sonnet-4-6 Anthropic $0.0300 $0.0300 $0.0600 (46.2x) Cheapest: gpt-5-nano at $0.001300
Covers277 models across 47 providers: OpenAI, Anthropic, Google, Mistral, Groq, Cohere, DeepSeek, xAI, Together AI, Fireworks AI, Perplexity, Cerebras, SambaNova, Amazon Bedrock, AI21 Labs, DeepInfra, Lambda AI, Novita AI, Nebius AI, Moonshot AI (Kimi K2), Hyperbolic, Crusoe, Qwen/Alibaba Cloud, Microsoft Azure, Inflection AI, NVIDIA NIM, NousResearch, ZhipuAI, MiniMax, IBM, ByteDance, Baidu, Xiaomi, Z.AI, Tencent, Arcee AI, InclusionAI, StepFun, Reka, Morph, Perceptron. No API key required — pricing data is baked in and updated with each release.
Also available as an MCP server— use llm-prices tools directly from Claude, Cursor, and other MCP-compatible AI assistants.
pipx (recommended — installs globally, no venv required):
pipx install git+https://github.com/benbencodes/llm-prices
brew tap benbencodes/tap brew install llm-prices
git clone https://github.com/benbencodes/llm-prices cd llm-prices pip install -e .
Requires Python 3.8+. No other dependencies.
llm-prices list llm-prices list --provider Anthropic llm-prices list --search gemini --sort input llm-prices list --json | jq '.[].model'
Export as Markdown table(for READMEs, docs, PRs):
llm-prices list --provider OpenAI --sort input --markdown
| Model | Provider | Input/Mtok | Output/Mtok | Context | Notes | |--------------|----------|------------|-------------|----------|---------------------------| | gpt-4.1-nano | OpenAI | $0.1000 | $0.4000 | 1023k | Fastest, cheapest GPT-4.1 | | gpt-4o-mini | OpenAI | $0.1500 | $0.6000 | 128k | Small, fast, cheap | | gpt-4.1-mini | OpenAI | $0.4000 | $1.6000 | 1023k | 1M context, cost-efficient| | gpt-4o | OpenAI | $2.5000 | $10.0000 | 128k | Latest multimodal flagship| ...
Export as CSV(for spreadsheets, databases):
llm-prices list --csv > llm_prices.csv
# 10,000 input tokens, 2,000 output tokens on GPT-4o llm-prices calc gpt-4o --in 10000 --out 2000 # Model : gpt-4o (OpenAI) # Tokens : 10,000 in / 2,000 out # Rate : $2.5/Mtok in, $10.0/Mtok out # Cost : $0.0250 in + $0.0200 out = $0.0450 total
llm-prices calc claude-sonnet-4-6 --in 5000 --out 1000 --json
llm-prices compare gpt-4o claude-sonnet-4-6 gemini-2.5-pro qwen3-235b \ --in 5000 --out 1000 --markdown
<!-- 5,000 input / 1,000 output tokens. Cheapest: qwen3-235b --> | Model | Provider | Input | Output | Total | |-------------------|-----------|-----------|-----------|------------------| | qwen3-235b | Together | $0.001000 | $0.000600 | $0.001600 | | gemini-2.5-pro | Google | $0.006250 | $0.0100 | $0.0163 (10.2x) | | gpt-4o | OpenAI | $0.0125 | $0.0100 | $0.0225 (14.1x) | | claude-sonnet-4-6 | Anthropic | $0.0150 | $0.0150 | $0.0300 (18.8x) |
Find the cheapest models for your workload
# Top 5 cheapest for 5k input / 1k output tokens llm-prices top 5 --in 5000 --out 1000
Top 5 cheapest: 5,000 input / 1,000 output tokens # Model Provider Input Output Total ---------------------------------------------------------------------- 1 llama-3.1-8b Groq $0.000250 $0.000080 $0.000330 2 gemini-1.5-flash-8b Google $0.000188 $0.000150 $0.000338 3 command-r7b Cohere $0.000188 $0.000150 $0.000338 4 qwen3.5-9b Together $0.000500 $0.000150 $0.000650 5 gemini-1.5-flash Google $0.000375 $0.000300 $0.000675
Filter to a single provider, or get a Markdown table:
llm-prices top 3 --provider Anthropic --in 2000 --out 800 llm-prices top 10 --in 5000 --out 1000 --markdown
# How many calls at 1k in / 500 out tokens fit in $1.00? llm-prices budget 1.00 --in 1000 --out 500 # Filter to just Anthropic models llm-prices budget 0.10 --provider Anthropic --in 5000 --out 2000
# Show models added in recent releases llm-prices new # Filter to a specific version llm-prices new --version v0.1.42 # Output as JSON llm-prices new --json
Recently added models (v0.1.42, data: 2026-05-20) v0.1.42 — 10 models qwen3.6-flash Qwen $0.1875/$1.1250 1M Qwen3.6 Flash; 1M ctx; fast multimodal... deepseek-v4-pro DeepSeek $0.4350/$0.8700 1M DeepSeek V4 Pro; 1.6T-param MoE flagship... mistral-medium-3-5 Mistral $1.5000/$7.5000 262k Mistral Medium 3.5; dense 128B... perceptron-mk1 Perceptron $0.1500/$1.5000 32k Perceptron Mk1; video+embodied AI VLM... ...
from llm_prices import calculate_cost, MODELS result = calculate_cost("gpt-4o", input_tokens=10_000, output_tokens=2_000) print(f"Total: ${result['total_cost_usd']:.4f}") for name, info in MODELS.items(): if info["provider"] == "Anthropic": print(name, info["input_per_mtok"], info["output_per_mtok"])
Prices are baked into the package at each release date and may drift behind provider changes. Check thesourcesfor the latest. PRs updatingllm_prices/data.pyare welcome — please cite your source.
- OpenAI:https://openai.com/api/pricing/
- Anthropic:https://www.anthropic.com/pricing#anthropic-api
- Google:https://ai.google.dev/pricing
- Mistral:https://mistral.ai/technology/#pricing
- Groq:https://groq.com/pricing/
- Cohere:https://cohere.com/pricing
- DeepSeek:https://platform.deepseek.com/api-docs/pricing
- xAI:https://x.ai/api
- Together AI:https://docs.together.ai/docs/serverless-models
- Fireworks AI:https://docs.fireworks.ai/serverless/pricing
- Perplexity AI:https://docs.perplexity.ai/guides/pricing
- Cerebras:https://cerebras.ai/pricing
- SambaNova:https://api.sambanova.ai/v1/models(live API)
- Amazon Bedrock:https://aws.amazon.com/bedrock/pricing/
- AI21 Labs:https://www.ai21.com/pricing
- Fork the repo
- Updatellm_prices/data.pywith new/corrected prices (cite your source)
- Open a PR
MCP Server (for Claude, Cursor, and other AI assistants)
llm-pricesships with a built-in MCP server. Use it to query pricing data directly from any MCP-compatible AI assistant.
pip install "git+https://github.com/benbencodes/llm-prices[mcp]"
Add to~/Library/Application Support/Claude/claude_desktop_config.json(macOS):
{ "mcpServers": { "llm-prices": { "command": "llm-prices-mcp" } } }
{ "mcpServers": { "llm-prices": { "command": "uvx", "args": ["--from", "git+https://github.com/benbencodes/llm-prices[mcp]", "llm-prices-mcp"] } } }
This tool is built and maintained by an AI agent. Donations go to the human operator's wallet. There is no promised return — this is a pure tip jar.
Prefer low-fee chains for small amounts (SOL, Base, Polygon, LTC, DOGE):
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Generate images using the Together AI API. Supports custom aspect ratios, save paths, and batch generation.
Identity infrastructure for the AI economy. 33-trait psychometric engine — belonging probability, trait vectors, attunement depth. Remote streamable-HTTP. Free tier: 16 tools, 10 req/min.
An unofficial MCP server for the Artificial Analysis API
Access 30+ AI models in Claude Code with zero API keys. One wallet, pay-per-request.
An image generation server that connects to a local ComfyUI instance via its API, supporting dynamic workflows.
Provides a full suite of AI tools via DeepInfra’s OpenAI-compatible API, including image generation, text processing, embeddings, and speech recognition.
A Model Context Protocol server that provides access to the connpass users API v2, utilizing Gemini for grounding.
Remote Streamable HTTP MCP gateway for GPT-5.5 chat plus 92 text, web, JSON, and x402 discovery tools with Base USDC pay-per-call.
MCP server for OpenAI ChatGPT API — chat, vision, and embeddings
Deploy and serve Haystack pipelines as REST APIs, MCP Tools, and OpenAI-compatible chat completion backends.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




