Labsco
benbencodes logo

llm-prices

โ˜… 1

from benbencodes

Compare LLM API pricing across 22 providers (OpenAI, Anthropic, Google, Mistral, and more) โ€” calculate costs, find cheapest models, 128 models covered.

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeNeeds API keys

llm-prices

Website & Blog ยท GitHub ยท Changelog

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

Covers 277 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.


Providers & model count

ProviderModelsNotes
OpenAI13GPT-4o, GPT-4.1, o1, o3, o4
Anthropic8Claude 4, 3.7, 3.5, 3
Google6Gemini 2.5, 2.0, 1.5
Together AI7Qwen3, Kimi K2, Llama, DeepSeek
Fireworks6DeepSeek V4 Pro, V3, Kimi, Llama
Groq9Llama 4, Llama 3.x, Kimi K2, Qwen3 32B, gpt-oss 120B/20B
Mistral12Large 3, Magistral Medium/Small (reasoning), Medium 3, Small 3.2, Codestral, Devstral
Cohere3Command R+, R, R7B
Perplexity4Sonar, Sonar Pro, Reasoning, Deep Research
DeepSeek3chat (V3), V3.2, reasoner (R1)
xAI8Grok-4.3, Grok-4.20, Grok-4, Grok-4.1-fast, Grok-code-fast, Grok-3, Grok-3-mini, Grok-3-mini-fast
Cerebras3Llama 3.3 70B, Llama 3.1 8B, Qwen3 32B โ€” ultra-fast silicon
SambaNova5Llama 4 Maverick, Llama 3.3 70B, DeepSeek-V3, MiniMax M2.5, Gemma 3 12B
Bedrock5Amazon Nova Micro/Lite/Pro/Premier/2-Lite โ€” AWS-native foundation models
AI212Jamba Mini 1.7, Jamba Large 1.7 โ€” 256k ctx, hybrid SSM+Transformer
DeepInfra4Llama 4 Maverick (1M ctx!), Scout, DeepSeek-R1-0528, QwQ-32B
Lambda AI4Llama 4 Maverick ($0.05/Mtok โ€” cheapest!), Scout, Llama 3.3 70B, DeepSeek-R1
Novita AI4Llama 4 Maverick (1M ctx), Scout, DeepSeek-R1-0528, Qwen3 235B
Nebius AI5Llama 3.1 8B ($0.02/Mtok โ€” cheapest!), Llama 3.3 70B, Qwen3 235B (262k ctx), Nemotron 253B, DeepSeek-R1-0528

Pricing data

Prices are baked into the package at each release date and may drift behind provider changes. Check the sources for the latest. PRs updating llm_prices/data.py are welcome โ€” please cite your source.

Sources


MCP Server (for Claude, Cursor, and other AI assistants)

llm-prices ships with a built-in MCP server. Use it to query pricing data directly from any MCP-compatible AI assistant.

Install with MCP support

pip install "git+https://github.com/benbencodes/llm-prices[mcp]"

Configure Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS):

{
  "mcpServers": {
    "llm-prices": {
      "command": "llm-prices-mcp"
    }
  }
}

Or for uvx users:

{
  "mcpServers": {
    "llm-prices": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/benbencodes/llm-prices[mcp]", "llm-prices-mcp"]
    }
  }
}

Available MCP tools

ToolDescription
get_model_pricingGet pricing for a specific model
calculate_api_costCalculate exact cost for input+output tokens
compare_modelsCompare cost of a workload across multiple models
find_cheapest_modelsFind the N cheapest models for your workload
list_providersList all 24 providers with min pricing
search_llm_modelsSearch models by name or filter by provider

Support this project

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):

ChainAddress
SOLkbghHYeBXr2AcYUyvkofHa9sArgkJcKBC6zZhSdao82
Base / ETH / EVM0x310eEb225245D5A3e1773C5Def30Fe5d0289A1b3
LTCltc1q9fwegmfey7njksnmw8p787cz87l2lpf5372p2w
DOGEDCHKeC2QQQSFVTA49gK44D1bfyv8QSnZyX
BTCbc1qv0ny3c97lk80qv5v79f52w3hyaqq2ss0zdqp52
TRX / USDT-TRC20TFaN8RPkgFkWjL5XHfJKRzyDQp2ECskQtH
XMR4B3q6iZj8VJdZJLLWZggGSYsPWjMDhm8UJ6cfrkPbEHWCRqEvi1xyxtTbKZtbdeCLSdk17kvvgcyMVa2C59nkARfDgECSFd