CLAUDE LABJP
SANDBOX — Claude Code adds a sandbox.credentials setting that blocks sandboxed commands from reading credential files and secret environment variablesMODEL — Org-configured model restrictions now apply across the model picker, --model, /model, and ANTHROPIC_MODELAGENTS — Sessions that edit, merge, comment on, or push to an existing PR now link to that PR in the claude agents viewFIX — Fixed --json-schema silently producing unstructured output on an invalid schema, plus messages lost at the --max-turns limitRECAP — Claude adds a monthly recap and focus settings in beta, with break reminders, quiet hours, and work insightsOPUS — Claude Opus 4.7 is now generally available with stronger long-running coding tasks and higher-resolution visionSANDBOX — Claude Code adds a sandbox.credentials setting that blocks sandboxed commands from reading credential files and secret environment variablesMODEL — Org-configured model restrictions now apply across the model picker, --model, /model, and ANTHROPIC_MODELAGENTS — Sessions that edit, merge, comment on, or push to an existing PR now link to that PR in the claude agents viewFIX — Fixed --json-schema silently producing unstructured output on an invalid schema, plus messages lost at the --max-turns limitRECAP — Claude adds a monthly recap and focus settings in beta, with break reminders, quiet hours, and work insightsOPUS — Claude Opus 4.7 is now generally available with stronger long-running coding tasks and higher-resolution vision
Articles/API & SDK
API & SDK/2026-03-30Beginner

Claude API Pricing Guide 2026 — Complete Cost Breakdown for Every Model, Batch API, and Prompt Caching

A complete guide to Claude API pricing in 2026. Learn the per-token costs for Opus 4.6, Sonnet 4.6, and Haiku 4.5, how to save up to 95% with Batch API and Prompt Caching, and see real-world cost estimates for common use cases.

Claude API110pricing6Opus-4.6Sonnet-4.6Haiku-4.5Batch API2Prompt Caching5cost optimization13202616

Understanding Claude API Pricing

When you're starting to build with the Claude API, one of the first questions is "how much will this cost?" Anthropic uses a straightforward pay-per-token pricing model — you only pay for what you use.

However, with multiple model tiers and powerful cost-saving features like Batch API and Prompt Caching, it's worth understanding the full picture before you start building. This guide covers the latest pricing as of March 2026, along with real-world cost estimates and optimization strategies.

Current Model Pricing (March 2026)

All prices are listed in USD per million tokens.

Claude Opus 4.6 (Most Capable)

  • Input: $5 / million tokens
  • Output: $25 / million tokens
  • Context window: Up to 1 million tokens
  • Best for: Advanced reasoning, complex code generation, research analysis

Claude Sonnet 4.6 (Balanced)

  • Input: $3 / million tokens
  • Output: $15 / million tokens
  • Context window: Up to 1 million tokens
  • Best for: Everyday coding, content creation, data analysis

Claude Haiku 4.5 (Fast & Affordable)

  • Input: $1 / million tokens
  • Output: $5 / million tokens
  • Context window: Up to 200K tokens
  • Best for: Chatbots, classification tasks, lightweight processing

A key takeaway is that Opus 4.6 and Sonnet 4.6 represent a roughly 67% cost reduction compared to the previous generation (Opus 4.1 was $15 input / $75 output). Better performance at lower prices — a welcome trend for developers.

Understanding Tokens — The Basis of Pricing

To estimate API costs accurately, you need to understand how tokens work.

A token is the smallest unit of text processing. In English, one token is approximately 4 characters (or about 0.75 words). For Japanese and other CJK languages, each character can consume 1–3 tokens, making equivalent content more expensive to process.

# Check token usage with the Anthropic Python SDK
import anthropic
 
client = anthropic.Anthropic()
 
# Send a message and inspect token usage
response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    messages=[
        {"role": "user", "content": "Write a Python function to calculate the Fibonacci sequence"}
    ]
)
 
# Check token consumption
print(f"Input tokens: {response.usage.input_tokens}")
print(f"Output tokens: {response.usage.output_tokens}")
 
# Expected output:
# Input tokens: 15
# Output tokens: 287

For this example using Sonnet 4.6, the cost would be: 15 input tokens × ($3 / 1,000,000) + 287 output tokens × ($15 / 1,000,000) = approximately $0.004. Individual requests are remarkably inexpensive.

Cost Estimates for Common Use Cases

Let's look at what typical development scenarios actually cost.

Scenario 1: Customer Support Chatbot (10,000 requests/month)

Using Haiku 4.5 with an average of 500 input tokens and 300 output tokens per request, the monthly cost comes to approximately input $5 + output $15 = ~$20/month. Very manageable for a small-scale support bot.

Scenario 2: Code Review Agent (1,000 runs/month)

Using Sonnet 4.6 with 3,000 input tokens and 1,500 output tokens per run, the monthly cost is approximately input $9 + output $22.50 = ~$31.50/month.

Scenario 3: Large Document Analysis (100 runs/month)

Using Opus 4.6 with 50,000 input tokens and 5,000 output tokens per run, the monthly cost is approximately input $25 + output $12.50 = ~$37.50/month.

Save Up to 50% with Batch API

For tasks that don't need real-time responses, the Batch API offers a powerful cost-saving option. It provides a 50% discount on standard API pricing, with results delivered within 24 hours.

import anthropic
 
client = anthropic.Anthropic()
 
# Submit requests in batch for async processing
batch = client.batches.create(
    requests=[
        {
            "custom_id": "review-001",
            "params": {
                "model": "claude-sonnet-4-6",
                "max_tokens": 1024,
                "messages": [
                    {"role": "user", "content": "Review this code: def add(a, b): return a + b"}
                ]
            }
        },
        {
            "custom_id": "review-002",
            "params": {
                "model": "claude-sonnet-4-6",
                "max_tokens": 1024,
                "messages": [
                    {"role": "user", "content": "Optimize this SQL query: SELECT * FROM users WHERE age > 20"}
                ]
            }
        }
    ]
)
 
# Check batch status
print(f"Batch ID: {batch.id}")
print(f"Status: {batch.processing_status}")
# Expected output:
# Batch ID: batch_abc123
# Status: in_progress

Batch API works especially well for bulk content translation, periodic report generation, and large-scale dataset analysis.

Cut Input Costs by 90% with Prompt Caching

When you repeatedly send the same system prompt or shared context, Prompt Caching can dramatically reduce costs. Cached input tokens are processed at just 10% of the standard rate.

import anthropic
 
client = anthropic.Anthropic()
 
# Mark a long system prompt for caching
response = client.messages.create(
    model="claude-sonnet-4-6",
    max_tokens=1024,
    system=[
        {
            "type": "text",
            "text": "You are a senior software engineer performing code reviews. Follow these coding standards... (long standards document)",
            "cache_control": {"type": "ephemeral"}
        }
    ],
    messages=[
        {"role": "user", "content": "Review this function: ..."}
    ]
)
 
# Verify caching effectiveness
print(f"Input tokens: {response.usage.input_tokens}")
print(f"Cache creation: {response.usage.cache_creation_input_tokens}")
print(f"Cache read: {response.usage.cache_read_input_tokens}")
# Expected output (on subsequent calls):
# Input tokens: 32
# Cache creation: 0
# Cache read: 2048

The best part? Prompt Caching and Batch API can be combined. Using both together can theoretically achieve up to 95% cost reduction.

How to Choose the Right Model

Selecting between the three models comes down to balancing task requirements against cost.

Choose Haiku 4.5 when: Response speed is your top priority, you're running simple tasks like text classification or sentiment analysis, or you need to process high volumes at minimal cost.

Choose Sonnet 4.6 when: You need a solid balance between quality and speed for tasks like coding assistance and content generation. For most developers, this is the best value option.

Choose Opus 4.6 when: Your tasks require complex multi-step reasoning, you need the highest quality output, or you're working with the full 1 million token context window.

A practical strategy is to start with Sonnet 4.6 and only upgrade to Opus 4.6 if quality falls short for your specific use case. This approach delivers the best cost efficiency.

For deeper cost optimization techniques, the Claude API Cost Optimization Production Guide covers advanced implementation patterns combining Batch API, Prompt Caching, and Adaptive Thinking.

Looking back

Claude API pricing revolves around three optimization levers: model selection, Batch API, and Prompt Caching. As of 2026, Sonnet 4.6 at $3 input / $15 output per million tokens offers the best starting point for most development projects.

Start small with Sonnet 4.6, then adjust your model selection based on task requirements. This iterative approach is the most effective way to build high-quality AI applications while keeping costs under control.

Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • Copy-paste ready implementation code
  • New advanced guides published daily
  • $5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

API & SDK2026-07-02
Introductory Pricing Has an End Date — Effective-Dated Cost Forecasts for the Sonnet 5 Price Step
Claude Sonnet 5's introductory $2/$10 pricing ends on 2026-08-31 and reverts to $3/$15. A static price map will quietly understate your September forecast by a third. Here is an effective-dated price table and forecast design that absorbs the step.
API & SDK2026-06-22
When Your Claude API Cost Math Doesn't Match the Bill: Accounting for the Four Token Buckets
Turn on prompt caching and your homegrown cost tally drifts from the console bill. Here is how to weight the four token buckets the usage object returns and build a ledger you can reconcile.
API & SDK2026-06-21
Reserving Priority Capacity for User Traffic with service_tier
If you pay for Priority Tier but your user-facing responses still slow down at peak, the culprit is often your own background jobs eating the priority pool. Here is how to read service_tier, prove the contention, and isolate background work.
📚RECOMMENDED BOOKS
Build a Large Language Model (From Scratch)
Sebastian Raschka
LLM Dev
Prompt Engineering for LLMs
Berryman & Ziegler
Prompting
AI Engineering
Chip Huyen
AI Eng
* Contains affiliate links
See all →