Skip to content

Claude Code Cost Calculator

Estimate the API-equivalent cost of your Claude Code usage, including input, output, cache reads and cache writes. A free, browser-first tool from Loop Engineering.

Standard global Claude API list prices (USD). Base input excludes cache reads and writes. Enter session totals, including all requests.

Cache writes · advanced
Custom pricing · advanced

For Bedrock, Vertex, Microsoft Foundry, fast mode, or negotiated rates. All five rates are user supplied and unverified.

Usage multiplier · estimate only

One session (or the full pasted summary) per person. Adjust assumptions to your schedule; projections do not account for changing task size.

No login or API key. Nothing entered here is saved after a reload.

Estimated API-equivalent cost

$0.155

Per session / summary, per person · USD

This is not a prediction of subscription capacity or an Anthropic billing statement. Provider modifiers and non-token tool charges are excluded.

Per session / person
$0.155
Per day / person
$0.62
Per month / person
$13.64
Per month / team (1)
$13.64
Per day / team
$0.62
Working days / month
22

Token cost breakdown

USD token costs for the complete session
TypeTokens$/MTokSubtotalShare
Base input10,0002$0.0212.9%
Output5,00010$0.0532.3%
Cache read300,0000.2$0.0638.7%
5-minute cache write10,0002.5$0.02516.1%
1-hour cache write04$0.000.0%

Prompt cache impact

Estimated versus pricing the same cached tokens as uncached input.

Estimated cache-read savings
$0.54
Cache write premium
$0.005
Reads at base input rates
$0.60
Actual estimated read cost
$0.06

Read savings = Σ(cache read tokens ÷ 1M × (input rate − cache read rate)). After subtracting the write premium versus base input, estimated net cache impact is $0.535. Negative values mean a premium. These are scenarios, not measured invoice savings.

Cost drivers

  • Cache-efficient. Most input tokens are cache reads. Keep that reuse; compare the write premium with read savings before extending the TTL.
  • High cumulative context usage. Session totals do not reveal per-request context. Inspect long requests; split independent tasks when context reuse stops helping. This is not evidence of a long-context surcharge.
Compare the same tokens across models

Hypothetical standard API prices for identical counts. Models can use different numbers of tokens to complete the same task; this does not predict task quality or cost per task.

  • Claude Haiku 4.5$0.0775
  • Claude Sonnet 5.5$0.155
  • Claude Opus 5.5$0.25
  • Claude Fable 5.1 · highest for these counts$0.55

Pricing last verified: · View official Anthropic pricing. Prices are reviewed manually; check the source before relying on an estimate.

Comparing OpenAI models too? The GPT-6 Astra vs GPT-6.1 Sol comparison estimates their token cost and explains when each model may fit.

How Claude Code cost is calculated

This Claude token cost calculator uses five separate token categories. Input is uncached prompt content; output is generated content. Cache reads reuse a previous prompt prefix, while cache writes create a reusable prefix with a 5-minute or 1-hour lifetime. Treat these categories as disjoint to avoid counting the same tokens twice.

session cost = (base input × input rate
              + output × output rate
              + cache reads × read rate
              + 5m writes × 5m write rate
              + 1h writes × 1h write rate) / 1,000,000
team daily   = session cost × sessions/day/person × members
team monthly = team daily × working days/month

Rates are USD per million tokens (MTok). We retain precision through the calculations and round only the displayed values. For multiple models, each record uses its own rates before costs are summed. Per-person projections omit the team multiplier. If you paste a daily total, use one session per day so the same usage is not multiplied twice.

Use actual reported token counts, rather than estimating them from words or characters. Session totals can cover many requests and can exceed a model’s context window without any individual request doing so. High cumulative usage alone does not establish long-context pricing.

Why prompt caching matters

Repeated repository instructions and tool definitions can be reused instead of billed as ordinary input on every request. To inspect the effect, enter 100,000 cache-read tokens with other counts at zero. Compare “Reads at base input rates” with “Actual estimated read cost” using the selected model’s registry rates. Their difference is estimated cache-read savings for that single reuse.

Now add the cache-write tokens that created that prefix. Writes carry a premium over base input. The net cache impact subtracts this write premium from read savings; it can be negative when reuse is low. A one-hour TTL may help when pauses exceed five minutes, but the write rate is higher. Choose using your actual reuse pattern.

For mixed TTLs, enter the split creation counts. An unsplit “cache write” total is not proof of either TTL; the paste tool exposes an assumption that you can change. Learn more in the official prompt caching documentation.

Claude Code cost vs Claude API cost

Claude Code is a coding interface; Claude API pricing meters underlying model usage. This Claude API cost calculator shows API-equivalent usage value at published list prices. It does not convert Claude Pro or Max into an API token allowance and does not predict subscription capacity.

The Session block in Claude Code’s /usage reports token statistics and an estimated dollar figure. That figure may use an organization’s configured rates. Plan usage bars show limits rather than enough token detail for this calculator. Check the official Claude Code cost guide and your billing reports when an estimate differs from a charge.

Organizations needing authoritative reporting should use the Claude Console, provider billing reports or Anthropic’s analytics tooling. The organization-level Claude Code Analytics API requires appropriate permissions and an Admin API key. This calculator never requests credentials and does not connect to that API.

How to reduce Claude Code cost

  1. Measure a representative task. Record all five token categories before changing your workflow. Compare cost per validated result; a cheaper token rate may require more attempts.
  2. Keep reusable context stable. Avoid unnecessary changes to tool definitions and prompt prefixes. Inspect cache misses before extending the TTL.
  3. Scope context and output. Send relevant files and bounded logs. Ask for concise reports and targeted changes while retaining verification evidence.
  4. Bound retries and sessions. Define a stop rule for repeated failures, and budget for the whole team’s daily usage. Split independent tasks when shared context no longer helps.
  5. Test model changes. The same-token comparison is a price scenario, not a performance guarantee. Validate on your own tasks before switching.

Planning an agent loop? Use the Loop Engineering Budget Calculator to account for iterations, retries, worst-case spend and budget risk. Then build a workflow with the Loop Engineering Goal Generator.

Claude Code pricing

Verified standard global API token prices for the presets in this calculator. All rates are USD/MTok. These are API-equivalent rates, not subscription plan prices. Availability in Claude Code depends on your account and model configuration.

Claude token pricing with official sources and verification dates
Model / sourceInputOutputCache read5m write1h writeContextVerified
Claude Sonnet 5.5Active · standard global API$2$10$0.2$2.5$41,000,000
Claude Opus 5.5Active · standard global API$4$20$0.2$5$81,000,000
Claude Haiku 4.5Active · standard global API$1$5$0.1$1.25$2200,000
Claude Fable 5.1Active · standard global API$10$50$0.25$12.5$201,000,000

Excluded: provider-specific rates, data residency premiums, fast-mode pricing, batch discounts, taxes and separate tool charges. Use custom pricing where appropriate and check the official Anthropic pricing reference for feature-specific charges.

Claude Code Cost Calculator FAQ

How much does Claude Code cost?

It depends on your access method, model and usage. API usage is metered by tokens and may include other charges. Pro and Max subscriptions have plan prices and usage limits. Loop Engineering estimates API-equivalent token cost, not subscription capacity or your invoice.

How do I calculate Claude Code token cost?

Separate base input, output, cache reads, 5-minute cache writes and 1-hour cache writes. Divide each count by one million, multiply by its model rate and add the five costs. Use the same period for all counts; multiply a representative session by sessions per day, working days per month and team size for a projection.

What counts as input tokens?

Input can include system instructions, your prompts, conversation history, tool definitions and tool results. In this calculator, base input means uncached input only. Cache read and cache creation tokens are separate categories; do not add them to base input a second time.

What are cache read tokens?

They are input tokens served from a reusable prompt cache. They have their own published rate. The calculator compares their estimated cost with pricing the same tokens as uncached base input.

What are cache write tokens?

They are input tokens used to create a prompt cache. Five-minute and one-hour writes have different rates. If a pasted summary reports only total cache creation, this calculator explicitly assumes a selected TTL; edit the counts if your session used both durations.

Why is my Claude Code cost high?

Long outputs, large repeated inputs, cache invalidation, repeated attempts and many sessions can raise estimated cost. The tool shows each category's cost share and gives deterministic suggestions. Aggregate session tokens alone do not prove a per-request long-context surcharge.

Does prompt caching reduce Claude cost?

Cache reads cost less than ordinary input at the listed standard model prices, but writes carry a premium. Savings depend on reuse and the TTL. The read-savings figure excludes write overhead; the net impact figure subtracts the write premium. Neither is a measured reduction in your bill.

Is this the same as my Anthropic bill?

No. It uses published standard global API token prices or custom rates you supply. Subscription limits, negotiated pricing, regional rates, fast mode, batch discounts, taxes and non-token tool charges can differ. Use the Claude Console or your provider's billing reports for authoritative spending.

Does Claude Pro/Max equal API usage?

No. A subscription provides access subject to usage limits and plan terms; it is not an unlimited API token allowance. API-equivalent usage value cannot predict subscription capacity or establish a reliable break-even point.

Is pasted usage uploaded?

No. Parsing and calculation run locally in this browser. Raw usage, token counts, prices and reported costs are not included in calculator analytics. Pasted text is kept only in memory and is not saved to localStorage, a server or a share URL.

How often is Claude pricing updated?

Pricing is reviewed manually against Anthropic's official documentation. The oldest verification date among the displayed presets is 2026-10-04. Updates are not automatic; check the linked official sources for changes. Custom pricing is user supplied and unverified.

Can I paste multiple models or an unknown model?

Supported model rows and arrays of API usage objects are priced separately and then summed. Unknown models block the complete estimate until you select a verified model or supply all five custom rates for each unpriced record. Unsupported or ambiguous formats fall back to manual entry.

Independent calculator. Not affiliated with Anthropic. Estimates use published pricing and may differ from your actual invoice, subscription usage, negotiated rates, regional pricing, or provider-specific charges.