LLM API Price Comparison (2026): Costs per Task and Code
Unicorn API Team · · 11 min read
An LLM API price comparison only helps if it compares what you actually pay for: tokens in, tokens out, and how often you send the same text again. Most pricing pages show one headline number, and that number rarely matches the bill. This guide puts eight current chat models side by side, converts their prices into dollars and into cost per request, and gives you code to measure the real cost on your own prompts.
All prices below are as listed on Unicorn API on 20 November 2026, where every model is billed in credits from one account. A credit costs $0.01 on a monthly plan and $0.015 as a top-up (top-ups never expire), so on a plan you can read credit numbers directly as cents.
How to read an LLM API price comparison
An LLM (large language model) API charges by the token. A token is a chunk of text, often a short word or a piece of a longer one. Every request has two token counts, and most models price them differently. Prices are almost always quoted per million tokens, because a single request costs a fraction of a cent.
- Input tokens: everything you send. That includes the system prompt, the conversation history, any documents you paste in and tool definitions, not only the user’s latest message.
- Output tokens: everything the model writes back. On every model in this comparison, output costs between about 4x and 5x the input price.
- Cached input tokens: input the provider has seen recently and stored, typically a long, repeated prefix such as a fixed system prompt. These are billed at a steep discount.
- Cache write tokens: some models charge a separate rate the first time a prefix is stored in the cache.
So a useful llm api price comparison needs at least two columns, input and output, and ideally a third for cached input. A table that sorts by input price alone will mislead you whenever your app writes long answers.
One more variable: all of the models here accept a reasoning_effort field. Higher settings typically make a model produce more tokens before it answers, so judge cost from the usage the API reports, not from how long the visible reply looks. On Unicorn API, the exact cost of a chat request is debited from the usage the model reports.
LLM API price comparison table (November 2026)
Here is the full llm api price comparison for eight chat models from OpenAI, Anthropic, Google and DeepSeek. Credits are per million tokens; the dollar figures use the monthly-plan rate of $0.01 per credit. For top-up pricing, multiply the dollar figures by 1.5.
| Model | Provider | Input / 1M | Output / 1M | Cached input / 1M | Cache write / 1M |
|---|---|---|---|---|---|
| DeepSeek V4.1 Flash | DeepSeek | 24 ($0.24) | 95 ($0.95) | 0.5 ($0.005) | not listed |
| Gemini 3.8 Flash OpenAI | 45 ($0.45) | 225 ($2.25) | not listed | not listed | |
| GPT 6.2 Sol | OpenAI | 120 ($1.20) | 600 ($6.00) | 6 ($0.06) | 150 ($1.50) |
| Gemini 4 Neon | 240 ($2.40) | 1,200 ($12.00) | 12 ($0.12) | not listed | |
| Gemini 4 Neon OpenAI | 240 ($2.40) | 1,200 ($12.00) | 12 ($0.12) | not listed | |
| Claude Opus 5.5 | Anthropic | 320 ($3.20) | 1,600 ($16.00) | 32 ($0.32) | 32 ($0.32) |
| GPT 6.2 Astra | OpenAI | 480 ($4.80) | 2,400 ($24.00) | 24 ($0.24) | 600 ($6.00) |
| GPT 6 Astra | OpenAI | 560 ($5.60) | 2,800 ($28.00) | 56 ($0.56) | 700 ($7.00) |
A few things stand out:
- The spread is wide. GPT 6 Astra’s input price is about 23x DeepSeek V4.1 Flash’s, and its output price about 29x.
- Output is the expensive half. Six of the eight models price output at exactly 5x input. DeepSeek V4.1 Flash is closer to 4x.
- Newer is cheaper within the GPT 6 family. GPT 6.2 Astra, released 19 November 2026, costs 480 credits per million input tokens against 560 for GPT 6 Astra, and its cached input rate is less than half (24 vs 56). If you are on GPT 6 Astra today, that is worth a test. Our GPT 6 Astra guide covers the family in more detail.
- Gemini 4 Neon comes in two listings at the same price. On cost alone there is nothing to choose between them.
Blended price: one number for quick sorting
When you need a single figure, a common shortcut is a blended price that assumes 3 input tokens for every output token: (3 × input + output) ÷ 4. It is crude, but far better than sorting by input price.
| Model | Blended credits / 1M (3:1) | Blended $ / 1M (plan rate) |
|---|---|---|
| DeepSeek V4.1 Flash | 41.75 | $0.42 |
| Gemini 3.8 Flash OpenAI | 90 | $0.90 |
| GPT 6.2 Sol | 240 | $2.40 |
| Gemini 4 Neon / Neon OpenAI | 480 | $4.80 |
| Claude Opus 5.5 | 640 | $6.40 |
| GPT 6.2 Astra | 960 | $9.60 |
| GPT 6 Astra | 1,120 | $11.20 |

What does a request really cost? A worked example
Per-million prices are hard to feel. Cost per request is easier. Take a customer-support assistant where a typical call sends 2,000 input tokens (system prompt, a little history, the customer’s message) and gets back 500 output tokens. The formula is:
credits = input_tokens × input_price ÷ 1,000,000 + output_tokens × output_price ÷ 1,000,000
| Model | Credits per request | Credits per 100,000 requests | $ per 100,000 (plan rate) |
|---|---|---|---|
| DeepSeek V4.1 Flash | 0.0955 | 9,550 | $95.50 |
| Gemini 3.8 Flash OpenAI | 0.2025 | 20,250 | $202.50 |
| GPT 6.2 Sol | 0.54 | 54,000 | $540 |
| Gemini 4 Neon | 1.08 | 108,000 | $1,080 |
| Claude Opus 5.5 | 1.44 | 144,000 | $1,440 |
| GPT 6.2 Astra | 2.16 | 216,000 | $2,160 |
| GPT 6 Astra | 2.52 | 252,000 | $2,520 |
Now map that onto real plans. At 100,000 requests a month, DeepSeek V4.1 Flash uses 9,550 credits, which fits inside the Studio plan ($100 for 10,000 credits). Gemini 3.8 Flash OpenAI needs 20,250 credits: the Pro plan ($200, 20,000 credits) plus a top-up of about 250 credits. The other models in this workload need larger top-ups on top of a plan. See plans and credit prices for the current options.
Notice how much of each bill comes from output. On GPT 6.2 Sol, 500 output tokens cost 0.3 credits while 2,000 input tokens cost 0.24. Output is a quarter of the tokens and more than half the cost. Flip the shape to a writing tool that sends 500 tokens and gets 2,000 back, and GPT 6.2 Sol rises to 1.26 credits per request. Any llm api price comparison you run should use your own input-to-output ratio, not someone else’s.
Which is the cheapest LLM API, and when is cheap the wrong choice?
On raw token prices, the cheapest LLM API in this list is DeepSeek V4.1 Flash, followed by Gemini 3.8 Flash OpenAI and then GPT 6.2 Sol. If your task is classification, extraction, short summaries or routing, start there: the gap to the flagship models is an order of magnitude.
Cheap per token is not the same as cheap per finished task, though. Three things can erase the savings:
- Retries. If a cheaper model gets an answer wrong one time in five and you have to re-run it on a bigger model, you pay twice for that request. Count the cost of a successful task.
- Verbosity. Some models write longer answers for the same question. Since output is the expensive half, a model that is half the price per token but writes twice as much costs the same.
- Human time. For high-stakes work, such as code changes, legal or financial drafting, the model’s price is often small next to the cost of someone fixing a weak answer.
A practical pattern is tiering. Send every request to a cheap model first, and escalate to a stronger one only when a check fails: invalid JSON, a low-confidence flag, a failing test. Because Unicorn API exposes all of these models through the same endpoint, escalation is one changed string in the model field.
We are not quoting quality benchmarks here, because the only fair benchmark is your own data. Run 50 to 100 real prompts through two or three candidates and compare cost per acceptable answer. The script further down does the cost half of that for you.
How prompt caching changes the math
Prompt caching is the biggest lever most teams ignore. If many requests start with the same long prefix (a detailed system prompt, a product manual, a codebase summary), providers can store that prefix and bill repeat reads at a cached rate. The cache typically only matches when the prefix is identical, and cached entries expire after a while, so it pays to understand the rules before you count on it.
Look at the cached column in the llm api price comparison table above. The discounts are steep:
- GPT 6.2 Sol: 6 credits per million cached, against 120 uncached, a 20x cut.
- GPT 6.2 Astra: 24 against 480, also 20x.
- Claude Opus 5.5: 32 against 320, a 10x cut, and its cache write rate is also 32, so storing the prefix costs the same as reading it.
- DeepSeek V4.1 Flash: 0.5 against 24, about 48x.
- Gemini 3.8 Flash OpenAI has no cached rate listed, so assume full input price.
A worked caching example
Say your app sends a 10,000-token system prompt with every call, 1,000 calls a day, on GPT 6.2 Sol.
- Without caching: 10,000 tokens × 120 ÷ 1,000,000 = 1.2 credits per call, or 1,200 credits a day for the prefix alone.
- With caching: one cache write at 150 credits per million (1.5 credits), then 999 cached reads at 6 credits per million (0.06 credits each, about 59.9 credits). Total: about 61.4 credits a day.
That is roughly 20x cheaper for the repeated part, even after paying the write. In practice the cache will expire and be rewritten some number of times a day, so your real figure will sit a little higher, but the order of magnitude holds.
To get these savings, structure prompts so the stable content comes first and the variable content (the user’s question, today’s date, a request ID) comes last. Putting a timestamp at the top of your system prompt quietly breaks caching on every call.

How to measure your own LLM API costs with code
Tables give you prices; only your traffic gives you costs. Every model here uses the same OpenAI-compatible request shape at POST /v1/chat/completions, so testing several of them is a loop. First, a single call with curl, after you create an API key:
curl https://api.unicornapi.net/v1/chat/completions \
-H "Authorization: Bearer $UNICORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-6-2-sol",
"messages": [{"role": "user", "content": "Write one sentence about unicorns."}],
"max_tokens": 200
}'
The response includes a usage object with the token counts the model reports. The Python script below sends the same prompt to six models, reads that usage and converts it into credits and dollars, which turns the published llm api price comparison into numbers for your workload:
import os
import requests
API = "https://api.unicornapi.net/v1/chat/completions"
HEADERS = {
"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}",
"Content-Type": "application/json",
}
# Credits per 1,000,000 tokens: (input, output)
PRICES = {
"deepseek-v4-1-flash": (24, 95),
"gemini-3-8-flash-openai": (45, 225),
"gpt-6-2-sol": (120, 600),
"gemini-4-neon": (240, 1200),
"claude-opus-5-5": (320, 1600),
"gpt-6-2-astra": (480, 2400),
}
SYSTEM = "You are a support assistant for an online bike shop. Be concise."
PROMPT = "My order arrived with a bent wheel. What are my options?"
for model, (in_price, out_price) in PRICES.items():
resp = requests.post(
API,
headers=HEADERS,
json={
"model": model,
"messages": [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": PROMPT},
],
"max_tokens": 500,
},
timeout=120,
)
resp.raise_for_status()
usage = resp.json()["usage"]
tokens_in = usage["prompt_tokens"]
tokens_out = usage["completion_tokens"]
credits = (tokens_in * in_price + tokens_out * out_price) / 1_000_000
print(
f"{model:26} in={tokens_in:>6} out={tokens_out:>6} "
f"credits={credits:.4f} plan=${credits * 0.01:.5f} "
f"top-up=${credits * 0.015:.5f}"
)
Swap in 50 or 100 real prompts from your logs and sum the results. Two notes: the script ignores cached-token discounts, so treat its totals as an upper bound, and the different token counts per model are real, since models split text into tokens differently.
If you want the exact price of a request before you run it, Unicorn API has a pricing endpoint, POST /v1/models/price; the API documentation covers its request format. To compare answers by eye before writing any code, the chat playground lets you try the same prompt across models in the browser, and the agent integration lets you call them from Cursor or Claude Code.
Free LLM API keys: what to expect
Many searches for an llm api price comparison start with a hope that the answer is zero. Some providers do run free tiers, usually with tight rate limits, a restricted set of smaller models, or different terms on how your data is used. They are fine for a weekend prototype and rarely survive contact with real users.
Lists of “free LLM API keys” on GitHub are a different matter. Those are leaked credentials: using one bills a stranger, breaks the provider’s terms, and tends to stop working without warning once the key is revoked. Building anything on them is a bad idea.
The honest alternative is that cheap models are close to free at test scale. Using the worked example above, 1,000 test requests on DeepSeek V4.1 Flash cost about 95.5 credits, under $1 at the plan rate. Even GPT 6.2 Sol runs those 1,000 requests for 540 credits. A cheap LLM API with predictable billing will usually serve you better than a free one with unknown limits.
Mistakes people make when comparing LLM API prices
- Sorting by input price. Output costs about 5x input on most models. An llm api price comparison that ignores the output column gets the ranking wrong for any chatty or generative app.
- Forgetting resent context. In a chat, the whole history is typically sent again on every turn, so turn 20 costs far more than turn 1. Trim or summarise history.
- Ignoring caching. If you reuse a long prefix and do not structure prompts for caching, you are paying full price for the same tokens many times a day.
- Assuming token counts match across models. The same paragraph can be a different number of tokens on different models. Measure, as the script above does.
- Leaving
max_tokensunset. A runaway answer on an expensive model is the easiest way to blow a budget. Set a ceiling that fits the task. - Using stale tables. Several models in this comparison were released within the last ten days. Prices and lineups change quickly, so check the model catalog before a big decision, and rerun your cost script when a new version lands.
- Comparing price, not cost per success. A cheap model that needs two attempts can cost more than a mid-priced one that gets it right first time.
The short version: use the table to build a shortlist, use the worked example to sanity-check your monthly spend, and use your own prompts to make the final call. With every model on one key and one bill, running that comparison takes minutes rather than a week of separate sign-ups.
Frequently asked questions
What is the cheapest LLM API right now?
Among the chat models on Unicorn API in November 2026, DeepSeek V4.1 Flash is the cheapest: 24 credits per million input tokens and 95 per million output, which is $0.24 and $0.95 at the monthly-plan rate. Gemini 3.8 Flash OpenAI is next at 45 and 225, then GPT 6.2 Sol at 120 and 600. Cheapest per token is not always cheapest per finished task, so test on your own prompts.
How do you compare LLM API prices fairly?
Compare cost per task, not the headline input price. Count the input and output tokens of a typical request, multiply each by the model's per-million price, and add them. Include the system prompt and chat history you resend every turn, cached-token discounts if you reuse long prefixes, and retries for answers you reject. A blended 3:1 input-to-output figure is a reasonable quick shortcut.
Is there a free LLM API key I can use?
Some providers offer free tiers with tight rate limits, smaller models or different data terms. Keys posted publicly on GitHub are leaked credentials: using them bills someone else and breaks the provider's terms, and they usually get revoked quickly. For testing, a cheap model costs very little: about 1,000 typical requests on DeepSeek V4.1 Flash come to under 100 credits, roughly $1.
Why do output tokens cost more than input tokens?
A model reads all your input tokens in one parallel pass, but it generates output one token at a time, and each new token needs another step through the model. That makes output more expensive to serve. On most models in this comparison, output is priced at 5x input; DeepSeek V4.1 Flash is closer to 4x. Long answers therefore dominate many bills.
How much does 1 million tokens cost on an LLM API?
It depends on the model and on whether the tokens are input or output. On Unicorn API, a million input tokens ranges from 24 credits ($0.24) on DeepSeek V4.1 Flash to 560 credits ($5.60) on GPT 6 Astra, and a million output tokens from 95 to 2,800 credits. Credits cost $0.01 on a monthly plan and $0.015 as a top-up.
Can one API key access OpenAI, Anthropic, Google and DeepSeek models?
Yes. Unicorn API serves GPT 6.2 Astra, GPT 6.2 Sol, Claude Opus 5.5, Gemini 4 Neon, Gemini 3.8 Flash OpenAI, DeepSeek V4.1 Flash and more through one OpenAI-compatible endpoint, POST /v1/chat/completions. You change the model field to switch, and every request is billed in the same credits on one bill, which makes side-by-side cost tests straightforward.