Claude API Pricing Explained: Token Rates and Cost Guide

Claude API Pricing Explained: Token Rates and Cost Guide

Table of content

As of November 2026, standard Claude API pricing starts at $0.10 per million input tokens and $0.50 per million output tokens for Claude Haiku 5.5 (on prompts up to 100,000 tokens) and reaches $8 per million input tokens and $40 per million output tokens for Claude Fable 5.2, the newest flagship model (the earlier Fable 5.1 still costs $10 and $50). Between those two endpoints, Anthropic prices its workhorse models at $2 per million input tokens and $10 per million output tokens for Claude Sonnet 5.5, and $4 per million input tokens and $20 per million output tokens for Claude Opus 5.5.

This breakdown is written for software engineers, technical founders, and engineering managers who are budgeting and building production workloads on the Claude platform. You will learn how to calculate exact token costs across all model tiers, account for the 30% token increase in newer tokenizers, cut spend by up to 97.5% using prompt caching and batch processing, and wire up the SDK with hard spend controls.

How much does the Claude API cost per million tokens?

As of November 2026, Claude API pricing for the current lineup ranges from $0.10 per million input tokens and $0.50 per million output tokens for Claude Haiku 5.5 up to $8 per million input tokens and $40 per million output tokens for Claude Fable 5.2. You can access the Claude family of models directly through Anthropic’s Messages API and Claude Managed Agents, or through partner cloud platforms. Every model in the current flagship lineup (claude-fable-5-2, claude-opus-5-5, claude-sonnet-5-5, and claude-haiku-5-5) supports a 1 million token context window and up to 128,000 max output tokens.

Criterion Claude Fable 5.2 Claude Opus 5.5 Claude Sonnet 5.5 Claude Haiku 5.5 (<=100K / >100K)
Base input price (per 1M tokens) $8.00 $4.00 $2.00 $0.10 / $0.50
Base output price (per 1M tokens) $40.00 $20.00 $10.00 $0.50 / $2.50
5-minute cache write (per 1M tokens) $10.00 $5.00 $2.50 $0.125 / $0.625
1-hour cache write (per 1M tokens) $16.00 $8.00 $4.00 $0.20 / $1.00
Cache hit / read (per 1M tokens) $0.20 $0.20 $0.10 $0.01 / $0.05
Message Batches API input / output (per 1M tokens) $4.00 / $20.00 $2.00 / $10.00 $1.00 / $5.00 $0.05 / $0.25 (<=100K)
Context window & max output tokens 1M context / 128K output 1M context / 128K output 1M context / 128K output 1M context / 128K output

Claude Opus 5.5 and Claude Sonnet 5.5 use flat per-token pricing across the entire 1 million token context window. A 900,000-token prompt sent to Sonnet 5.5, Opus 5.5, or Fable 5.2 is billed at the exact same per-token rate as a 9,000-token prompt. That flat structure holds true across all Claude 4.6 and later models, with one exception: Claude Haiku 5.5.

Claude Haiku 5.5 uses tiered pricing based on prompt length. When your input prompt is 100,000 tokens or fewer, you pay $0.10 per million input tokens and $0.50 per million output tokens. Once a prompt crosses 100,000 tokens, Haiku 5.5 rates jump 5x across every category: input rises to $0.50 per million tokens, output rises to $2.50 per million tokens, 5-minute cache writes increase from $0.125 to $0.625 per million tokens, 1-hour cache writes increase from $0.20 to $1.00 per million tokens, and cache hits rise from $0.01 to $0.05 per million tokens. For live updates to model tiers, check the official Anthropic pricing page and the Claude platform documentation.

If your system still calls older or specialized active models on the API as of November 2026, you will pay the following base input and output rates per million tokens:

  • Claude Fable 5.1, Claude Mythos 5.1, and Claude Fable 5: $10 input / $50 output
  • Claude Opus 5 and Claude Opus 4.5 through 4.8: $5 input / $25 output
  • Claude Sonnet 5: $2 input / $10 output
  • Claude Sonnet 4.5 and Claude Sonnet 4.6: $3 input / $15 output
  • Claude Haiku 4.5: $1 input / $5 output

Why do Claude 4.7 and 5.x models increase token counts by 30%?

Claude 4.7 and all 5.x models use an updated tokenizer that produces roughly 30% more tokens for the exact same input text than Claude Sonnet 4.6 and earlier releases. This tokenizer change also applies to Claude Mythos Preview. When migrating an application from an earlier release like Sonnet 4.6 ($3 per million input tokens and $15 per million output tokens) to Sonnet 5.5 ($2 per million input tokens and $10 per million output tokens), you cannot simply multiply your historical token volume by the lower unit price.

Take a concrete workload: suppose your service sent 100 million input tokens per month to Claude Sonnet 4.6, costing $300 in base input fees. When you switch that exact same text payload to Claude Sonnet 5.5, the newer tokenizer expands the volume by approximately 30% to 130 million input tokens. At $2 per million input tokens on Sonnet 5.5, your monthly input bill drops to $260. You still save money because the unit price dropped by a third, whereas migrating from Opus 4.6 ($5/$25 per million tokens) to Opus 5.5 ($4/$20 per million tokens) results in a slightly higher effective bill once the 1.3x token inflation is factored in ($5.00 vs. $4.00 * 1.3 = $5.20 per equivalent text volume).

Because the Messages API is stateless, you must send the full conversation history in the messages array on every turn. Without prompt caching or context compaction, that 30% token expansion compounds on every subsequent turn of a multi-turn chat or agent loop.

How does Claude API prompt caching pricing work?

Prompt caching reduces repeat input token costs by 95% on Claude Opus 5.5 and Sonnet 5.5 and 97.5% on Claude Fable 5.2 and 5.1, charging a small upfront write multiplier in exchange for $0.01 to $0.25 per million tokens on subsequent cache hits. On Claude Fable 5.2, cache hits and refreshes cost $0.20 per million tokens, which is 2.5% of the $8 base input rate (Fable 5.1: $0.25, also 2.5%). On Claude Opus 5.5 ($0.20 per million tokens), Claude Sonnet 5.5 ($0.10 per million tokens), and Claude Haiku 5.5 ($0.01 per million tokens up to 100K, or $0.05 over 100K), cache reads cost 5% of the base input rate.

Writing to the cache has two time-to-live (TTL) pricing tiers:

  • 5-minute cache write (1.25x base input): $10.00/MTok on Fable 5.2, $5.00/MTok on Opus 5.5, $2.50/MTok on Sonnet 5.5, and $0.125/MTok (<=100K) or $0.625/MTok (>100K) on Haiku 5.5.
  • 1-hour cache write (2x base input): $16.00/MTok on Fable 5.2, $8.00/MTok on Opus 5.5, $4.00/MTok on Sonnet 5.5, and $0.20/MTok (<=100K) or $1.00/MTok (>100K) on Haiku 5.5.

Because a 5-minute cache write adds a 25% premium over a standard input call and each cache read saves 95% to 97.5%, a cached prefix breaks even on the first cache hit. A 1-hour cache write charges double the base input rate and breaks even on the second cache hit within that hour.

To use prompt caching on the current Claude 5.x lineup, your cacheable prompt prefix must be at least 512 tokens long. You can enable caching in two ways: automatic caching, where you add a single top-level cache_control: {"type": "ephemeral"} field to the request, or explicit cache breakpoints, where you place up to 4 breakpoints on individual content blocks.

Two production mistakes frequently ruin prompt caching economics:

  1. Placing a cache breakpoint on a block that mutates on every request, such as injecting a dynamic current timestamp into the system prompt. Because cached prefixes must match identically, a changing timestamp invalidates the cache on every call, forcing you to pay the 1.25x cache write penalty every time with zero cache hits. Put static instructions, tool schemas, and reference documents first, and append dynamic per-request variables in a separate uncached block at the end.
  2. Exceeding the 20-block lookback window in long multi-turn conversations without adding intermediate breakpoints, which causes automatic prefix matching to miss earlier cached blocks.

How do the Message Batches API, Fast mode, and data residency affect your bill?

Asynchronous workloads run at a 50% token discount via the Message Batches API, whereas low-latency Fast mode doubles token rates (2x) and US-only data residency adds a 10% premium (1.1x). Choosing the right execution tier and routing policy for each workload has a direct multiplier effect on your monthly invoice.

The Message Batches API cuts both input and output token prices in half for workloads that do not require immediate synchronous responses, such as nightly document extraction, bulk classification, or evaluation suites. With the 50% discount applied, per-million token rates (input / output) drop to $4 / $20 for Claude Fable 5.2, $2 / $10 for Claude Opus 5.5, $1 / $5 for Claude Sonnet 5.5, and $0.05 / $0.25 for Claude Haiku 5.5 on prompts up to 100,000 tokens. The batch discount also stacks with prompt caching multipliers, letting you combine cached prefixes with batch execution for maximum savings.

When low latency is the priority, Fast mode delivers up to 2.5x faster output speed on both the first-party Claude API and Azure-hosted Claude in Microsoft Foundry in exchange for 2x token rates. Under Fast mode, Claude Fable 5.2 costs $16 per million input tokens and $80 per million output tokens, Claude Opus 5.5 costs $8 per million input tokens and $40 per million output tokens, while Claude Opus 5 and Claude Opus 4.8 cost $10 per million input tokens and $50 per million output tokens.

Data residency and cloud routing add another pricing variable. By default, the API uses global routing at standard 1.0x pricing. If your compliance rules require pinning inference to the United States on Claude 4.6 and later models by setting inference_geo: "us" (or selecting US Data Zone Standard on Microsoft Foundry), Anthropic applies a 1.1x price multiplier across all token categories. Similarly, on partner-operated cloud platforms like Amazon Bedrock and Google Cloud Vertex AI, selecting regional or multi-region endpoints carries a 10% price premium over global endpoints.

What do server-side tools and Claude Managed Agents cost?

Beyond base model tokens, Anthropic bills separately for server-side capabilities: $10 per 1,000 Web Searches, $0.05 per container-hour for standalone Code Execution after 1,550 free monthly hours, and $0.08 per active session-hour for Claude Managed Agents. You also pay standard token rates for hidden system prompts and tool definitions injected whenever tools are enabled.

Server-side Web Search costs $10 per 1,000 searches, plus standard input token charges for the retrieved search results fed back into the model context. The Web Fetch tool, by contrast, has no per-request fee beyond the standard input token costs of the fetched page content, which you can cap by setting the max_content_tokens parameter.

The server-side Code Execution tool has two billing paths depending on what else is in your request:

  • Bundled with search or fetch: Container execution is completely free of container charges when used in the same request as web_search_20260209 or web_fetch_20260209 (or later versions).
  • Standalone execution: Each organization receives 1,550 free container hours per month. After exhausting that allowance, standalone containers cost $0.05 per hour per container, billed with a 5-minute minimum per execution. Note that preloading files into the request triggers container billing even if the model chooses not to invoke the code execution tool during that turn.

Even before a tool executes, enabling tool use in an API call automatically injects a hidden system prompt and tool definitions that consume extra input tokens on every request:

  • General tool use on Claude 5.5 models: 286 to 406 extra input tokens
  • Bash tool: 325 extra input tokens
  • Text Editor tool: 974 extra input tokens
  • Computer use toolset (computer_toolset_20260801): approximately 4,500 extra input tokens
  • Browser toolset (browser_toolset_20260801): approximately 6,600 extra input tokens

If you run autonomous workflows on Claude Managed Agents (Anthropic’s pre-built agent harness running in managed infrastructure) instead of managing the orchestration loop yourself, you pay standard model token rates plus $0.08 per session-hour while the session is in an active running status. Active runtime is measured to the millisecond, idle session time is unbilled, and there are no separate container-hour charges.

How to use the Claude API in Python and control spend

Learning how to use the Claude API requires four steps: generate an API key in the Claude Console, set it as the ANTHROPIC_API_KEY environment variable, install the official SDK, and call client.messages.create() with your chosen model ID and token limits. Official client SDKs are available for Python, TypeScript, Go, Java, C#, PHP, and Ruby.

Follow these steps to configure authentication, make a cost-controlled request, and manage rate limits:

  1. Create an API key in the Claude Console at platform.claude.com/settings/keys. For production workloads, avoid personal static keys: configure service account keys with expiration dates and workspace scoping, use Workload Identity Federation for short-lived tokens on AWS, GCP, Azure, and CI/CD pipelines without static secrets, or use Apple App Attest for direct iOS and macOS calls.
  2. Configure organization-level and workspace-level spend limits in the console. New accounts start in the Evaluation tier while establishing usage history and then progress through the Start, Build, and Scale tiers, each governing your maximum spend and rate limits.
  3. Export your key as ANTHROPIC_API_KEY and install the Python SDK via pip install anthropic.
  4. Invoke client.messages.create() with an explicit max_tokens cap and top-level automatic prompt caching enabled so multi-turn conversations and repeated system prompts hit the cache.
import os
from anthropic import Anthropic

# Reads ANTHROPIC_API_KEY from the environment
client = Anthropic(api_key=os.environ.get("ANTHROPIC_API_KEY"))

response = client.messages.create(
    model="claude-sonnet-5-5",
    max_tokens=1024,
    cache_control={"type": "ephemeral"},
    messages=[
        {
            "role": "user",
            "content": "Summarize our architecture requirements and list token budget risks."
        }
    ]
)

print(response.content[0].text)

Because the Messages API is stateless, passing the full messages history on every turn causes input token counts to grow linearly with conversation length unless you pair prompt caching with context compaction. If your engineering team also uses Claude Code billed against your API account, tell developers to run the /usage command locally to inspect their active session spend.

Frequently asked questions

Here are direct answers to the most common engineering and billing questions about Claude API pricing, subscription credits, and context window fees.

Do Claude Max or Team subscriptions include Claude API credits?

Yes. Since October 2026, Anthropic bundles monthly Claude Platform API credits with select consumer and team plans. Max 5x subscribers receive $100 per month in API credits, Max 20x subscribers receive $200 per month, and Team plans receive up to $500 per month in pooled API credits.

Does the Claude API charge extra for the 1M token context window?

No, all Claude 4.6 and later models except Claude Haiku 5.5 provide the full 1 million token context window at flat standard per-token rates. Whether you send a 9,000-token prompt or a 900,000-token prompt to Claude Sonnet 5.5, Opus 5.5, or Fable 5.2, the per-token price stays identical. Only Claude Haiku 5.5 uses tiered prompt-length pricing, where prompts exceeding 100,000 tokens increase 5x from $0.10/$0.50 per million tokens to $0.50/$2.50 per million tokens.

Is the Claude API free to use or does it have a free tier?

The Claude API does not have an unlimited free tier; usage is billed per token and governed by organization and workspace spend limits starting in the Evaluation tier for new accounts. However, developers who already hold a Max 5x ($100/month), Max 20x ($200/month), or Team (up to $500/month) subscription receive monthly API credits that can cover development and testing without separate out-of-pocket API charges.

How does Claude API pricing differ on AWS Bedrock, Vertex AI, and Microsoft Foundry?

Pricing depends on whether the cloud marketplace listing is operated by Anthropic or by the cloud partner, and whether you pin data residency. On Anthropic-operated cloud marketplaces (Claude Platform on AWS and Claude in Microsoft Foundry), usage is billed postpaid in arrears using Claude Consumption Units (CCUs) at a fixed rate of $0.01 per CCU. On partner-operated platforms (Amazon Bedrock and Google Cloud Vertex AI), regional and multi-region endpoints carry a 10% premium over global endpoints, matching the 1.1x multiplier applied when setting inference_geo: "us" or US Data Zone Standard on Microsoft Foundry for Claude 4.6 and later models.

How much does Claude Code cost when billed through the Claude API?

Across enterprise deployments using API token billing for Claude Code, average developer spend is approximately $13 per active day, or $150 to $250 per month. Daily costs remain under $30 per active day for 90% of users, and developers can monitor their real-time token consumption locally inside the terminal using the /usage command.

Building cost-efficient Claude integrations with Diatom Enterprises

Token prices are only one part of the bill. Model routing, cache-friendly prompt design, batch scheduling and spend limits decide what a Claude integration really costs in production. If your team is planning or scaling an application on the Claude API, our custom AI development services cover architecture, cost modelling and implementation.

Related case study

AI-Driven Logistics Software for Cargo Operations in Norway
Logistics and Transportation
A custom AI-driven logistics platform for a Norwegian cargo carrier, delivered on a fixed-price model and built around real-world daily workflows.

Related articles

Prompt Caching: Mechanics, Pricing, and Architecture
Learn how prompt caching reuses KV attention tensors, how OpenAI, Anthropic, and Google price cache reads, and how to prevent silent cache misses.
Multimodal AI
Early AI systems each understood exactly one kind of input - a language model read text, a vision model read images, and neither could reason about the other. Multimodality is what closes that gap. This guide explains what the term actually means.
How to Write an Advanced AI Prompt: A Complete Guide
Learn how to write an advanced AI prompt to get better results. This guide teaches you to use detailed personas and clear, step-by-step instructions.
LLM Integration & Fine-Tuning

Have a project in mind?

Model selection, secure APIs and fine-tuning on your data for higher accuracy and lower token cost.