Quick takeaways

  • DeepSeek and some open-weight providers are often the cheapest for large token volumes.
  • Anthropic and OpenAI charge premium prices for their strongest reasoning and agentic models.
  • Google Gemini and Mistral usually sit in the mid-range, with strong long-context value.
  • Output tokens typically cost more than input tokens, so long responses drive cost more than long prompts.

How to think about AI model choice

Andrej Karpathy explains what large language models are good at and how to pick the right model for a task.

API pricing by provider

Prices are approximate per-million-token rates for standard API calls. Batch, realtime, and cached pricing may differ. Always check the official provider page before deploying.

ProviderEntry modelInput / 1M tokensOutput / 1M tokensContext window
OpenAIGPT-4o mini~$0.15~$0.60128K
OpenAIGPT-4o~$2.50~$10.00128K
OpenAIo3 / o4-mini~$10.00+~$40.00+200K
AnthropicClaude 3.5 Haiku~$0.25~$1.25200K
AnthropicClaude 4 Sonnet~$3.00~$15.00200K
AnthropicClaude 4 Opus~$15.00~$75.00200K
GoogleGemini 2.5 Flash~$0.15~$0.601M
GoogleGemini 2.5 Pro~$1.25~$10.001M
DeepSeekDeepSeek-V3~$0.07~$0.3064K
DeepSeekDeepSeek-R1~$0.55~$2.2064K
MistralMistral Small~$0.20~$0.6032K
MistralMistral Medium 3.5~$0.90~$2.70128K
QwenQwen2.5 / Qwen3~$0.05~$0.20128K

How to compare real costs

Per-million-token pricing is only part of the story. To estimate your real bill, you need:

  • Average prompt length. Long documents, system prompts, and retrieved context all count as input.
  • Average response length. Code, reasoning traces, and long-form content inflate output tokens.
  • Calls per day. A small price difference matters at high volume.
  • Caching and batch discounts. Some providers cut prices for repeated prompts or asynchronous jobs.

Use the LLM cost calculator to estimate monthly spend for your workload.

Free tiers and starter limits

Most providers offer free tiers or starter credits, but the limits vary:

  • OpenAI: Paid-only API with occasional starter credits.
  • Anthropic: Paid API; consumer plans are separate.
  • Google: Gemini API includes a free tier with rate limits.
  • DeepSeek: Competitive pay-as-you-go pricing; occasional promotional credits.
  • Mistral: Free tier for testing, then usage-based.
  • Qwen: Low-cost API through Alibaba Cloud and partner hosts.

Without AI vs. with AI

TaskWithout AIWith AI
Comparing pricesDevelopers open multiple provider pricing pages and convert units.This page compares per-token prices across major providers in one table.
Estimating billsTeams guess monthly API costs from usage spreadsheets.The LLM cost calculator links to estimate workload spend.
Choosing a providerTeams default to the best-known vendor.The comparison includes value providers like DeepSeek and Qwen.
Tracking changesPricing updates are missed until the bill arrives.The page notes that prices change frequently and links to official sources.
Balancing cost and qualityTeams assume cheap models are weak.Tier tables show which budget models are competitive for which tasks.

FAQ

Which provider is cheapest?

For raw per-token cost, Qwen and DeepSeek are usually the lowest. For reliability and support at scale, OpenAI and Anthropic often justify the premium.

Do prices change often?

Yes. Providers cut prices regularly, especially for smaller or faster models. Check official pricing pages before making architecture decisions.

Should I use the API or the consumer app?

Use the API when you are building a product, automating workflows, or need scale. Use the consumer app for ad-hoc individual work.

What about inference hosts like OpenRouter or Together AI?

Inference hosts let you call multiple models through one API and often add a small markup. They are useful for fallback, experimentation, and multi-model products.

What is a token?

A token is roughly a word fragment. Pricing is based on the number of input and output tokens.

Is input or output more expensive?

Output is usually more expensive because generating text requires more compute.

How do I reduce API costs?

Use smaller models for simple tasks, cache context, limit output length, and batch requests.

What is the cheapest model for coding?

DeepSeek and Qwen typically offer low-cost coding models. Verify current pricing.

Do prices include hosting?

No. API prices are for inference only. Self-hosting has separate infrastructure costs.

Why do prices change so often?

Competition, hardware improvements, and new model releases lead providers to adjust prices frequently.