Claude AI API Pricing (2026): How Token Costs Add Up
Unicorn API Team · · 11 min read
Claude AI API pricing is metered: Anthropic charges for every token your application sends to a Claude model and every token it generates back, at a rate that depends on which model tier you call. There is no flat fee for the API, and your chat subscription does not cover it. Once you understand the handful of variables in the bill, you can predict your monthly cost before you write much code, and cut it once you ship.
This guide explains how the billing works, what changes the price of a single request, how to estimate a real workload step by step, and the mistakes that make bills balloon. We deliberately do not reprint Anthropic’s per-token rates here: they change with each model release, and copied numbers go stale fast. Keep the official pricing page open next to this article and plug the current figures into the formulas below.
How Claude AI API pricing works
Claude AI API pricing rests on one unit: the token. A token is a chunk of text the model reads or writes, often a short word or a piece of a longer one. Code, non-English text and unusual formatting tend to split into more tokens than plain English prose, so the same “length” of content can cost different amounts.
Every request has two token counts, and each has its own rate:
- Input tokens: everything you send. That includes the system prompt, the full conversation history you pass back each turn, any documents or images you attach, and tool definitions.
- Output tokens: everything the model writes back, including any visible “thinking” or reasoning text the model produces before its final answer.
Rates are quoted per million tokens (often written “per MTok”). Output is priced well above input for every Claude model, because generating text one token at a time is far more compute-intensive than reading a prompt in parallel. That single fact explains most surprises in Claude AI API pricing: a short prompt that produces a long answer can cost more than a long prompt that produces a one-line answer.
The three model tiers
Anthropic ships Claude in tiers that trade capability for price. Opus is the largest and most expensive, Sonnet sits in the middle and is the default choice for many production apps, and Haiku is the small, fast, cheap tier. The gap between the top and bottom tier is large, so model choice is usually the biggest single lever on your bill, bigger than any prompt optimisation.
The basic formula
cost = (input_tokens / 1,000,000) × input_rate
+ (output_tokens / 1,000,000) × output_rate
Everything else in this article is a modifier on that formula: cheaper rates for cached input, discounts for batch work, surcharges for very long prompts, and per-use fees for certain tools.
Claude subscriptions vs API billing
A common source of confusion in searches for Claude AI API pricing is the overlap with Claude’s consumer and team plans. They are separate products with separate bills:
| Product | Who it is for | How you pay | Covers API calls from your code? |
|---|---|---|---|
| Free, Pro, Max | Individuals using the Claude apps | Flat monthly or yearly fee, with usage limits | No |
| Team, Enterprise | Organisations using the Claude apps | Per seat, per month | No (Enterprise may bundle API usage by contract) |
| Claude API | Developers building apps, agents and scripts | Pay per token, billed through the developer console | Yes |
If your team pays for Max seats and you then build an internal tool that calls Claude, the tool’s usage lands on the API bill, not the subscription. Subscriptions make sense when people chat with the model directly. The API makes sense when software does. For a coding assistant used heavily by one person, a subscription with generous limits can come out cheaper than raw API usage; for an app serving thousands of users, only the API works at all.

What changes the price of a single request
The base formula gets you close, but four modifiers decide whether your real bill matches your estimate.
Prompt caching
Prompt caching lets the provider store a prefix of your prompt (a long system prompt, a product manual, a codebase summary) so later requests that reuse it are billed at a much lower “cache read” rate. The first request that creates the cache pays a “cache write” rate that is higher than normal input. Caching pays off when the same prefix is reused many times within the cache’s lifetime; it costs you extra when it is not.
Batch processing
Anthropic offers an asynchronous batch interface: you submit many requests at once and collect results later, in exchange for a discount on both input and output. It suits overnight jobs such as classifying a backlog of tickets, summarising documents or generating product descriptions. It does not suit anything a user is waiting on.
Long-context surcharges
Some Claude models charge a higher per-token rate once a single request crosses a long-context threshold. If you routinely stuff very large documents into one prompt, check whether your model has this tier, because the higher rate typically applies to the whole request, not just the tokens above the line.
Thinking and tool use
Extended thinking (the model reasoning step by step before answering) is billed as output tokens, the expensive kind. Tool use adds input tokens for the tool definitions and results, and some server-side tools, such as web search, carry their own per-use fee on top of tokens. An agent that loops through ten tool calls is ten requests, each resending the growing history.
Taken together, these modifiers mean Claude AI API pricing is better thought of as a range than a single number: the same model can cost several times more or less depending on how you call it.
How to estimate your Claude API bill, step by step
Estimating cost is a five-step exercise you can do in a spreadsheet before committing to a model.
- Define one typical request. Write down the system prompt, an average user message and the average history length you will send.
- Measure tokens, do not guess. Run ten or twenty real examples and read the token counts from the API’s usage field. Averages from real traffic beat any rule of thumb.
- Split input into cached and uncached. Anything identical across requests (system prompt, reference docs) is a caching candidate.
- Multiply by volume. Requests per day × 30, then apply the formula with current rates for each token type.
- Add a margin. Retries, failed tool loops and unusually long answers push real usage above the average. Build in headroom and set a spending alert.
A worked example with real numbers
Because we will not reprint Anthropic’s rates, here is the same method applied to a chat model whose prices we can state exactly: GPT 6.1 Terra on Unicorn API. It is billed at 60 credits per million input tokens, 300 credits per million output tokens, 3 credits per million cached input tokens and 75 credits per million cache-write tokens. On a monthly plan a credit costs $0.01, so that is $0.60 per million input tokens and $3.00 per million output tokens.
Take a support assistant handling 1,000 requests, each with 2,000 input tokens and 500 output tokens:
- Input: 2,000,000 tokens × 60 credits per million = 120 credits
- Output: 500,000 tokens × 300 credits per million = 150 credits
- Total: 270 credits, which is $2.70 on a monthly plan or $4.05 with top-up credits at $0.015 each
Now suppose 1,500 of those 2,000 input tokens are a fixed system prompt that gets cached:
- Cached input: 1,500,000 tokens × 3 credits per million = 4.5 credits
- Uncached input: 500,000 tokens × 60 credits per million = 30 credits
- Output: unchanged at 150 credits
- Total: about 185 credits, plus a small cache-write charge each time the cache is refreshed
Two lessons carry straight over to Claude AI API pricing. First, output was more than half the bill even though it was a quarter of the tokens. Second, caching cut the input cost dramatically but could not touch the output cost. If you want a cheaper bill, shorter answers often matter more than shorter prompts.

Claude vs OpenAI vs Google: an AI API pricing comparison
People searching for Claude AI API pricing usually compare it with OpenAI API pricing and Google AI API pricing in the same session. The good news is that the three use nearly the same structure, so one spreadsheet works for all of them.
| Billing feature | Anthropic (Claude) | OpenAI (GPT) | Google (Gemini) |
|---|---|---|---|
| Unit | Per million tokens | Per million tokens | Per million tokens |
| Separate input and output rates | Yes | Yes | Yes |
| Discounted cached input | Yes, with a paid cache write | Yes | Yes (context caching) |
| Discounted batch processing | Yes | Yes | Yes |
| Reasoning tokens billed as output | Yes | Yes | Yes |
| Chat subscription covers API? | No | No | No |
Where they differ is in the actual rates per tier, the long-context thresholds, tool fees and how aggressively each provider discounts caching. Those details change with almost every model launch, so the only fair comparison is to run your own prompts through each candidate and multiply the reported token counts by today’s rates. Comparing headline input prices alone is misleading: a model with a cheaper input rate but more verbose answers can cost more in practice.
The same logic applies to newer providers such as Moonshot AI, Z.ai and DeepSeek, which tend to compete on lower per-token prices for strong models. We broke down one of them in our DeepSeek 4.1 pricing guide.
Tracking real cost per request (with code)
Whatever provider you use, the most reliable cost data comes from the usage object returned with each response. Log it on every call and you will never have to guess. The example below calls GPT 6.1 Terra through Unicorn API’s OpenAI-compatible chat endpoint and turns the reported usage into credits. The same pattern works for any chat model in the catalog: swap the model id and the rates.
First, a quick test with curl. Create a key on the API keys page and export it as UNICORN_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-1-terra",
"messages": [
{"role": "system", "content": "You are a concise support assistant."},
{"role": "user", "content": "How do I reset my password?"}
],
"max_tokens": 200
}'
Then a Python version that prints the cost of each request:
import os
import requests
BASE_URL = "https://api.unicornapi.net"
HEADERS = {
"Authorization": f"Bearer {os.environ['UNICORN_API_KEY']}",
"Content-Type": "application/json",
}
# GPT 6.1 Terra rates, in credits per 1,000,000 tokens
INPUT_RATE = 60
CACHED_INPUT_RATE = 3
OUTPUT_RATE = 300
USD_PER_CREDIT = 0.01 # monthly plan rate; top-ups are 0.015
def ask(messages, max_tokens=300):
resp = requests.post(
f"{BASE_URL}/v1/chat/completions",
headers=HEADERS,
json={
"model": "gpt-6-1-terra",
"messages": messages,
"max_tokens": max_tokens,
},
timeout=60,
)
resp.raise_for_status()
data = resp.json()
usage = data.get("usage") or {}
prompt_tokens = usage.get("prompt_tokens", 0)
completion_tokens = usage.get("completion_tokens", 0)
details = usage.get("prompt_tokens_details") or {}
cached_tokens = details.get("cached_tokens") or 0
uncached_tokens = prompt_tokens - cached_tokens
credits = (
uncached_tokens * INPUT_RATE
+ cached_tokens * CACHED_INPUT_RATE
+ completion_tokens * OUTPUT_RATE
) / 1_000_000
print(
f"in={prompt_tokens} (cached {cached_tokens}) out={completion_tokens} "
f"~{credits:.4f} credits (~${credits * USD_PER_CREDIT:.6f})"
)
return data["choices"][0]["message"]["content"]
if __name__ == "__main__":
answer = ask([
{"role": "system", "content": "You are a concise support assistant."},
{"role": "user", "content": "How do I reset my password?"},
])
print(answer)
The printed figure is an estimate; the amount actually debited comes from the usage the model reports, and the account dashboard shows the final total. Run this across a few hundred representative prompts and you have a real cost-per-request number to multiply by your expected traffic. For agents and editors that call models through MCP, the same key works from Cursor, Claude Code and similar tools, as described on the agents page.
Why one key and one bill helps
Most real products end up using more than one model: a chat model for text, an image model such as GPT Image 1.5 or Nano Banana 2 Lite for visuals, perhaps a video model. Each provider has its own console, its own billing unit and its own invoice. Unicorn API prices everything in credits, and for media jobs you can get the exact price of a request before running it via POST /v1/models/price, so budgeting across models stays in one place. Plan details are on the pricing page and request shapes are in the docs.
Common mistakes that inflate API bills
Most overspending on Claude AI API pricing comes from a short list of avoidable habits:
- Resending the whole conversation every turn. Chat APIs are stateless, so naive implementations send the full history each time. Input cost then grows with every message. Summarise older turns or trim them past a limit. Anthropic has also been working on ways for agents to send only new messages, which we covered in this news piece.
- Defaulting to the top tier. Teams prototype on Opus and never test whether Sonnet or Haiku passes the same checks. Build a small evaluation set and try the cheaper tier first.
- No
max_tokenscap. Without a ceiling, a rambling answer or a loop can generate far more expensive output than you planned. - Caching things that change. Putting a timestamp or user name at the start of a cached prefix breaks the cache on every request, so you pay cache-write rates for nothing. Keep variable content at the end.
- Leaving thinking on everywhere. Extended reasoning helps on hard problems and wastes output tokens on easy ones. Turn it on per task, not globally.
- Running batch-friendly work in real time. Overnight jobs belong in the batch interface, where they cost less.
- Estimating from word counts. Code, JSON and non-English text tokenise very differently from English prose. Measure with the usage field.
- No spending alerts. A bug in an agent loop can burn through a budget in hours. Set limits in the provider console from day one.
Is Claude worth the price for your use case?
Price per token only matters relative to the work you get back. A more capable model that solves a task in one pass can be cheaper than a budget model that needs three retries and a human fix. The sensible approach to Claude AI API pricing is empirical: pick two or three candidate models, run your real prompts through each, record quality and cost per successful result, and choose on that.
A practical decision rule:
- High-volume, simple tasks (classification, extraction, short replies): start with the smallest tier and only move up if quality checks fail.
- Everyday product features (support chat, drafting, summarisation): a mid tier is usually the sweet spot.
- Hard reasoning, complex code, long agent runs: the top tier can justify its cost, but cap output and watch reasoning tokens.
Revisit the decision whenever a new model ships. Prices and capabilities in this market move every few months, and a model that was too expensive last quarter may now be the cheapest option that works. If you would rather compare several chat and media models without opening an account with each provider, browse the Unicorn API catalog and test them with one key.
Frequently asked questions
Does a Claude Pro or Max subscription include API access?
No. Pro, Max, Team and Enterprise seats cover the Claude apps and their usage limits. Calls you make from your own code go through the developer API, which has its own account, its own keys and its own metered bill based on tokens. If you build a product or a script on Claude, budget for API usage separately from any chat subscription your team already pays for.
How much does one Claude API request cost?
It depends entirely on tokens. Multiply the input tokens by the model's input rate, add the output tokens multiplied by the output rate, and divide by one million because rates are quoted per million tokens. Cached input, batch jobs, long-context requests and tools such as web search change the result. The response's usage field reports exact token counts, so log it on every call to see your real cost per request.
Why are output tokens more expensive than input tokens?
Generating text is slower and more compute-heavy than reading it. The model processes your whole prompt in parallel, but it produces the answer one token at a time, so each output token occupies the hardware for longer. That is why Claude, OpenAI and Google all price output well above input, and why capping max_tokens and asking for shorter answers usually saves more than trimming the prompt.
How can I lower my Claude API bill?
Use the smallest model tier that passes your quality checks, cache long system prompts and shared documents, send non-urgent work through the batch interface, cap max_tokens, and ask for concise or structured output. Also stop resending full conversation histories when a summary would do. Measure before and after each change using the token counts in the usage field rather than guessing.
How does Claude API pricing compare with OpenAI and Google?
The structure is nearly identical: all three bill per million tokens with separate input and output rates, discount cached input, and offer cheaper asynchronous batch processing. The differences are in the actual rates per model tier, long-context surcharges and tool fees, which change often. Compare them on your own workload by running the same prompts through each model and multiplying the reported token counts by current rates.