Categories
AI Code Generation Anthropic Reasoning Models

Claude Sonnet 4 with 1 Million Context Window Is Here

Anthropic’s latest update brings a massive one-million-token context window to Claude Sonnet 4 (not to be confused with Claude Opus 4). That’s a fivefold jump from its previous limit of 200K tokens. Anthropic asserts that this new update enables developers, researchers, and enterprises to process large documents or entire codebases in a single API call. It’s a substantial step forward for Claude AI models, and would help them compete with Gemini 2.5 Pro’s one-million-token context window. But this article isn’t about that.

This article examines the updated Claude Sonnet 4 to see how it compares to its big brothers in Claude Opus 4 and Opus 4.1.

Claude Sonnet 4’s 1 Million-Token Leap

On August 12, 2025, Anthropic announced that Claude Sonnet 4 now supports up to 1 million tokens of context via their API. It’s also on Amazon Bedrock, with Google Vertex AI support coming soon.

This new window can handle roughly 2,500 pages of text, or entire codebases of 75,000–110,000 lines. Even long novels like War and Peace fit into one prompt.

Early partners are already putting it to work. One developer platform, Bolt.new, says it lets them work on far larger projects while keeping the accuracy they need for production code.

Technical Details 

The long context feature for Sonnet 4 is currently in public beta on Anthropic’s API platform, immediately accessible for customers with Tier 4 or custom rate limits. It is also integrated within Amazon Bedrock, with imminent availability on Google Cloud’s Vertex AI.

  • Availability: The 1 million-token mode is in beta. It’s open to organizations in higher usage tiers or with custom rate limits.
  • Activation: Use the context-1m-2025-08-07 beta flag in your API request.
  • Beta status: Features and pricing may change as Anthropic collects feedback.

For now, you can feed Sonnet 4 far more information without breaking it into smaller chunks.

Claude Sonnet 4 with 1 Million Context Window Pricing

Anthropic’s pricing for long-context access is tiered:

Bind AI

Due to the higher computational demands of processing such extensive contexts, Anthropic has updated the pricing structure for prompts exceeding 200,000 tokens. For inputs beyond this threshold, the cost doubles from $3 to $6 per million tokens for input and increases from $15 to $22.50 per million tokens for output. However, Anthropic suggests cost efficiencies can be achieved using prompt caching and batch processing—the latter offering up to 50% additional savings.

Claude Sonnet 4 with 1 Million Tokens vs Claude Opus 4 and 4.1

The 1 million-token upgrade changes the balance between the Claude models.

Claude Sonnet 4

  • Part of the Claude 4 family, launched in May 2025.
  • Designed for efficient reasoning, coding, and analysis.
  • Faster and cheaper than Opus models, with a mode for extended thinking.
  • Now supports 1 million tokens, greatly expanding what it can handle.

Claude Opus 4

  • Also launched in May 2025.
  • Built for maximum sustained performance on complex, long-running workflows.
  • Very strong at deep coding tasks and multi-step reasoning.
  • Still limited to a 200K context window.

Claude Opus 4.1

  • Released in August 2025 as an upgrade to Opus 4. Here’s a Claude Opus 4.1 vs Claude Opus 4 comparison for the curious ones.
  • More precise coding and better multi-file reasoning.
  • Slight benchmark gains over Opus 4.
  • Context window remains 200K.
Bind AI

With the 1 M context window, Sonnet 4 now reaches Opus-level scale for many tasks, but with lower cost and latency.

Why This Update Matters

This move puts Anthropic in line with competitors who already offer million-token windows (cue: Gemini 2.5 Pro, which you can try here). It’s part of a race to handle larger and more complex inputs in a single shot.

Claude models are known for strong context retention and careful, grounded responses. Adding huge context capacity makes them even more useful for high-stakes work like law, research, and enterprise automation.

Claude Sonnet 4 Prompts to Try

1. Given this Python function that calculates the nth Fibonacci number using recursion, rewrite it using memoization and explain the time complexity improvement.
2. A train leaves City A at 60 km/h and another leaves City B (300 km away) at 40 km/h at the same time heading toward each other; calculate when and where they meet.
3. Create a RESTful API in Node.js using Express that allows users to register, log in, and retrieve their profile data securely with JWT authentication.
4. Given a CSV of daily stock prices, write a Python script using Pandas and Matplotlib to calculate and plot the 7-day moving average, then highlight the days with the highest trading volume.
5. Explain how a hash table works internally and describe a scenario where using a hash table would be a poor choice compared to a binary search tree.
6. Write a Python function that takes a paragraph of text, extracts all named entities using spaCy, and stores them in a normalized SQL database schema.

The Bottom Line

The launch of the 1 million-token context window in Claude Sonnet 4 is a game-changer. It lets users process enormous inputs without splitting them up, while keeping costs lower than the top-end Opus models. Compared to Opus 4 and 4.1, Sonnet 4 now delivers enterprise-grade scale, strong reasoning, and high efficiency.

For developers and organizations, this means bigger projects, deeper analysis, and less time spent stitching results together. It’s a major step toward AI tools that can think in truly book-sized chunks. Check out the latest AI model comparisons like GPT-5 vs Claude 4 and GPT-5 vs GPT-4 vs o3, and comparative analysis of all things AI here.