Everything you need to know about LLM API pricing: how token costs work, what drives pricing differences between models, and a complete price comparison for 18+ models from OpenAI, Anthropic, Google, DeepSeek, and more.
LLM APIs charge by the token — roughly 4 characters of English text, or about 0.75 words. Most providers quote prices per 1 million tokens (per 1M tokens), split into two rates:
Larger models cost more to run. GPT-4.1 (~200B params) costs $2/1M input; GPT-4.1 Nano (~10B) costs $0.10/1M. The capability–cost tradeoff is steep.
Mixture-of-Experts models like DeepSeek V4 and GPT-4o activate only a fraction of parameters per token — dramatically reducing compute cost vs dense models at similar quality.
DeepSeek and Mistral pass through lower costs from efficient training and open-weight models. OpenAI and Anthropic charge a premium for proprietary research, safety work, and support.
Longer contexts require more KV-cache memory. Models with 1M+ context windows (Gemini, GPT-4.1) may charge more per token on long prompts or use tiered pricing.
Models like o3, o4-mini, and DeepSeek R1 generate internal "thinking" tokens before answering. These are billed at the same rate — a complex reasoning task may consume 10–100k tokens before you see a word of output.
Prices updated automatically daily. View full comparison table →
Range: $0.10 (GPT-4.1 Nano) → $15 (o3) per 1M input tokens. GPT-4.1 Mini at $0.40/1M is the sweet spot for most production apps. OpenAI charges a 4× premium on output vs input for most models.
Range: $0.25 (Haiku 3.5) → $15 (Opus 4.7) per 1M input tokens. Claude Sonnet 4.6 at $3/1M is Anthropic's price-performance leader. Anthropic charges 5× output vs input on Claude 3.5+ models.
Range: $0.07 (Gemini 2.0 Flash Lite) → $2.50 (Gemini 2.5 Pro) per 1M input tokens. Gemini 2.5 Flash at $0.30/1M with 1M context is Google's standout value offering.
Range: $0.07 (V4 Flash) → $0.27 (V4 Pro) per 1M input tokens. DeepSeek provides frontier-quality models at 10–50× lower cost than OpenAI/Anthropic by leveraging MoE architecture and open-weight training.
DeepSeek V4 Flash at $0.07/1M input tokens is currently the cheapest capable LLM API. For simpler tasks, GPT-4.1 Nano at $0.10/1M and Gemini 2.0 Flash Lite at $0.07/1M are comparable alternatives from major providers.
A chatbot handling 1,000 conversations/day at ~500 tokens each would cost roughly $1/day on GPT-4.1 Mini ($0.40/1M). Using GPT-4.1 at $2/1M input, the same chatbot costs ~$5/day. At 100k conversations/day, costs scale linearly.
Claude Sonnet 4.6 ($3/1M) is pricier than GPT-4.1 ($2/1M) partly due to Anthropic's Constitutional AI safety research and training costs. However, many developers find Claude's instruction-following justifies the premium for complex tasks.
Many providers offer prompt caching — if you repeat the same system prompt across requests, only the first request pays full price. OpenAI charges 50% for cached inputs; Anthropic charges 10% for cache reads. This can cut costs by 30–70% for apps with large, stable system prompts.
Prices change frequently — often dropping 50–80% per year as providers scale. ComputeCheck updates prices daily via the OpenRouter API. Always verify current pricing on the provider's official page before committing to production architecture.
Ready to compare specific models side-by-side?
Compare AI Model API Pricing →