Comparing LLM API prices takes more than one number per model. Every model has an input, an output and a cache-read price, Claude adds a cache-write price, and reasoning models spend output tokens you never see. This guide shows live prices for every Claude, GPT and Gemini model on Lovely Router, explains how each kind of token is billed, and works through typical workloads so you can estimate a bill before you write code.
How LLM API pricing works
Prices are in US dollars per million tokens. A token is a piece of a word, and each model family splits text with its own tokenizer, so the same prompt comes to a different number of tokens on Claude, GPT and Gemini. Each call's usage splits into four kinds of token, each billed at its own price:
| Token kind | Claude usage field | GPT usage field | Gemini usage field |
|---|---|---|---|
| Uncached input | input_tokens | prompt_tokens minus cached_tokens | promptTokenCount minus cachedContentTokenCount |
| Cache read | cache_read_input_tokens | prompt_tokens_details.cached_tokens | cachedContentTokenCount |
| Cache write | cache_creation_input_tokens | no separate charge | no separate charge |
| Output, reasoning included | output_tokens | completion_tokens | candidatesTokenCount + thoughtsTokenCount |
The charge for one call is:
charge = ( uncached_input × input_price
+ cache_read × cache_read_price
+ cache_write × cache_write_price
+ output × output_price ) ÷ 1,000,000 × multiplierThe multiplier belongs to the channel group that served the call, and every live group bills at list price today. Models & pricing has the full rules. Three things in that formula move comparisons the most:
On every model in the table below, an output token costs several times an input token, so a long answer can cost more than a long prompt.
Claude's thinking, GPT's reasoning and Gemini's thoughts are billed at the output price, even when the reasoning text isn't returned. Effort settings (output_config.effort for Claude, reasoning_effort for GPT, thinkingConfig for Gemini) control how many you buy.
Claude caches what you mark with cache_control and bills writes slightly above the input price. GPT and Gemini cache long prefixes on their own, with no write charge. Reads cost a fraction of the input price on all three.
Live prices: Claude vs GPT vs Gemini
| 模型 | 上下文 | 输入 | 输出 | 缓存读取 |
|---|---|---|---|---|
| Claude Fable 5.1 claude-fable-5.1 | 1M | $10.00 | $50.00 | $0.25 |
| Claude Opus 5.5 claude-opus-5.5 | 1M | $4.00 | $20.00 | $0.20 |
| Claude Sonnet 5.5 claude-sonnet-5.5 | 1M | $2.00 | $10.00 | $0.10 |
| Claude Haiku 5.5 claude-haiku-5.5 | 1M | $0.10 | $0.50 | $0.01 |
| Claude Fable 5 claude-fable-5 | 1M | $10.00 | $50.00 | $1.00 |
| Claude Opus 5 claude-opus-5 | 1M | $5.00 | $25.00 | $0.50 |
| Claude Sonnet 5 claude-sonnet-5 | 1M | $2.00 | $10.00 | $0.20 |
| Claude Opus 4.8 claude-opus-4.8 | 1M | $5.00 | $25.00 | $0.50 |
| Claude Opus 4.7 claude-opus-4.7 | 1M | $5.00 | $25.00 | $0.50 |
| Claude Opus 4.6 claude-opus-4.6 | 1M | $5.00 | $25.00 | $0.50 |
| Claude Sonnet 4.6 claude-sonnet-4.6 | 1M | $3.00 | $15.00 | $0.30 |
| Claude Opus 4.5 claude-opus-4.5 | 200K | $5.00 | $25.00 | $0.50 |
| Claude Sonnet 4.5 claude-sonnet-4.5 | 1M | $3.00 | $15.00 | $0.30 |
| Claude Haiku 4.5 claude-haiku-4.5 | 200K | $1.00 | $5.00 | $0.10 |
| Gemini 3.1 Pro gemini-3.1-pro | 1.05M | $2.00 | $12.00 | $0.20 |
| Gemini 3 Flash gemini-3-flash | 1.05M | $0.50 | $3.00 | $0.05 |
| Gemini 4 Argon gemini-4-argon | 1.05M | $2.00 | $10.00 | $0.20 |
| Gemini 3.5 Flash gemini-3.5-flash | 1.05M | $1.50 | $9.00 | $0.15 |
| Gemini 3.8 Flash gemini-3.8-flash | 1.05M | $0.75 | $3.75 | $0.075 |
| Gemini 3.6 Flash gemini-3.6-flash | 1.05M | $0.75 | $3.75 | $0.075 |
| GPT-6 Astra gpt-6-astra | 1.05M | $10.00 | $50.00 | $1.00 |
| GPT-6.1 Sol gpt-6.1-sol | 1.05M | $2.00 | $10.00 | $0.10 |
| GPT-6 Sol gpt-6-sol | 1.05M | $2.00 | $10.00 | $0.20 |
| GPT-6.1 Terra gpt-6.1-terra | 1.05M | $1.00 | $5.00 | $0.05 |
| GPT-5.6 Sol gpt-5.6-sol | 400K | $2.00 | $10.00 | $0.20 |
| GPT-5.6 Terra gpt-5.6-terra | 400K | $2.00 | $12.00 | $0.20 |
| GPT-5.6 Luna gpt-5.6-luna | 400K | $0.20 | $1.20 | $0.02 |
| DeepSeek V4.1 Flash Abliterated deepseek-v4.1-flash-abliterated | 1.05M | $0.80 | $2.00 | $0.20 |
| Dongfangshuo 27B v2 dongfangshuo-27b-v2 | 131K | $1.50 | $23.40 | $0.15 |
每 100 万 token 的美元价格,实时来自目录。
Each row links to the model's page with its cache-write price and context window. The vendor pages, Claude API, GPT API and Gemini API, cover the API details, and the model marketplace shows live availability. The same list comes from GET https://lovelyrouter.com/v1/models, which needs no key.
Worked examples
Write P_in, P_out, P_read and P_write for a model's input, output, cache-read and cache-write prices from the table. Prices are per million tokens, so a million input tokens cost exactly P_in. Count tokens in millions and multiply.
A support chatbot#
Each reply reads 1,500 tokens (system prompt, retrieved snippets, the question) and writes 400. Ten thousand replies come to 15 million input and 4 million output tokens, so the bill is 15 × P_in + 4 × P_out. With output at five times the input price, those 4 million output tokens cost more than the 15 million input tokens.
An agent turn with a cached history#
The docs' example turn on claude-sonnet-5.5 has 1,200 uncached input tokens, 30,000 read from the cache, 2,000 written to it and 800 output: (1,200 × P_in + 30,000 × P_read + 2,000 × P_write + 800 × P_out) ÷ 1,000,000. On that model a cache read is a twentieth of the input price, so the 30,000 cached tokens cost what 1,500 uncached ones would. Without caching, all 33,200 input tokens are billed at P_in and the turn costs about four times as much. Claude prompt caching shows how to keep hits high.
A reasoning-heavy task#
A code review sends 6,000 input tokens and gets a 700-token answer, but the model reasons for 5,000 tokens first. You pay for 5,700 output tokens: 6,000 × P_in + 5,700 × P_out, per million. Most of that bill is reasoning. Try a lower effort setting on the same model, and check the answers still hold, before you switch models.
Bulk classification#
A million documents of 800 tokens, each labelled with a 20-token answer: 800 million input and 20 million output tokens, or 800 × P_in + 20 × P_out. Here the input price decides the bill. Put shared instructions first so they can be cached (automatically on GPT and Gemini once the prefix is long enough, with cache_control on Claude), and use the smallest model that labels accurately.
How to choose a model
Each vendor sells its models in tiers, from a small, cheap model to a large, expensive one. Compare within a tier first:
Haiku is Anthropic's small, fast model, Sonnet the balanced one, Opus and Fable the most capable: Claude Haiku 5.5, Claude Sonnet 5.5, Claude Opus 5.5.
The current line runs from gpt-6-astra at the top of the price range through GPT-6.1 Sol to GPT-5.6 Luna at the bottom.
Pro is Google's larger model and Flash the faster, cheaper one: Gemini 3.1 Pro, Gemini 3 Flash.
A practical way to choose:
- Start in the middle. Build on
claude-sonnet-5.5,gpt-6.1-solorgemini-3.1-pro. - Measure on your own prompts. A few hundred real requests with a pass/fail check tell you more than any leaderboard, and one key calls all three vendors.
- Step down where quality holds. Send easy traffic (classification, extraction, short replies) to the small model of the same family.
- Step up only where it doesn't. Use the top tier for the hardest requests, not by default.
- Compare cost per finished task. A cheaper model that needs more turns or retries can cost more per result.
Walkthrough: estimate a workload on every model
This script reads live prices from GET /v1/models and prints what a month of the chatbot workload would cost on each model, cheapest first. Install requests and run it; no key needed.
import requests
# Tokens per request. Add cache_read / cache_write if your prompts reuse a prefix.
workload = {"input": 1_500, "cache_read": 0, "cache_write": 0, "output": 400}
requests_per_month = 10_000
multiplier = 1.0 # your channel group's multiplier, shown on the model marketplace
def cost_per_request(model):
p = model["pricing"]
read = p["input"] if p.get("cache_read") is None else p["cache_read"]
# Only Claude bills cache writes separately; elsewhere they are ordinary input.
write = p["cache_write"] if model["owned_by"] == "Anthropic" else p["input"]
tokens = (workload["input"] * p["input"] + workload["cache_read"] * read
+ workload["cache_write"] * write + workload["output"] * p["output"])
return tokens / 1_000_000 * multiplier
models = requests.get("https://lovelyrouter.com/v1/models", timeout=30).json()["data"]
text_models = [m for m in models if m["pricing"].get("input") is not None] # skips image models
rows = sorted((cost_per_request(m) * requests_per_month, m["owned_by"], m["id"]) for m in text_models)
for monthly, vendor, model_id in rows:
print(f"{vendor:10} {model_id:24} {monthly:12.2f} USD per month")Change workload to your own token mix, measured from usage on a few real requests, and the ranking changes with it: output-heavy work favors models with a low output price, long-context work a low input or cache-read price.
Pitfalls
For chat and generation, output often decides the bill.
A reasoning model's visible answer may be a small part of the output you pay for. Read usage on real requests.
Each family tokenizes differently. Measure with count_tokens (Claude) or :countTokens (Gemini), both free, or from usage in a test run.
For agents and long chats most input is cache reads, so the cache-read column matters more than the input column.
Vendor features such as Claude's cache_control are only certain to work in the model's own format, so a cross-format call can lose its cache discount.
Frequently asked questions
Which is cheapest: Claude, GPT or Gemini?+
It depends on the tier and the workload, so there is no single cheapest LLM API. Each vendor's small model costs far less than its top model, so compare like with like, for example claude-haiku-5.5, gpt-5.6-luna and gemini-3-flash, then run your own token mix through each. The table above has the live prices.
Are reasoning and thinking tokens billed?+
Yes, at the output price. Claude's thinking is counted in output_tokens, GPT's reasoning in completion_tokens and Gemini's in thoughtsTokenCount, even when the reasoning text isn't returned to you.
How are cached tokens priced?+
Cache reads are billed at each model's cache-read price, a fraction of its input price. Claude also bills cache writes at a cache-write price slightly above input; GPT and Gemini have no separate write charge.
Is there a subscription or minimum spend?+
There is no subscription or monthly fee. You add prepaid credit from $5, and each call is deducted from your balance within seconds of finishing. Requests refused before they reach a model, and requests that fail, are not charged.
Can I compare Claude, GPT and Gemini with one API key?+
Yes. One key calls every model in its native API: Claude through Anthropic Messages, GPT through Chat Completions or Responses, Gemini through the Gemini API. Logs show each call's tokens and charge side by side.
Browse the model marketplace for live availability, read Models & pricing for the exact billing rules, or see pricing for every product on one page.