LLM model pricing comparison
One table, every major model. Compare input and output price per million tokens and context window across OpenAI, Anthropic, Google, Mistral, Cohere, Meta, and DeepSeek so you can pick the cheapest model that still fits your content and quality bar.
How it works
Each row lists a model’s published input and output price per million tokens alongside its context window. Output is broken out separately because it is billed several times higher than input — for chat and generation workloads it is the number that actually moves your bill. Filter by provider to focus on one ecosystem, set a minimum context window to drop models that cannot hold your documents, and sort by whichever column matches your cost driver.
How to read the table for your workload
Output-heavy workloads (chatbots, summarizers, writers) are driven almost entirely by the output column. If your average response is 1,000 tokens and your prompt is 200 tokens, the output price matters roughly 5× more than the input price. Sort by output cost and shortlist from the top.
Input-heavy workloads (document Q&A, classification, extraction) send long contexts and produce short answers. Here the input price matters more. A RAG pipeline feeding 10,000-token documents for a 100-token answer is almost entirely an input cost.
Context-window workloads — where you need to fit a full book, codebase, or long conversation in one call — require filtering to models whose context exceeds your document length. A model that needs the document chunked into five calls may be cheaper per token but more expensive in total API cost and harder to implement.
The total cost picture
Headline price per million tokens is only part of the story:
- A cheap model that needs two retries due to lower accuracy costs more in practice than a pricier model that answers correctly on the first call.
- A small context window forces chunking strategies — extra calls, extra prompts, extra engineering — that have their own costs in tokens and complexity.
- Some providers offer batch pricing or caching for repeated prompts, which can cut real-world costs well below the headline rate.
Use this table to shortlist two or three candidates, then run your actual prompt through each and compare total cost (tokens × price) plus response quality. Always verify the live rate on the provider’s pricing page before committing a budget — LLM prices have changed frequently and the published rate at time of writing may no longer reflect current offers.
Open-source / self-hosted context
Open-weight models like Llama and DeepSeek appear here at representative hosted-API prices (Groq, Together AI, DeepSeek’s own endpoint). If you self-host on your own GPU, your cost is GPU-hours and electricity rather than per-token fees — that math is entirely different and depends on your hardware and utilization. Self-hosting is typically cost-effective only at high sustained volume where the GPU stays busy.
Quick decision guide
| Your situation | What to sort by |
|---|---|
| Building a chatbot with short messages | Output price |
| Document Q&A feeding long context | Input price |
| Need a specific context length | Filter by context window first |
| Prototype / low volume | Cheapest overall; quality difference is small |
| High-stakes generation | Quality bar first, price second |
Use this table to generate a shortlist of two or three models, then test with your real prompt to confirm quality before committing to a budget.