SPB Git

Repository Public

whats-new-sonnet-5.md 12.9 KB 217 lines markdown

1---2title: What's new in Claude Sonnet 53url: https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-54description: Overview of new features and behavior changes in Claude Sonnet 5.5---67Claude Sonnet 5 is the next generation of Anthropic's Sonnet model family. It is a drop-in upgrade for Claude Sonnet 4.6 with three behavior changes: [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) is on by default, manual extended thinking now returns a 400 error (it was deprecated on Claude Sonnet 4.6), and setting sampling parameters (`temperature`, `top_p`, `top_k`) to non-default values returns a 400 error. This page summarizes everything new at launch, including a new tokenizer.89## New model1011| Model           | API model ID      | Description                                    |12| --------------- | ----------------- | ---------------------------------------------- |13| Claude Sonnet 5 | `claude-sonnet-5` | The best combination of speed and intelligence |1415Claude Sonnet 5 supports the [1M token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) by default (1M tokens is both the default and the maximum; there is no smaller context variant), 128k max output tokens, [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking), and the same set of tools and platform features as Claude Sonnet 4.6, except [Priority Tier](https://platform.claude.com/docs/en/api/service-tiers#supported-models), which is not available on Claude Sonnet 5. On the Claude API and Google Cloud, Claude Sonnet 5 also supports the [browser use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/browser-use-tool) and the stable `computer_toolset_20260801` version of the [computer use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool), neither of which Claude Sonnet 4.6 supports; the earlier `computer_20251124` version is still accepted on both models. To upgrade an existing integration, see [Migrate from `computer_20251124`](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool#migrate-from-computer-20251124).1617For complete pricing and specs, see the [models overview](https://platform.claude.com/docs/en/models/overview).1819## Behavior changes2021### Adaptive thinking on by default2223On Claude Sonnet 4.6, requests without a `thinking` field run without thinking. On Claude Sonnet 5, the same requests run with [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking). To turn thinking off, pass `thinking: {type: "disabled"}`. Because `max_tokens` is a hard limit on total output (thinking plus response text), revisit it for workloads that ran without thinking on Claude Sonnet 4.6.2425### Sampling parameters not accepted2627Setting `temperature`, `top_p`, or `top_k` to a non-default value returns a 400 error. Remove these parameters when migrating; the default value (or omitting the parameter) is accepted. Use system-prompt instructions to guide model behavior. This is new for Sonnet-class models; the same constraint was previously introduced on Claude Opus 4.7.2829### Manual extended thinking removed3031Manual extended thinking (`thinking: {type: "enabled", budget_tokens: N}`) was deprecated on Claude Sonnet 4.6; on Claude Sonnet 5 it is removed and returns a 400 error, the same as on Claude Opus 4.8 and Claude Opus 4.7. Use adaptive thinking with the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) instead.3233<CodeGroup exclude="shell">34  ```python Python35  # Not supported on Claude Sonnet 5 (returns 400)36  thinking = {"type": "enabled", "budget_tokens": 32000}3738  # Use this instead39  thinking = {"type": "adaptive"}40  ```4142  ```typescript TypeScript43  // Not supported on Claude Sonnet 5 (returns 400)44  const legacyThinking = { type: "enabled", budget_tokens: 32000 };4546  // Use this instead47  const thinking = { type: "adaptive" };48  ```4950  ```csharp C#51  // Not supported on Claude Sonnet 5 (returns 400)52  var legacyThinking = new ThinkingConfigEnabled(budgetTokens: 32000);5354  // Use this instead55  var thinking = new ThinkingConfigAdaptive();56  ```5758  ```go Go59  // Not supported on Claude Sonnet 5 (returns 400)60  legacyThinking := anthropic.ThinkingConfigParamUnion{61  	OfEnabled: &anthropic.ThinkingConfigEnabledParam{BudgetTokens: 32000},62  }6364  // Use this instead65  thinking := anthropic.ThinkingConfigParamUnion{66  	OfAdaptive: &anthropic.ThinkingConfigAdaptiveParam{},67  }68  ```6970  ```java Java71  // Not supported on Claude Sonnet 5 (returns 400)72  var legacyThinking = ThinkingConfigEnabled.builder().budgetTokens(32_000L).build();7374  // Use this instead75  var thinking = ThinkingConfigAdaptive.builder().build();76  ```7778  ```php PHP79  // Not supported on Claude Sonnet 5 (returns 400)80  $thinking = ['type' => 'enabled', 'budget_tokens' => 32000];8182  // Use this instead83  $thinking = ['type' => 'adaptive'];84  ```8586  ```ruby Ruby87  # Not supported on Claude Sonnet 5 (returns 400)88  legacy_thinking = {type: "enabled", budget_tokens: 32_000}8990  # Use this instead91  thinking = {type: "adaptive"}92  ```93</CodeGroup>9495## New tokenizer9697Claude Sonnet 5 uses a new tokenizer. The same input text produces approximately 30% more tokens than on Claude Sonnet 4.6. The exact increase depends on the content. This is not an API change: requests, responses, and streaming events keep the same shape, and no code changes are required.9899The change affects anything you measure or budget in tokens:100101* **Token counts:** `usage` fields and [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) results for the same text are higher than on Claude Sonnet 4.6. Don't reuse counts measured against earlier models; recount against Claude Sonnet 5.102* **Context window capacity in text terms:** the context window is 1M tokens, but each token covers less text on average, so the same window holds less text than on Claude Sonnet 4.6.103* **`max_tokens` budgets:** an output limit tuned for Claude Sonnet 4.6 may truncate equivalent output on Claude Sonnet 5. Revisit limits sized close to your expected output length.104* **Per-request cost:** per-token pricing is lower than Claude Sonnet 4.6's (see [Pricing](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5#pricing)), but because the same text produces more tokens, the cost of an equivalent request does not drop in direct proportion.105106## API constraints inherited from Claude Sonnet 4.6107108<Note>109  This constraint is unchanged from Claude Sonnet 4.6. Aside from the three [behavior changes](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5#behavior-changes) (see [Migration guide](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5#migration-guide)), code that already runs on Claude Sonnet 4.6 needs no other changes.110</Note>111112### Assistant message prefilling not supported113114Prefilling the assistant message returns a `400` error, unchanged from Claude Sonnet 4.6. Use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), system prompt instructions, or `output_config.format` instead.115116## Capability improvements117118Claude Sonnet 5 is a capability upgrade over Claude Sonnet 4.6 at a lower price. It is also an option for workloads that need more capability than Claude Sonnet 4.6 provides without moving to an Opus-class model.119120The largest gains over Claude Sonnet 4.6 are in coding and agentic tasks. For benchmark results, see [Anthropic's Transparency Hub](https://www.anthropic.com/transparency).121122## Cybersecurity safeguards123124Claude Sonnet 5 is the first Sonnet-tier model with real-time cybersecurity safeguards. Requests that involve prohibited or high-risk cybersecurity topics may be refused. Refusals return as a successful HTTP 200 response with `stop_reason: "refusal"`, not an error. See [Real-time cyber safeguards on Claude Opus and Sonnet](https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude-opus-and-sonnet) for what the safeguards block and how legitimate security work can apply to the Cyber Verification Program.125126## Pricing127128Claude Sonnet 5 is priced at $2 per million input tokens and $10 per million output tokens, lower per-token pricing than Claude Sonnet 4.6's $3/$15. Because the [new tokenizer](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5#new-tokenizer) produces approximately 30% more tokens for the same text, the cost of an equivalent request does not drop in direct proportion to the per-token prices when comparing with Claude Sonnet 4.6. The exact difference depends on the content and workload shape.129130See [Pricing](https://platform.claude.com/docs/en/about-claude/pricing) for complete pricing, including batch processing and prompt caching rates.131132## Availability133134At launch, Claude Sonnet 5 is available on:135136* **Claude API:** available to all customers.137* **AWS:** available through [Claude in Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock) and [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws). On Amazon Bedrock, Claude Sonnet 5 is also reachable through the `InvokeModel` API, served by the same infrastructure as Claude in Amazon Bedrock. The legacy [Claude on Amazon Bedrock (Opus 4.6 and earlier)](https://platform.claude.com/docs/en/build-with-claude/claude-on-amazon-bedrock-legacy) integration does not include Claude Sonnet 5.138* **Google Cloud:** available through [Claude on Google Cloud](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai).139* **Microsoft Foundry:** available through [Claude in Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry).140141Claude Sonnet 5 supports [zero data retention](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention) for organizations with ZDR agreements.142143## Migration guide144145Claude Sonnet 5 is a drop-in replacement for Claude Sonnet 4.6. Update your model ID:146147<CodeGroup exclude="shell">148  ```python Python149  model = "claude-sonnet-4-6"  # Before150  model = "claude-sonnet-5"  # After151  ```152153  ```typescript TypeScript154  const legacyModel = "claude-sonnet-4-6"; // Before155  const model = "claude-sonnet-5"; // After156  ```157158  ```csharp C#159  var legacyModel = Model.ClaudeSonnet4_6; // Before160  var model = Model.ClaudeSonnet5; // After161  ```162163  ```go Go164  // Before165  legacyModel := anthropic.ModelClaudeSonnet4_6166  // After167  model := anthropic.ModelClaudeSonnet5168  ```169170  ```java Java171  var legacyModel = Model.CLAUDE_SONNET_4_6; // Before172  var model = Model.CLAUDE_SONNET_5; // After173  ```174175  ```php PHP176  $model = 'claude-sonnet-4-6'; // Before177  $model = 'claude-sonnet-5'; // After178  ```179180  ```ruby Ruby181  legacy_model = "claude-sonnet-4-6" # Before182  model = "claude-sonnet-5" # After183  ```184</CodeGroup>185186Then review the following:1871881. **Token budgets and counts:** the [new tokenizer](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5#new-tokenizer) produces approximately 30% more tokens for the same text. The exact increase depends on the content and workload shape. Recount prompts with [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting), and revisit `max_tokens` limits sized close to your expected output length.1892. **Extended thinking:** if you still set `budget_tokens`, migrate to [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking). Manual extended thinking (`thinking: {type: "enabled"}`) is not supported and returns a 400 error.1903. **Sampling parameters:** requests that set sampling parameters (`temperature`, `top_p`, `top_k`) to a non-default value return a 400 error; remove them when migrating. Tool definitions and response shapes are unchanged, and assistant message prefilling was already unsupported on Claude Sonnet 4.6.191192See [Migrating to Claude Sonnet 5 from Claude Sonnet 4.6](https://platform.claude.com/docs/en/models/sonnet-5/migration-guide#migrating-from-claude-sonnet-4-6-to-claude-sonnet-5) for details.193194## Next steps195196<CardGroup>197  <Card title="Models overview" icon="arrow-right" href="https://platform.claude.com/docs/en/models/overview">198    Complete specs and pricing for all current Claude models.199  </Card>200201  <Card title="Token counting" icon="database" href="https://platform.claude.com/docs/en/build-with-claude/token-counting">202    Measure your prompts under the new tokenizer before you migrate.203  </Card>204205  <Card title="Adaptive thinking" icon="brain" href="https://platform.claude.com/docs/en/build-with-claude/thinking">206    The recommended thinking-on mode on Claude Sonnet 5.207  </Card>208209  <Card title="Context windows" icon="sliders" href="https://platform.claude.com/docs/en/build-with-claude/context-windows">210    How the 1M token context window works.211  </Card>212213  <Card title="Pricing" icon="shield" href="https://platform.claude.com/docs/en/about-claude/pricing">214    Complete pricing, including batch processing and prompt caching rates.215  </Card>216</CardGroup>217
Files main
Menu

Theme