How Anthropic bills the Claude API
Every call to the Messages API is metered in tokens. A token is roughly four characters of English, so a short sentence is a dozen or so tokens and a long document is thousands. You pay for the tokens you send in and the tokens the model generates back.
Those two halves are priced separately, and this is the part founders miss. Input tokens (your prompt, system message, and any context) are cheap. Output tokens (what Claude writes) cost several times more per token, and on a real bill the output side usually dominates.
Price also depends on the model. Haiku is the cheap fast tier, Sonnet is the balanced workhorse, and Opus is the expensive high reasoning tier. Pick Opus for a chatty high volume feature and your bill can be five times what the same feature costs on Sonnet.
Claude API prices in 2026
Here are the current published prices per million tokens, input and output. Confirm them on the Anthropic pricing page before you rely on any number, because Anthropic reprices over time.
Model Model ID Input $/M Output $/M
------------------------------------------------------------------
Claude Haiku 4.5 claude-haiku-4-5 1.00 5.00
Claude Sonnet 4.6 claude-sonnet-4-6 3.00 15.00
Claude Opus 4.8 claude-opus-4-8 5.00 25.00
All figures per 1,000,000 tokens. Current as of July 2026.Read the output column carefully. Opus charges $25 per million output tokens, five times its own input price and far above what a budget model charges for the same generated text. Because output usually dominates, the model you assign to your highest volume feature is the single biggest lever on your Claude bill. For a worked example, see the Claude API cost calculator, and to see how these rates stack up against GPT, read Anthropic vs OpenAI billing.
What the Anthropic console shows
Open the console billing and usage pages and you get real, useful numbers. You see your account total for the period, totals per workspace, spend broken down by model, and spend by day. That is enough to answer questions like which model is eating the budget and whether spend spiked yesterday.
What you do not see is who caused it. There is no view that says this customer cost you $40 this month and that one cost $0.12. The console reports at the levels Anthropic actually knows about: your account and your workspaces, sliced by model and by day.
The reason is structural. Every request your backend sends arrives under one API key, so from Anthropic’s side it all looks like your app. Your customers do not exist on their side of the wire, so they cannot appear in their reports. It is the same gap you hit with OpenAI cost per user.
How prompt caching changes the bill
Prompt caching is the most useful billing feature Anthropic offers and the one most founders underuse. If you send the same large context (a system prompt, a document, a tool schema) across many calls, you can cache it so you are not charged full input price every time.
The economics are lopsided in your favor on reads. Cache read tokens bill at roughly 0.1x the standard input rate, a 90 percent discount. For Sonnet that is $0.30 per million cache read tokens instead of $3.00. Writing to the cache costs a small premium: the 5 minute cache write bills at roughly 1.25x the input rate.
You do not have to guess whether it worked. The usage object splits the counts out for you:
const message = await anthropic.messages.create({
model: 'claude-sonnet-4-6',
max_tokens: 1024,
messages,
})
console.log(message.usage)
// {
// input_tokens: 42, // billed at 3.00 / M
// output_tokens: 210, // billed at 15.00 / M
// cache_read_input_tokens: 8400, // billed at ~0.30 / M
// cache_creation_input_tokens: 0, // 5 min write, ~1.25x input
// }Watch cache_read_input_tokens and cache_creation_input_tokens on your responses. When a big reused prompt is landing mostly as cache reads, the input portion of your bill drops sharply. This is one of the highest leverage moves in Claude API cost optimization.
The Batch API discount
If a job does not need an answer right now, the Batch API cuts the price in half. You submit a batch of requests, Anthropic processes them within a window rather than instantly, and you pay 50 percent off both input and output tokens.
This is the cheapest way to run anything bulk and non interactive: evals over a test set, backfilling summaries for old records, overnight classification. On Sonnet that turns $3 in and $15 out into $1.50 in and $7.50 out.
The rule of thumb is simple. If a human is waiting on the response, use the standard API. If a machine will read the output later, batch it and take the discount.
How workspaces and organization billing work
An organization is your top level Anthropic account. Inside it you can create workspaces, and each workspace has its own API keys, its own spend limits, and its own line in the usage breakdown.
Workspaces are how you split spend by something internal: one workspace for production, another for staging, or one per internal team. All of that spend still rolls up to the organization total, and each workspace shows separately so you can budget and cap them independently.
Here is the ceiling. Workspaces let you split the bill by your team or environment, but never by your end customer. You cannot spin up a workspace per user, and even if you tried, ten thousand customers means ten thousand workspaces and API keys, which is not a real system.
Why the console total tells you nothing about your users
The total is a true number and a useless one for the decision that matters. It cannot tell you which customer to upsell, which one to cap, or which one is quietly running your Claude spend past what they pay you. All of those answers live on the per user axis, and that axis does not exist in the console.
You feel this the moment one account misbehaves. A single power user or a runaway agent loop can add hundreds of dollars, and the console will only show a higher bar for the day. It will never point at the account. That is exactly the visibility you need to track Claude usage per user.
How to get cost per user
The good news: Anthropic hands you everything you need on every response. You just have to attribute it, because you know who made the call and Anthropic does not.
Tag each call with your own user id, read the token counts off the usage object, multiply by the model prices, and sum per user over the period:
const PRICES = {
'claude-haiku-4-5': { in: 1, out: 5 }, // USD per 1M tokens
'claude-sonnet-4-6': { in: 3, out: 15 },
'claude-opus-4-8': { in: 5, out: 25 },
}
function costUsd(model, inputTokens, outputTokens) {
const p = PRICES[model]
return (inputTokens * p.in + outputTokens * p.out) / 1_000_000
}
await db.aiUsage.insert({
userId: req.user.id, // you have this. Anthropic does not.
model: 'claude-sonnet-4-6',
inputTokens: message.usage.input_tokens,
outputTokens: message.usage.output_tokens,
costUsd: costUsd('claude-sonnet-4-6', message.usage.input_tokens, message.usage.output_tokens),
createdAt: new Date(),
})Group that by userId for the month and sort descending, and the accounts at the top are where your bill actually comes from. The hard part is keeping the pricing table current, folding in cache reads, and joining subscription revenue so you get margin and not just cost.
Or wrap the client with Weckr
Weckr wraps your existing Anthropic client in two lines and records cost and margin per user server side from current pricing. Same call, same Claude response, plus the per user record the console will never give you:
import Anthropic from '@anthropic-ai/sdk'
import { Weckr } from '@weckr/sdk'
const anthropic = new Anthropic()
const wk = new Weckr({
apiKey: process.env.WECKR_API_KEY,
plans: { free: 0, pro: 29, business: 99 },
})
const message = await wk.chat(anthropic, {
model: 'claude-sonnet-4-6',
max_tokens: 1024,
messages,
userId: user.id,
feature: 'assistant',
plan: user.plan,
})Every call records cost and margin per user and per feature across OpenAI, Anthropic, and Gemini in one dashboard. You also get per user spending caps that block or downgrade a heavy account before it runs your bill past what it pays. See what gets sent in the Weckr docs, and look at the numbers on the seeded dashboard with no signup.
FAQ
How does Anthropic bill for the Claude API?
Anthropic bills the Claude API per token and per model, with input tokens and output tokens priced separately. Output tokens cost far more than input tokens, so the generated text usually dominates your bill. You are charged for the exact token counts on every Messages API response, summed across the billing period.
What does the Anthropic console show for billing?
The Anthropic console shows account and workspace totals, spend by model, and spend by day. It does not show a breakdown by your end user, because every request goes through one API key and Anthropic never sees your customers. To attribute cost to a specific user you have to do it yourself from the token counts.
How does prompt caching change the bill?
Cache read tokens bill at roughly 0.1x the input rate, a 90 percent discount, and appear as cache_read_input_tokens on the usage object. Writing to the 5 minute cache bills at roughly 1.25x the input rate and appears as cache_creation_input_tokens. If a large system prompt is reused across many calls, caching cuts the input portion of your bill substantially.
What is the Anthropic Batch API discount?
The Batch API gives you 50 percent off both input and output tokens for work that does not need a real time answer. You submit a batch of requests, Anthropic processes them within a window, and you pay half the standard per token price. It is the cheapest way to run bulk jobs like evals, backfills, or overnight summarization.
How do I see which of my users caused the Claude cost?
Read the usage object on each response, store input_tokens and output_tokens alongside your own user id, multiply by the model prices, and sum per user. The console total cannot do this because it has no concept of your customers. A wrapper like Weckr records cost and margin per user server side so you get the breakdown without building it.
Keep reading
Turn the Anthropic bill into a per user answer
Anthropic billing is per token, per model, with output priced well above input, and the console adds it into one honest total that hides who caused it. Caching and batch pricing move the number, but neither closes the gap between the account total and your customers.
That per user answer only exists on your side, built from the token counts Claude already returns. This is one step in the complete guide to AI cost and margin management. See your real per user Claude cost, or start with Claude API cost per user.