Follow Discord
Sweep 28 Sep 2026 · 18:16Z Build v2.1.284 505 read Stable v2.1.277 Latest v2.1.284 Next v2.1.284 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One capture · api

One read of Claude Developer Platformapi-20260929T013708Z

77 pages moved out of 639 read.

Pages moved 77 significant first
Pages read 639 in this capture
Captured 01:37 UTC
Corpus hash 2ca3d5042784 corpus-hash

What this read moved

51-75 of 77, page 3 of 4

This capture is too large to show at once. Changes 51-75 of 77 are below, significant first; the rest are on the following screens.

api/messages/count_tokens Changed · +88 / -80 lines

from line 1061
10611061 
10621062 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
10631063 
1064 - `string`
1064 - `"claude-sonnet-5-5" or "claude-fable-5-1" or "claude-opus-5-5" or 16 more`
10651065 
1066 - `"claude-fable-5-1" or "claude-opus-5-5" or "claude-mythos-5-1" or 15 more`
1067 
10681066 The model that will complete your prompt.
10691067 
10701068 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
10711069 
1070 - `"claude-sonnet-5-5"`
1071 
1072 Efficient model for coding and agents
1073 
10721074 - `"claude-fable-5-1"`
10731075 
10741076 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows
from line 1085
10831085 
10841086 - `"claude-sonnet-5"`
10851087 
1086 High-performance model for coding and agents
1088 Efficient model for coding and agents
10871089 
10881090 - `"claude-fable-5"`
10891091 
from line 1145
11431145 
11441146 New class of intelligence, strongest in coding and cybersecurity
11451147 
1148 - `string`
1149 
11461150- `cache_control: optional CacheControlEphemeral or null`
11471151 
11481152 Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
from line 1236
12321236 - `ThinkingConfigDisabled object`
12331237 
12341238 - `type: "disabled"`
1239 
1240 - `ThinkingConfigBetweenTools object`
1241 
1242 - `type: "between_tools"`
12351243 
12361244 - `ThinkingConfigAdaptive object`
12371245 

api/messages/create Changed · +175 / -163 lines

from line 1073
10731073 
10741074 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
10751075 
1076 - `string`
1076 - `"claude-sonnet-5-5" or "claude-fable-5-1" or "claude-opus-5-5" or 16 more`
10771077 
1078 - `"claude-fable-5-1" or "claude-opus-5-5" or "claude-mythos-5-1" or 15 more`
1079 
10801078 The model that will complete your prompt.
10811079 
10821080 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
10831081 
1082 - `"claude-sonnet-5-5"`
1083 
1084 Efficient model for coding and agents
1085 
10841086 - `"claude-fable-5-1"`
10851087 
10861088 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows
from line 1097
10951097 
10961098 - `"claude-sonnet-5"`
10971099 
1098 High-performance model for coding and agents
1100 Efficient model for coding and agents
10991101 
11001102 - `"claude-fable-5"`
11011103 
from line 1157
11551157 
11561158 New class of intelligence, strongest in coding and cybersecurity
11571159 
1160 - `string`
1161 
11581162- `cache_control: optional CacheControlEphemeral or null`
11591163 
11601164 Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
from line 1279
12751279 
12761280- `stream: optional boolean`
12771281 
1278 Whether to incrementally stream the response using server-sent events.
1282 Whether to incrementally stream the response using server-sent events. When `true`, SDKs return a raw event stream.
12791283 
1280 See [streaming](https://platform.claude.com/docs/en/build-with-claude/streaming) for details.
1284 In the TypeScript, Python and Ruby SDKs, the recommended way to stream is `messages.stream()`. It sets `stream` for you and accumulates the events into the final message. See [Streaming with SDKs](https://platform.claude.com/docs/en/build-with-claude/streaming#streaming-with-sdks) for an example in each language.
12811285 
12821286- `system: optional string or array of TextBlockParam`
12831287 
from line 1339
13351339 
13361340 - `type: "disabled"`
13371341 
1342 - `ThinkingConfigBetweenTools object`
1343 
1344 - `type: "between_tools"`
1345 
13381346 - `ThinkingConfigAdaptive object`
13391347 
13401348 - `type: "adaptive"`
from line 3920
39123920 
39133921 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
39143922 
3915 - `string`
3923 - `"claude-sonnet-5-5" or "claude-fable-5-1" or "claude-opus-5-5" or 16 more`
39163924 
3917 - `"claude-fable-5-1" or "claude-opus-5-5" or "claude-mythos-5-1" or 15 more`
3918 
39193925 The model that will complete your prompt.
39203926 
39213927 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
39223928 
3929 - `"claude-sonnet-5-5"`
3930 
3931 Efficient model for coding and agents
3932 
39233933 - `"claude-fable-5-1"`
39243934 
39253935 Frontier intelligence for ambitious tasks across coding, scientific discovery, and enterprise workflows
from line 3944
39343944 
39353945 - `"claude-sonnet-5"`
39363946 
3937 High-performance model for coding and agents
3947 Efficient model for coding and agents
39383948 
39393949 - `"claude-fable-5"`
39403950 
from line 4003
39934003 **Deprecated**: Will reach end-of-life on June 30, 2026. Please migrate to claude-mythos-5. Visit https://docs.anthropic.com/en/docs/resources/model-deprecations for more information.
39944004 
39954005 New class of intelligence, strongest in coding and cybersecurity
4006 
4007 - `string`
39964008 
39974009 - `role: "assistant"`
39984010 

build-with-claude/claude-in-amazon-bedrock Changed · +4 / -4 lines

from line 102
102102 <Tabs>
103103 <Tab title="Gradle">
104104 ```kotlin
105 implementation("com.anthropic:anthropic-java:2.65.0")
106 implementation("com.anthropic:anthropic-java-bedrock:2.65.0")
105 implementation("com.anthropic:anthropic-java:2.66.0")
106 implementation("com.anthropic:anthropic-java-bedrock:2.66.0")
107107 ```
108108 </Tab>
109109 
from line 112
112112 <dependency>
113113 <groupId>com.anthropic</groupId>
114114 <artifactId>anthropic-java</artifactId>
115 <version>2.65.0</version>
115 <version>2.66.0</version>
116116 </dependency>
117117 <dependency>
118118 <groupId>com.anthropic</groupId>
119119 <artifactId>anthropic-java-bedrock</artifactId>
120 <version>2.65.0</version>
120 <version>2.66.0</version>
121121 </dependency>
122122 ```
123123 </Tab>

build-with-claude/claude-in-microsoft-foundry Changed · +4 / -4 lines

from line 79
7979 <Tabs>
8080 <Tab title="Gradle">
8181 ```kotlin
82 implementation("com.anthropic:anthropic-java:2.65.0")
83 implementation("com.anthropic:anthropic-java-foundry:2.65.0")
82 implementation("com.anthropic:anthropic-java:2.66.0")
83 implementation("com.anthropic:anthropic-java-foundry:2.66.0")
8484 
8585 // For Entra ID authentication, also add the Azure Identity library
8686 implementation("com.azure:azure-identity:1.18.3")
from line 92
9292 <dependency>
9393 <groupId>com.anthropic</groupId>
9494 <artifactId>anthropic-java</artifactId>
95 <version>2.65.0</version>
95 <version>2.66.0</version>
9696 </dependency>
9797 <dependency>
9898 <groupId>com.anthropic</groupId>
9999 <artifactId>anthropic-java-foundry</artifactId>
100 <version>2.65.0</version>
100 <version>2.66.0</version>
101101 </dependency>
102102 <!-- For Entra ID authentication, also add the Azure Identity library -->
103103 <dependency>

build-with-claude/claude-on-amazon-bedrock-legacy Changed · +4 / -4 lines

from line 54
5454 <Tab title="Java">
5555 <CodeGroup>
5656 ```groovy Gradle
57 implementation("com.anthropic:anthropic-java:2.65.0")
58 implementation("com.anthropic:anthropic-java-bedrock:2.65.0")
57 implementation("com.anthropic:anthropic-java:2.66.0")
58 implementation("com.anthropic:anthropic-java-bedrock:2.66.0")
5959 ```
6060 
6161 ```xml Maven
from line 62
6262 <dependency>
6363 <groupId>com.anthropic</groupId>
6464 <artifactId>anthropic-java</artifactId>
65 <version>2.65.0</version>
65 <version>2.66.0</version>
6666 </dependency>
6767 <dependency>
6868 <groupId>com.anthropic</groupId>
6969 <artifactId>anthropic-java-bedrock</artifactId>
70 <version>2.65.0</version>
70 <version>2.66.0</version>
7171 </dependency>
7272 ```
7373 

build-with-claude/claude-on-vertex-ai Changed · +4 / -4 lines

from line 45
4545 <Tab title="Java">
4646 <CodeGroup exclude="shell, python, typescript, csharp, go, php, ruby">
4747 ```groovy Gradle
48 implementation("com.anthropic:anthropic-java:2.65.0")
49 implementation("com.anthropic:anthropic-java-vertex:2.65.0")
48 implementation("com.anthropic:anthropic-java:2.66.0")
49 implementation("com.anthropic:anthropic-java-vertex:2.66.0")
5050 ```
5151 
5252 ```xml Maven
from line 53
5353 <dependency>
5454 <groupId>com.anthropic</groupId>
5555 <artifactId>anthropic-java</artifactId>
56 <version>2.65.0</version>
56 <version>2.66.0</version>
5757 </dependency>
5858 <dependency>
5959 <groupId>com.anthropic</groupId>
6060 <artifactId>anthropic-java-vertex</artifactId>
61 <version>2.65.0</version>
61 <version>2.66.0</version>
6262 </dependency>
6363 ```
6464 

build-with-claude/claude-platform-on-aws Changed · +4 / -4 lines

from line 305
305305 
306306 <Tab title="Java">
307307 ```kotlin Gradle
308 implementation("com.anthropic:anthropic-java:2.65.0")
309 implementation("com.anthropic:anthropic-java-aws:2.65.0")
308 implementation("com.anthropic:anthropic-java:2.66.0")
309 implementation("com.anthropic:anthropic-java-aws:2.66.0")
310310 ```
311311 
312312 ```xml Maven
from line 313
313313 <dependency>
314314 <groupId>com.anthropic</groupId>
315315 <artifactId>anthropic-java</artifactId>
316 <version>2.65.0</version>
316 <version>2.66.0</version>
317317 </dependency>
318318 <dependency>
319319 <groupId>com.anthropic</groupId>
320320 <artifactId>anthropic-java-aws</artifactId>
321 <version>2.65.0</version>
321 <version>2.66.0</version>
322322 </dependency>
323323 ```
324324 </Tab>

build-with-claude/prompt-engineering/prompting-claude-sonnet-5 Changed · +3 / -7 lines

from line 1
11---
22title: Prompting Claude Sonnet 5
33url: https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5
4description: Behavioral differences and prompting patterns for Claude Sonnet 5, covering effort, adaptive thinking defaults, tool use, and migration from Claude Sonnet 4.6.
4description: Behavioral differences and prompting patterns for Claude Sonnet 5, covering effort, adaptive thinking defaults, and tool use.
55---
66 
7This guide covers the prompting patterns specific to Claude Sonnet 5. For the model's capabilities and API changes, see [What's new in Claude Sonnet 5](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5). For techniques that apply across all current Claude models, see [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices).
7This guide covers the prompting patterns specific to Claude Sonnet 5. For the model's specifications, see [Claude Sonnet 5](https://platform.claude.com/docs/en/models/sonnet-5/overview). For techniques that apply across all current Claude models, see [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices).
88 
99Claude Sonnet 5 has particular strengths in coding and agentic tasks. It performs well out of the box on existing Claude Sonnet 4.6 prompts. The patterns in this guide cover the behaviors that most often require tuning.
1010 
11<Note>
12 For API parameter changes when migrating from Claude Sonnet 4.6 (adaptive thinking on by default, sampling parameters not accepted, manual extended thinking removed, and the new tokenizer), see the [migration guide](https://platform.claude.com/docs/en/models/sonnet-5/migration-guide#migrating-from-claude-sonnet-4-6-to-claude-sonnet-5).
13</Note>
14 
1511## Response length and verbosity
1612 
1713Claude Sonnet 5 calibrates response length to the complexity of the task rather than defaulting to a fixed verbosity. This usually means shorter answers on simple lookups and longer ones on open-ended analysis.
from line 53
5753Manual extended thinking (`thinking: {type: "enabled", budget_tokens: N}`) is not supported on Claude Sonnet 5 and returns a 400 error. It was deprecated on Claude Sonnet 4.6 and is now removed. Use adaptive thinking with the effort parameter instead.
5854 
5955<Note>
60 If you are running Claude Sonnet 5 at `high`, `xhigh`, or `max` effort, leave headroom in `max_tokens` so the model has room for thinking and tool calls. On long tasks, adaptive thinking can use a large share of the budget; if the budget is tight, you may see a response that is almost entirely thinking followed by a truncated answer and `stop_reason: "max_tokens"`. Raising `max_tokens` or dropping to `medium` effort resolves this. Because Claude Sonnet 5 uses a [new tokenizer](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5#new-tokenizer) that produces approximately 30% more tokens for the same text, `max_tokens` limits tuned for Claude Sonnet 4.6 may truncate equivalent output. The exact increase depends on the content and workload shape.
56 If you are running Claude Sonnet 5 at `high`, `xhigh`, or `max` effort, leave headroom in `max_tokens` so the model has room for thinking and tool calls. On long tasks, adaptive thinking can use a large share of the budget; if the budget is tight, you may see a response that is almost entirely thinking followed by a truncated answer and `stop_reason: "max_tokens"`. Raising `max_tokens` or dropping to `medium` effort resolves this. Because Claude Sonnet 5 uses a new tokenizer that produces approximately 30% more tokens for the same text, `max_tokens` limits tuned for Claude Sonnet 4.6 may truncate equivalent output. The exact increase depends on the content and workload shape.
6157</Note>
6258 
6359## Tool use triggering

models/sonnet-5/migration-guide Changed · +1229 / -654 lines

## Send a request to Claude Sonnet 5.5 ## Thinking runs by default ### Handle thinking in responses ### Turn off up-front thinking ## Migration checklist by starting model ### Every starting model ### Claude Sonnet 4.6 or earlier ### Claude Sonnet 4.5 or earlier ### Claude Sonnet 4 or earlier ### Claude Haiku 4.5 only ## Migrating to Claude Sonnet 5.5 from Claude Sonnet 5 ### Forced tool use is not supported ### Thinking blocks are tied to the model and the conversation ### Computer use needs the toolset on the Claude API and Google Cloud ### The advisor tool accepts fewer advisors ### Text between tool calls is returned in thinking blocks ### Safety classifiers and fallback ### Other changes ### Recommended changes ## Migrating to Claude Sonnet 5.5 from Claude Sonnet 4.6 and earlier Sonnet models ### Other changes ### Migrating from Claude Sonnet 4.5 or earlier ### Migrating from Claude Sonnet 4 or earlier ## Migrating to Claude Sonnet 5.5 from Claude Haiku 4.5 ## Migrating to Claude Sonnet 5 from Claude Sonnet 4.6 ### Update your model name ### What changed ### Migration checklist ## Migrating to Claude Sonnet 5 from Claude Sonnet 4.5 and earlier Sonnet models #### When migrating from Sonnet 4.5 #### When migrating from Claude 3.x ## Migrating to Claude Sonnet 5 from Claude Haiku 4.5 ### Update your model name ### What changed ### Migration checklist

The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.

from line 1
11---
2title: Migrating to Claude Sonnet 5
3url: https://platform.claude.com/docs/en/models/sonnet-5/migration-guide
4description: "Migrate to Claude Sonnet 5 from earlier Claude models: model IDs, breaking changes, and migration checklists."
2title: Migrating to Claude Sonnet 5.5
3url: https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide
4description: "Move code to Claude Sonnet 5.5 from Claude Sonnet 5, Claude Sonnet 4.6, Claude Sonnet 4.5, Claude Sonnet 4, Claude 3.7 Sonnet, or Claude Haiku 4.5: settings that return errors, thinking changes, and a checklist for each starting model."
55---
6 
7This guide lists the code changes for moving to Claude Sonnet 5.5 from Claude Sonnet 5, Claude Sonnet 4.6, Claude Sonnet 4.5, Claude Sonnet 4, Claude 3.7 Sonnet, or Claude Haiku 4.5. Read the first two sections, then read down to the section for your current model. The [migration checklist](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migration-checklist) lists every change by starting model.
68 
79<Note>
810 This guide covers migrating [Messages API](https://platform.claude.com/docs/en/build-with-claude/working-with-messages) code. If you use [Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview), no changes beyond updating the model name are required.
from line 14
1214 **Automate your migration with the Claude API skill.** In Claude Code, run `/claude-api migrate` to invoke the bundled [Claude API skill](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/claude-api-skill#migrating-to-a-newer-claude-model). It works for any current Claude model as the target:
1315 
1416 ```text wrap
15 /claude-api migrate this project to claude-sonnet-5
17 /claude-api migrate this project to claude-sonnet-5-5
1618 ```
1719 
1820 The skill applies the model ID swap and, as needed, breaking parameter changes, prefill replacement, and effort calibration for your target model across your code base, then produces a checklist of items to verify manually. It asks you to confirm the migration scope (entire working directory, a subdirectory, or a specific file list) before editing any files. The skill also detects Amazon Bedrock and Claude Platform on AWS clients and adjusts model ID formats and feature changes for those platforms.
1921</Tip>
2022 
21Claude Sonnet 5 offers the best combination of speed and intelligence in the Claude model family. It builds on Claude Sonnet 4.6.
22 
23Claude Sonnet 5 is a drop-in upgrade for Claude Sonnet 4.6, priced at $2/$10 USD per million input/output tokens; see [Pricing](https://platform.claude.com/docs/en/about-claude/pricing) for details. There are two breaking API changes for code already running on Claude Sonnet 4.6. First, [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) is on by default and manual extended thinking (`thinking: {type: "enabled", budget_tokens: N}`) returns a 400 error, so requests that ran without thinking can now return `thinking` blocks before the first `text` block and code that reads content by position must select content blocks by `type`. Second, sampling parameters (`temperature`, `top_p`, `top_k`) set to non-default values return a 400 error. Use adaptive thinking with the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) to control thinking depth. Claude Sonnet 5 supports the same set of features as Claude Sonnet 4.6, including the [1M token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows), [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking), [prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching), [batch processing](https://platform.claude.com/docs/en/build-with-claude/batch-processing), the [Files API](https://platform.claude.com/docs/en/build-with-claude/files), [PDF support](https://platform.claude.com/docs/en/build-with-claude/pdf-support), [vision](https://platform.claude.com/docs/en/build-with-claude/vision), and the full set of server-side and client-side [tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview). On the Claude API and Google Cloud, Claude Sonnet 5 also supports [computer use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool) as the stable `computer_toolset_20260801` toolset and the [browser use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/browser-use-tool) for tasks inside webpages, neither of which Claude Sonnet 4.6 supports; existing integrations on the earlier `computer_20251124` version continue to work unchanged 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). [Priority Tier](https://platform.claude.com/docs/en/api/service-tiers#supported-models) is not available on Claude Sonnet 5. Claude Sonnet 5 also uses a new tokenizer.
24 
25## Migrating to Claude Sonnet 5 from Claude Sonnet 4.6
26 
27<Note>
28 If your code is on Claude Sonnet 4.5 or earlier, also apply [Migrating to Claude Sonnet 5 from Claude Sonnet 4.5 and earlier Sonnet models](https://platform.claude.com/docs/en/models/sonnet-5/migration-guide#migrating-from-sonnet-45). Those steps include breaking changes (assistant message prefilling rejected, tool parameter JSON escaping differences) that this section alone does not cover.
29</Note>
30 
31### Update your model name
32 
33```python
34# Sonnet migration
35model = "claude-sonnet-4-6" # Before
36model = "claude-sonnet-5" # After
23Claude Sonnet 5.5 has the same prices as Claude Sonnet 5. See [Claude pricing](https://platform.claude.com/docs/en/about-claude/pricing). For its context window and output limits, see the [Claude Sonnet 5.5 model page](https://platform.claude.com/docs/en/models/sonnet-5-5/overview). For features and prompting, see [What's new in Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#feature-support) and [Prompting Claude Sonnet 5.5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5).
24 
25## Send a request to Claude Sonnet 5.5
26 
27This request works on Claude Sonnet 5.5 as written. It sets an effort level, and the SDK tabs read the reply by block type. It leaves out five settings that return a 400 error: [thinking budgets](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#sonnet-46-breaking-changes), [sampling parameters](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#sonnet-46-breaking-changes), [assistant prefill](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-sonnet-45), [forced tool choice](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#forced-tool-use), and [`thinking: {"type": "disabled"}`](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#turn-off-up-front-thinking).
28 
29<CodeGroup>
30 ```bash cURL
31 curl https://api.anthropic.com/v1/messages \
32 -H "x-api-key: $ANTHROPIC_API_KEY" \
33 -H "anthropic-version: 2023-06-01" \
34 -H "content-type: application/json" \
35 -d '{
36 "model": "claude-sonnet-5-5",
37 "max_tokens": 4096,
38 "messages": [{
39 "role": "user",
40 "content": "Analyze the trade-offs between microservices and monolithic architectures"
41 }],
42 "output_config": {
43 "effort": "medium"
44 }
45 }'
46 ```
47 
48 ```bash CLI
49 ant messages create \
50 --model claude-sonnet-5-5 \
51 --max-tokens 4096 \
52 --output-config '{effort: medium}' \
53 --message '{role: user, content: "Analyze the trade-offs between microservices and monolithic architectures"}'
54 ```
55 
56 ```python Python
57 client = anthropic.Anthropic()
58 
59 response = client.messages.create(
60 model="claude-sonnet-5-5",
61 max_tokens=4096,
62 messages=[
63 {
64 "role": "user",
65 "content": "Analyze the trade-offs between microservices and monolithic architectures",
66 }
67 ],
68 output_config={"effort": "medium"},
69 )
70 
71 print(f"Stop reason: {response.stop_reason}")
72 for block in response.content:
73 if block.type == "text":
74 print(block.text)
75 ```
76 
77 ```typescript TypeScript
78 const client = new Anthropic();
79 
80 const response = await client.messages.create({
81 model: "claude-sonnet-5-5",
82 max_tokens: 4096,
83 messages: [
84 {
85 role: "user",
86 content: "Analyze the trade-offs between microservices and monolithic architectures"
87 }
88 ],
89 output_config: {
90 effort: "medium"
91 }
92 });
93 
94 console.log(`Stop reason: ${response.stop_reason}`);
95 const textBlock = response.content.find(
96 (block): block is Anthropic.TextBlock => block.type === "text"
97 );
98 console.log(textBlock?.text);
99 ```
100 
101 ```csharp C#
102 AnthropicClient client = new();
103 
104 var parameters = new MessageCreateParams
105 {
106 Model = Model.ClaudeSonnet5_5,
107 MaxTokens = 4096,
108 Messages = [
109 new() {
110 Role = Role.User,
111 Content = "Analyze the trade-offs between microservices and monolithic architectures"
112 }
113 ],
114 OutputConfig = new OutputConfig
115 {
116 Effort = Effort.Medium
117 }
118 };
119 
120 var message = await client.Messages.Create(parameters);
121 Console.WriteLine($"Stop reason: {message.StopReason?.Raw()}");
122 foreach (var block in message.Content)
123 {
124 if (block.TryPickText(out var textBlock))
125 {
126 Console.WriteLine(textBlock.Text);
127 }
128 }
129 ```
130 
131 ```go Go
132 client := anthropic.NewClient()
133 
134 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
135 Model: anthropic.ModelClaudeSonnet5_5,
136 MaxTokens: 4096,
137 Messages: []anthropic.MessageParam{
138 anthropic.NewUserMessage(anthropic.NewTextBlock("Analyze the trade-offs between microservices and monolithic architectures")),
139 },
140 OutputConfig: anthropic.OutputConfigParam{
141 Effort: anthropic.OutputConfigEffortMedium,
142 },
143 })
144 if err != nil {
145 log.Fatal(err)
146 }
147 fmt.Println("Stop reason:", response.StopReason)
148 for _, block := range response.Content {
149 if textBlock, ok := block.AsAny().(anthropic.TextBlock); ok {
150 fmt.Println(textBlock.Text)
151 }
152 }
153 ```
154 
155 ```java Java
156 import com.anthropic.models.messages.OutputConfig;
157 
158 void main() {
159 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
160 
161 MessageCreateParams params = MessageCreateParams.builder()
162 .model(Model.CLAUDE_SONNET_5_5)
163 .maxTokens(4096L)
164 .addUserMessage("Analyze the trade-offs between microservices and monolithic architectures")
165 .outputConfig(OutputConfig.builder()
166 .effort(OutputConfig.Effort.MEDIUM)
167 .build())
168 .build();
169 
170 Message response = client.messages().create(params);
171 response.stopReason().ifPresent(reason -> IO.println("Stop reason: " + reason));
172 response.content().stream()
173 .flatMap(block -> block.text().stream())
174 .forEach(textBlock -> IO.println(textBlock.text()));
175 }
176 ```
177 
178 ```php PHP
179 $client = new Client();
180 
181 $message = $client->messages->create(
182 maxTokens: 4096,
183 messages: [
184 ['role' => 'user', 'content' => 'Analyze the trade-offs between microservices and monolithic architectures']
185 ],
186 model: 'claude-sonnet-5-5',
187 outputConfig: ['effort' => 'medium'],
188 );
189 
190 echo "Stop reason: {$message->stopReason}", PHP_EOL;
191 foreach ($message->content as $block) {
192 if ($block->type === 'text') {
193 echo $block->text, PHP_EOL;
194 }
195 }
196 ```
197 
198 ```ruby Ruby
199 client = Anthropic::Client.new
200 
201 message = client.messages.create(
202 model: "claude-sonnet-5-5",
203 max_tokens: 4096,
204 messages: [
205 { role: "user", content: "Analyze the trade-offs between microservices and monolithic architectures" }
206 ],
207 output_config: {
208 effort: "medium"
209 }
210 )
211 
212 puts "Stop reason: #{message.stop_reason}"
213 message.content.each do |block|
214 puts block.text if block.type == :text
215 end
216 ```
217</CodeGroup>
218 
219## Thinking runs by default
220 
221On Claude Sonnet 5.5, a request with no `thinking` field runs with [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking), as does `thinking: {"type": "adaptive"}`. On Claude Sonnet 4.6 and earlier models and on Claude Haiku 4.5, that request ran without thinking. To keep running without up-front thinking, see [Turn off up-front thinking](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#turn-off-up-front-thinking).
222 
223| Model | Thinking without a `thinking` field | `thinking.type` values accepted | Default `display` |
224| -------------------------------------- | ----------------------------------- | ---------------------------------------------------- | ----------------- |
225| Claude Sonnet 5.5 | On | `"adaptive"`, `"between_tools"` | `"omitted"` |
226| Claude Sonnet 5 | On | `"adaptive"`, `"disabled"` | `"omitted"` |
227| Claude Sonnet 4.6 | Off | `"adaptive"`, `"disabled"`, `"enabled"` (deprecated) | `"summarized"` |
228| Claude Sonnet 4.5 and Claude Haiku 4.5 | Off | `"disabled"`, `"enabled"` | `"summarized"` |
229 
230### Handle thinking in responses
231 
232Code that ran without thinking needs all three items. Code from Claude Sonnet 5 likely has the first two.
233 
234* **Read content blocks by `type`.** A response can begin with `thinking` blocks, so code that reads `content[0].text` breaks.
235* **Pass `thinking` blocks back unchanged** in tool-use loops, including empty ones. See [Preserving thinking blocks](https://platform.claude.com/docs/en/build-with-claude/thinking#preserving-thinking-blocks).
236* **Revisit `max_tokens`.** It covers thinking plus text, and thinking tokens are billed as output tokens. See [Cost control](https://platform.claude.com/docs/en/build-with-claude/thinking-steering-and-cost#cost-control).
237 
238Thinking text is omitted by default. `thinking` blocks arrive with an empty `thinking` field and a `signature`. To get readable summaries, set `display: "summarized"`, the default on Claude Sonnet 4.6 and earlier models and on Claude Haiku 4.5. See [Controlling thinking display](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display).
239 
240### Turn off up-front thinking
241 
242To turn off up-front thinking on Claude Sonnet 5.5, send `thinking: {"type": "between_tools"}`. It's the lowest thinking setting. Its progress updates between tool calls still come back as `thinking` blocks with their summary text. Without tools, the response contains only text. Claude Sonnet 5 turns thinking off with `thinking: {"type": "disabled"}` instead, and earlier models run without thinking by default. On Claude Sonnet 5.5, `disabled` returns a 400 `invalid_request_error`:
243 
244```text wrap
245"thinking.type.disabled" is not supported for this model. Use "thinking.type.between_tools" for the lowest thinking setting, or "thinking.type.adaptive" and "output_config.effort" to control thinking behavior.
37246```
38247 
39### What changed
40 
41Items 4 and 5 in the following list are breaking changes. `max_tokens` remains a hard limit on total output (thinking plus response text), so revisit it for workloads that ran without thinking on Claude Sonnet 4.6.
42 
431. **New tokenizer:** Claude 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. Requests, responses, and streaming events keep the same shape, and no code changes are required, but anything you measure or budget in tokens shifts: `usage` fields and [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) results for the same text are higher, the 1M token context window holds less text, and a `max_tokens` limit tuned for Claude Sonnet 4.6 may truncate equivalent output. Per-token pricing is lower ($2/$10 USD versus Claude Sonnet 4.6's $3/$15 USD per million input/output tokens), but the cost of an equivalent request does not drop in direct proportion. Re-run token counting against Claude Sonnet 5 rather than reusing counts measured against earlier models.
44 
452. **128k max output tokens (unchanged):** Claude Sonnet 5 supports up to 128k output tokens, the same as Claude Sonnet 4.6. Existing `max_tokens` values remain valid. Account for the new tokenizer when sizing them.
46 
473. **Assistant message prefilling (unchanged):** Prefilling the assistant message returns a `400` error on Claude Sonnet 5, the same as on Claude Sonnet 4.6. If you removed prefill when migrating to Claude Sonnet 4.6, no further changes are needed. Use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), system prompt instructions, or `output_config.format` instead.
48 
494. **Adaptive thinking on by default:** On 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"}`. Manual extended thinking (`thinking: {type: "enabled", budget_tokens: N}`) is not supported and returns a 400 error. Use the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) (default `high`) to control thinking depth.
50 
51 With thinking on, a response can begin with one or more `thinking` blocks before the first `text` block, returned with an empty `thinking` field at the default `display: "omitted"`. Code that reads the reply by position, such as `content[0].text` or a stream handler that treats the first content block as text, must select content blocks by their `type` field instead, and tool-use loops must pass `thinking` blocks back complete and unmodified with their tool results (see [Preserving thinking blocks](https://platform.claude.com/docs/en/build-with-claude/thinking#preserving-thinking-blocks)). Thinking tokens are billed as output tokens even when the thinking text is not returned. If you used thinking on Claude Sonnet 4.6 and display the returned thinking text, note that `thinking.display` defaulted to `"summarized"` there and defaults to `"omitted"` on Claude Sonnet 5; set `display: "summarized"`, as the following example does, to keep receiving readable summaries (see [Controlling thinking display](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display)).
52 
53 <Tabs>
54 <Tab title="Claude Sonnet 5">
55 <Note>
56 Adaptive thinking is on by default for Claude Sonnet 5. The `thinking` field is shown explicitly here to set `display: "summarized"`; if you omit `thinking`, Claude Sonnet 5 omits thinking content from the response by default. For per-model defaults, see [Configurations each model rejects](https://platform.claude.com/docs/en/build-with-claude/thinking-troubleshooting#rejected-configurations).
57 </Note>
58 
59 <CodeGroup>
60 ```bash cURL
61 curl https://api.anthropic.com/v1/messages \
62 -H "x-api-key: $ANTHROPIC_API_KEY" \
63 -H "anthropic-version: 2023-06-01" \
64 -H "content-type: application/json" \
65 -d '{
66 "model": "claude-sonnet-5",
67 "max_tokens": 16000,
68 "thinking": {
69 "type": "adaptive",
70 "display": "summarized"
71 },
72 "output_config": {
73 "effort": "high"
74 },
75 "messages": [
76 {
77 "role": "user",
78 "content": "Find all pairs of positive integers (x, y) such that x^2 - y^2 = 2024."
79 }
80 ]
81 }'
82 ```
83 
84 ```bash CLI
85 ant messages create --transform content --format yaml <<'YAML'
86 model: claude-sonnet-5
87 max_tokens: 16000
88 thinking:
89 type: adaptive
90 display: summarized
91 output_config:
92 effort: high
93 messages:
94 - role: user
95 content: Find all pairs of positive integers (x, y) such that x^2 - y^2 = 2024.
96 YAML
97 ```
98 
99 ```python Python
100 client = anthropic.Anthropic()
101 
102 response = client.messages.create(
103 model="claude-sonnet-5",
104 max_tokens=16000,
105 thinking={"type": "adaptive", "display": "summarized"},
106 output_config={"effort": "high"},
107 messages=[
108 {
109 "role": "user",
110 "content": "Find all pairs of positive integers (x, y) such that x^2 - y^2 = 2024.",
111 }
112 ],
113 )
114 
115 # The response contains summarized thinking blocks and text blocks
116 for block in response.content:
117 match block.type:
118 case "thinking":
119 print(f"\nThinking summary: {block.thinking}")
120 case "text":
121 print(f"\nResponse: {block.text}")
122 ```
123 
124 ```typescript TypeScript
125 const client = new Anthropic();
126 
127 const response = await client.messages.create({
128 model: "claude-sonnet-5",
129 max_tokens: 16000,
130 thinking: {
131 type: "adaptive",
132 display: "summarized"
133 },
134 output_config: {
135 effort: "high"
136 },
137 messages: [
138 {
139 role: "user",
140 content: "Find all pairs of positive integers (x, y) such that x^2 - y^2 = 2024."
141 }
142 ]
143 });
144 
145 // The response contains summarized thinking blocks and text blocks
146 for (const block of response.content) {
147 switch (block.type) {
148 case "thinking":
149 console.log(`\nThinking summary: ${block.thinking}`);
150 break;
151 case "text":
152 console.log(`\nResponse: ${block.text}`);
153 break;
154 }
155 }
156 ```
157 
158 ```csharp C#
159 AnthropicClient client = new();
160 
161 var response = await client.Messages.Create(new()
162 {
163 Model = Model.ClaudeSonnet5,
164 MaxTokens = 16000,
165 Thinking = new ThinkingConfigAdaptive { Display = Display.Summarized },
166 OutputConfig = new OutputConfig { Effort = Effort.High },
167 Messages =
168 [
169 new()
170 {
171 Role = Role.User,
172 Content = "Find all pairs of positive integers (x, y) such that x^2 - y^2 = 2024.",
173 },
174 ],
175 });
176 
177 // The response contains summarized thinking blocks and text blocks
178 foreach (var block in response.Content)
179 {
180 if (block.TryPickThinking(out var thinking))
181 {
182 Console.WriteLine($"\nThinking summary: {thinking.Thinking}");
183 }
184 else if (block.TryPickText(out var text))
185 {
186 Console.WriteLine($"\nResponse: {text.Text}");
187 }
188 }
189 ```
190 
191 ```go Go
192 client := anthropic.NewClient()
193 
194 response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
195 Model: anthropic.ModelClaudeSonnet5,
196 MaxTokens: 16000,
197 Thinking: anthropic.ThinkingConfigParamUnion{
198 OfAdaptive: &anthropic.ThinkingConfigAdaptiveParam{
199 Display: anthropic.ThinkingConfigAdaptiveDisplaySummarized,
200 },
201 },
202 OutputConfig: anthropic.OutputConfigParam{
203 Effort: anthropic.OutputConfigEffortHigh,
204 },
205 Messages: []anthropic.MessageParam{
206 anthropic.NewUserMessage(anthropic.NewTextBlock("Find all pairs of positive integers (x, y) such that x^2 - y^2 = 2024.")),
207 },
208 })
209 if err != nil {
210 log.Fatal(err)
211 }
212 
213 // The response contains summarized thinking blocks and text blocks
214 for _, block := range response.Content {
215 switch block := block.AsAny().(type) {
216 case anthropic.ThinkingBlock:
217 fmt.Printf("\nThinking summary: %s", block.Thinking)
218 case anthropic.TextBlock:
219 fmt.Printf("\nResponse: %s", block.Text)
220 }
221 }
222 ```
223 
224 ```java Java
225 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
226 import com.anthropic.models.messages.MessageCreateParams;
227 import com.anthropic.models.messages.Model;
228 import com.anthropic.models.messages.OutputConfig;
229 import com.anthropic.models.messages.ThinkingConfigAdaptive;
230 
231 void main() {
232 var client = AnthropicOkHttpClient.fromEnv();
233 
234 var params = MessageCreateParams.builder()
235 .model(Model.CLAUDE_SONNET_5)
236 .maxTokens(16_000)
237 .thinking(ThinkingConfigAdaptive.builder()
238 .display(ThinkingConfigAdaptive.Display.SUMMARIZED)
239 .build())
240 .outputConfig(OutputConfig.builder()
241 .effort(OutputConfig.Effort.HIGH)
242 .build())
243 .addUserMessage("Find all pairs of positive integers (x, y) such that x^2 - y^2 = 2024.")
244 .build();
245 
246 var response = client.messages().create(params);
247 
248 // The response contains summarized thinking blocks and text blocks
249 for (var block : response.content()) {
250 block.thinking().ifPresent(thinkingBlock ->
251 IO.println("\nThinking summary: " + thinkingBlock.thinking())
252 );
253 block.text().ifPresent(textBlock ->
254 IO.println("\nResponse: " + textBlock.text())
255 );
256 }
257 }
258 ```
259 
260 ```php PHP
261 use Anthropic\Messages\TextBlock;
262 use Anthropic\Messages\ThinkingBlock;
263 
264 $client = new Client();
265 
266 $response = $client->messages->create(
267 model: 'claude-sonnet-5',
268 maxTokens: 16000,
269 thinking: ['type' => 'adaptive', 'display' => 'summarized'],
270 outputConfig: ['effort' => 'high'],
271 messages: [
272 [
273 'role' => 'user',
274 'content' => 'Find all pairs of positive integers (x, y) such that x^2 - y^2 = 2024.',
275 ],
276 ],
277 );
278 
279 // The response contains summarized thinking blocks and text blocks
280 foreach ($response->content as $block) {
281 echo match (true) {
282 $block instanceof ThinkingBlock => "\nThinking summary: {$block->thinking}",
283 $block instanceof TextBlock => "\nResponse: {$block->text}",
284 default => '',
285 };
286 }
287 ```
288 
289 ```ruby Ruby
290 client = Anthropic::Client.new
291 
292 response = client.messages.create(
293 model: "claude-sonnet-5",
294 max_tokens: 16_000,
295 thinking: {type: :adaptive, display: :summarized},
296 output_config: {effort: :high},
297 messages: [
298 {
299 role: :user,
300 content: "Find all pairs of positive integers (x, y) such that x^2 - y^2 = 2024."
301 }
302 ]
303 )
304 
305 # The response contains summarized thinking blocks and text blocks
306 response.content.each do |block|
307 case block
308 when Anthropic::Models::ThinkingBlock
309 puts "\nThinking summary: #{block.thinking}"
310 when Anthropic::Models::TextBlock
311 puts "\nResponse: #{block.text}"
312 end
313 end
314 ```
315 </CodeGroup>
316 </Tab>
317 
318 <Tab title="Claude Sonnet 4.6">
319 <CodeGroup>
320 ```bash cURL
321 curl https://api.anthropic.com/v1/messages \
322 -H "x-api-key: $ANTHROPIC_API_KEY" \
323 -H "anthropic-version: 2023-06-01" \
324 -H "content-type: application/json" \
325 -d '{
326 "model": "claude-sonnet-4-6",
327 "max_tokens": 16000,
328 "thinking": {
329 "type": "enabled",
330 "budget_tokens": 10000
331 },
332 "messages": [
333 {
334 "role": "user",
335 "content": "Are there an infinite number of prime numbers such that n mod 4 == 3?"
336 }
337 ]
338 }'
339 ```
340 
341 ```bash CLI
342 ant messages create \
343 --format yaml <<'YAML'
344 model: claude-sonnet-4-6
345 max_tokens: 16000
346 thinking:
347 type: enabled
348 budget_tokens: 10000
349 messages:
350 - role: user
351 content: Are there an infinite number of prime numbers such that n mod 4 == 3?
352 YAML
353 ```
354 
355 ```python Python
356 client = anthropic.Anthropic()
357 
358 response = client.messages.create(
359 model="claude-sonnet-4-6",
360 max_tokens=16000,
361 thinking={"type": "enabled", "budget_tokens": 10000},
362 messages=[
363 {
364 "role": "user",
365 "content": "Are there an infinite number of prime numbers such that n mod 4 == 3?",
366 }
367 ],
368 )
369 
370 # The response contains summarized thinking blocks and text blocks
371 for block in response.content:
372 match block.type:
373 case "thinking":
374 print(f"\nThinking summary: {block.thinking}")
375 case "text":
376 print(f"\nResponse: {block.text}")
377 ```
378 
379 ```typescript TypeScript
380 const client = new Anthropic();
381 
382 const response = await client.messages.create({
383 model: "claude-sonnet-4-6",
384 max_tokens: 16000,
385 thinking: {
386 type: "enabled",
387 budget_tokens: 10000,
388 },
389 messages: [
390 {
391 role: "user",
392 content: "Are there an infinite number of prime numbers such that n mod 4 == 3?",
393 },
394 ],
395 });
396 
397 // The response contains summarized thinking blocks and text blocks
398 for (const block of response.content) {
399 switch (block.type) {
400 case "thinking":
401 console.log(`\nThinking summary: ${block.thinking}`);
402 break;
403 case "text":
404 console.log(`\nResponse: ${block.text}`);
405 break;
406 }
407 }
408 ```
409 
410 ```csharp C#
411 AnthropicClient client = new();
412 
413 var response = await client.Messages.Create(new()
414 {
415 Model = Model.ClaudeSonnet4_6,
416 MaxTokens = 16000,
417 Thinking = new ThinkingConfigEnabled(budgetTokens: 10000),
418 Messages =
419 [
420 new()
421 {
422 Role = Role.User,
423 Content = "Are there an infinite number of prime numbers such that n mod 4 == 3?",
424 },
425 ],
426 });
427 
428 // The response contains summarized thinking blocks and text blocks
429 foreach (var block in response.Content)
430 {
431 if (block.TryPickThinking(out var thinking))
432 {
433 Console.WriteLine($"\nThinking summary: {thinking.Thinking}");
434 }
435 else if (block.TryPickText(out var text))
436 {
437 Console.WriteLine($"\nResponse: {text.Text}");
438 }
439 }
440 ```
441 
442 ```go Go
443 client := anthropic.NewClient()
444 
445 response, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
446 Model: anthropic.ModelClaudeSonnet4_6,
447 MaxTokens: 16000,
448 Thinking: anthropic.ThinkingConfigParamOfEnabled(10000),
449 Messages: []anthropic.MessageParam{
450 anthropic.NewUserMessage(anthropic.NewTextBlock("Are there an infinite number of prime numbers such that n mod 4 == 3?")),
451 },
452 })
453 if err != nil {
454 log.Fatal(err)
455 }
456 
457 // The response contains summarized thinking blocks and text blocks
458 for _, block := range response.Content {
459 switch block := block.AsAny().(type) {
460 case anthropic.ThinkingBlock:
461 fmt.Printf("\nThinking summary: %s", block.Thinking)
462 case anthropic.TextBlock:
463 fmt.Printf("\nResponse: %s", block.Text)
464 }
465 }
466 ```
467 
468 ```java Java
469 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
470 import com.anthropic.models.messages.MessageCreateParams;
471 import com.anthropic.models.messages.Model;
472 
473 void main() {
474 var client = AnthropicOkHttpClient.fromEnv();
475 
476 var params = MessageCreateParams.builder()
477 .model(Model.CLAUDE_SONNET_4_6)
478 .maxTokens(16_000)
479 .enabledThinking(10_000)
480 .addUserMessage("Are there an infinite number of prime numbers such that n mod 4 == 3?")
481 .build();
482 
483 var response = client.messages().create(params);
484 
485 // The response contains summarized thinking blocks and text blocks
486 for (var block : response.content()) {
487 block.thinking().ifPresent(thinkingBlock ->
488 IO.println("\nThinking summary: " + thinkingBlock.thinking())
489 );
490 block.text().ifPresent(textBlock ->
491 IO.println("\nResponse: " + textBlock.text())
492 );
493 }
494 }
495 ```
496 
497 ```php PHP
498 $client = new Client();
499 
500 $response = $client->messages->create(
501 model: 'claude-sonnet-4-6',
502 maxTokens: 16000,
503 thinking: ['type' => 'enabled', 'budget_tokens' => 10000],
504 messages: [
505 [
506 'role' => 'user',
507 'content' => 'Are there an infinite number of prime numbers such that n mod 4 == 3?',
508 ],
509 ],
510 );
511 
512 // The response contains summarized thinking blocks and text blocks
513 foreach ($response->content as $block) {
514 echo match (true) {
515 $block instanceof \Anthropic\Messages\ThinkingBlock => "\nThinking summary: {$block->thinking}",
516 $block instanceof \Anthropic\Messages\TextBlock => "\nResponse: {$block->text}",
517 default => '',
518 };
519 }
520 ```
521 
522 ```ruby Ruby
523 client = Anthropic::Client.new
524 
525 response = client.messages.create(
526 model: "claude-sonnet-4-6",
527 max_tokens: 16_000,
528 thinking: {
529 type: :enabled,
530 budget_tokens: 10_000
531 },
532 messages: [
533 {
534 role: :user,
535 content: "Are there an infinite number of prime numbers such that n mod 4 == 3?"
536 }
537 ]
538 )
539 
540 # The response contains summarized thinking blocks and text blocks
541 response.content.each do |block|
542 case block
543 when Anthropic::Models::ThinkingBlock
544 puts "\nThinking summary: #{block.thinking}"
545 when Anthropic::Models::TextBlock
546 puts "\nResponse: #{block.text}"
547 end
548 end
549 ```
550 </CodeGroup>
551 </Tab>
552 </Tabs>
553 
5545. **Sampling parameters removed:** Sampling parameters (`temperature`, `top_p`, `top_k`) set to a non-default value are not accepted and return a 400 error.
555 
5566. **Cybersecurity safeguards:** Claude 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.
557 
558### Migration checklist
559 
560* Update model name from `claude-sonnet-4-6` to `claude-sonnet-5`.
561* Re-run [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) against Claude Sonnet 5. The new tokenizer produces approximately 30% more tokens for the same text, which can change per-request cost even though per-token pricing is lower. The exact increase depends on the content and workload shape.
562* Revisit `max_tokens` limits sized close to your expected output length, and raise them up to the 128k maximum (unchanged from Claude Sonnet 4.6) where useful.
563* Remove `thinking: {type: "enabled", budget_tokens: N}` configuration (returns a 400 error). Adaptive thinking is on by default; pass `{type: "disabled"}` to turn it off, or use the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) to control depth.
564* Update response parsing that reads content by position, such as `content[0].text`: with thinking on, `thinking` blocks arrive before `text` blocks. Select content blocks by `type` instead, and pass `thinking` blocks back unmodified in tool-use loops; modified blocks return a 400 error.
565* Verify any code that parses the `thinking` field treats it as display text only. `thinking.display` defaults to `"omitted"` on Claude Sonnet 5 (it defaulted to `"summarized"` on Claude Sonnet 4.6), so thinking blocks arrive with an empty `thinking` field; set `display: "summarized"` to receive readable summaries. See [Controlling thinking display](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display).
566* Remove `temperature`, `top_p`, and `top_k` parameters set to non-default values (they return a 400 error on Claude Sonnet 5).
567* Add handling for `stop_reason: "refusal"` if your workload may touch cybersecurity topics.
568* Re-baseline cost on your typical workload before production deployment.
569* Review `max_tokens` for workloads that previously ran without thinking.
570 
571## Migrating to Claude Sonnet 5 from Claude Sonnet 4.5 and earlier Sonnet models
572 
573If you are migrating from Claude Sonnet 4.5 or an earlier Sonnet model directly to Claude Sonnet 5, apply the [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) changes plus the changes in this section.
574 
575<Warning>
576 Claude Sonnet 5 defaults to an effort level of `high`, in contrast to Sonnet 4.5 which had no effort parameter. Consider adjusting the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) as you migrate. If not explicitly set, you may experience higher latency with the default effort level.
577</Warning>
248`between_tools` works on every platform that offers Claude Sonnet 5.5, with no beta header. It's accepted at `low`, `medium`, and `high` effort. At `xhigh` or `max`, it returns a 400 error. To run at those levels, use adaptive thinking: omit the `thinking` field or send `thinking: {"type": "adaptive"}`. `between_tools` takes no other field: `display`, `budget_tokens`, or `block_binding` sent with it returns a 400 error. With [server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback), a `between_tools` request that falls back to Claude Sonnet 5 runs there with `thinking: {"type": "disabled"}`.
249 
250With `between_tools`, effort can't change mid-conversation: a per-message `output_config.effort` that differs from the level in effect returns a 400 error. To vary effort per turn, use adaptive thinking. For prompting guidance, see [Running without up-front thinking](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5#running-without-up-front-thinking).
251 
252Before (Claude Sonnet 5):
253 
254<CodeGroup>
255 ```bash cURL
256 curl https://api.anthropic.com/v1/messages \
257 -H "x-api-key: $ANTHROPIC_API_KEY" \
258 -H "anthropic-version: 2023-06-01" \
259 -H "content-type: application/json" \
260 -d '{
261 "model": "claude-sonnet-5",
262 "max_tokens": 16000,
263 "thinking": {"type": "disabled"},
264 "output_config": {"effort": "xhigh"},
265 "messages": [{"role": "user", "content": "..."}]
266 }'
267 ```
268 
269 ```bash CLI
270 ant messages create \
271 --model claude-sonnet-5 \
272 --max-tokens 16000 \
273 --thinking '{type: disabled}' \
274 --output-config '{effort: xhigh}' \
275 --message '{role: user, content: "..."}'
276 ```
277 
278 ```python Python
279 client.messages.create(
280 model="claude-sonnet-5",
281 max_tokens=16000,
282 thinking={"type": "disabled"},
283 output_config={"effort": "xhigh"},
284 messages=[{"role": "user", "content": "..."}],
285 )
286 ```
287 
288 ```typescript TypeScript
289 await client.messages.create({
290 model: "claude-sonnet-5",
291 max_tokens: 16000,
292 thinking: { type: "disabled" },
293 output_config: { effort: "xhigh" },
294 messages: [{ role: "user", content: "..." }]
295 });
296 ```
297 
298 ```csharp C#
299 await client.Messages.Create(new MessageCreateParams
300 {
301 Model = Model.ClaudeSonnet5,
302 MaxTokens = 16000,
303 Thinking = new ThinkingConfigDisabled(),
304 OutputConfig = new() { Effort = Effort.Xhigh },
305 Messages = [new() { Role = Role.User, Content = "..." }],
306 });
307 ```
308 
309 ```go Go
310 client.Messages.New(context.TODO(), anthropic.MessageNewParams{
311 Model: anthropic.ModelClaudeSonnet5,
312 MaxTokens: 16000,
313 Thinking: anthropic.ThinkingConfigParamUnion{
314 OfDisabled: &anthropic.ThinkingConfigDisabledParam{},
315 },
316 OutputConfig: anthropic.OutputConfigParam{
317 Effort: anthropic.OutputConfigEffortXhigh,
318 },
319 Messages: []anthropic.MessageParam{
320 anthropic.NewUserMessage(anthropic.NewTextBlock("...")),
321 },
322 })
323 ```
324 
325 ```java Java
326 MessageCreateParams params = MessageCreateParams.builder()
327 .model(Model.CLAUDE_SONNET_5)
328 .maxTokens(16000L)
329 .thinking(ThinkingConfigDisabled.builder().build())
330 .outputConfig(OutputConfig.builder()
331 .effort(OutputConfig.Effort.XHIGH)
332 .build())
333 .addUserMessage("...")
334 .build();
335 
336 client.messages().create(params);
337 ```
338 
339 ```php PHP
340 $client->messages->create(
341 model: Model::CLAUDE_SONNET_5,
342 maxTokens: 16000,
343 thinking: ThinkingConfigDisabled::with(),
344 outputConfig: OutputConfig::with(effort: Effort::XHIGH),
345 messages: [['role' => 'user', 'content' => '...']],
346 );
347 ```
348 
349 ```ruby Ruby
350 client.messages.create(
351 model: Anthropic::Model::CLAUDE_SONNET_5,
352 max_tokens: 16000,
353 thinking: Anthropic::ThinkingConfigDisabled.new,
354 output_config: { effort: Anthropic::OutputConfig::Effort::XHIGH },
355 messages: [{ role: "user", content: "..." }]
356 )
357 ```
358</CodeGroup>
359 
360After (Claude Sonnet 5.5):
361 
362<CodeGroup>
363 ```bash cURL
364 curl https://api.anthropic.com/v1/messages \
365 -H "x-api-key: $ANTHROPIC_API_KEY" \
366 -H "anthropic-version: 2023-06-01" \
367 -H "content-type: application/json" \
368 -d '{
369 "model": "claude-sonnet-5-5",
370 "max_tokens": 16000,
371 "thinking": {"type": "between_tools"},
372 "output_config": {"effort": "high"},
373 "messages": [{"role": "user", "content": "..."}]
374 }'
375 ```
376 
377 ```bash CLI
378 ant messages create \
379 --model claude-sonnet-5-5 \
380 --max-tokens 16000 \
381 --thinking '{type: between_tools}' \
382 --output-config '{effort: high}' \
383 --message '{role: user, content: "..."}'
384 ```
385 
386 ```python Python
387 client.messages.create(
388 model="claude-sonnet-5-5",
389 max_tokens=16000,
390 thinking={"type": "between_tools"},
391 output_config={"effort": "high"},
392 messages=[{"role": "user", "content": "..."}],
393 )
394 ```
395 
396 ```typescript TypeScript
397 await client.messages.create({
398 model: "claude-sonnet-5-5",
399 max_tokens: 16000,
400 thinking: { type: "between_tools" },
401 output_config: { effort: "high" },
402 messages: [{ role: "user", content: "..." }]
403 });
404 ```
405 
406 ```csharp C#
407 await client.Messages.Create(new MessageCreateParams
408 {
409 Model = Model.ClaudeSonnet5_5,
410 MaxTokens = 16000,
411 Thinking = new ThinkingConfigBetweenTools(),
412 OutputConfig = new() { Effort = Effort.High },
413 Messages = [new() { Role = Role.User, Content = "..." }],
414 });
415 ```
416 
417 ```go Go
418 client.Messages.New(context.TODO(), anthropic.MessageNewParams{
419 Model: anthropic.ModelClaudeSonnet5_5,
420 MaxTokens: 16000,
421 Thinking: anthropic.ThinkingConfigParamUnion{
422 OfBetweenTools: &anthropic.ThinkingConfigBetweenToolsParam{},
423 },
424 OutputConfig: anthropic.OutputConfigParam{
425 Effort: anthropic.OutputConfigEffortHigh,
426 },
427 Messages: []anthropic.MessageParam{
428 anthropic.NewUserMessage(anthropic.NewTextBlock("...")),
429 },
430 })
431 ```
432 
433 ```java Java
434 MessageCreateParams params = MessageCreateParams.builder()
435 .model(Model.CLAUDE_SONNET_5_5)
436 .maxTokens(16000L)
437 .thinking(ThinkingConfigBetweenTools.builder().build())
438 .outputConfig(OutputConfig.builder()
439 .effort(OutputConfig.Effort.HIGH)
440 .build())
441 .addUserMessage("...")
442 .build();
443 
444 client.messages().create(params);
445 ```
446 
447 ```php PHP
448 $client->messages->create(
449 model: Model::CLAUDE_SONNET_5_5,
450 maxTokens: 16000,
451 thinking: ThinkingConfigBetweenTools::with(),
452 outputConfig: OutputConfig::with(effort: Effort::HIGH),
453 messages: [['role' => 'user', 'content' => '...']],
454 );
455 ```
456 
457 ```ruby Ruby
458 client.messages.create(
459 model: Anthropic::Model::CLAUDE_SONNET_5_5,
460 max_tokens: 16000,
461 thinking: Anthropic::ThinkingConfigBetweenTools.new,
462 output_config: { effort: Anthropic::OutputConfig::Effort::HIGH },
463 messages: [{ role: "user", content: "..." }]
464 )
465 ```
466</CodeGroup>
467 
468## Migration checklist by starting model
469 
470Work down the groups and stop after the one that names your model. On Claude Haiku 4.5, apply every group except "Claude Sonnet 4 or earlier", ending with "Claude Haiku 4.5 only".
471 
472### Every starting model
473 
474* Change the model ID to `claude-sonnet-5-5`.
475* [Read content blocks by `type`](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#thinking-in-responses), and pass `thinking` blocks back unchanged.
476* To keep running without up-front thinking, send [the lowest thinking setting](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#turn-off-up-front-thinking) at `high` effort or below.
477* Replace [forced tool use](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#forced-tool-use) with `auto` and strict tools, or with `auto` alone on Amazon Bedrock.
478* Keep conversations [append-only](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#thinking-blocks).
479* On the Claude API and Google Cloud, move computer use to the [toolset](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#computer-use-toolset), without the `fine-grained-tool-streaming-2025-05-14` beta header.
480* Pair the [advisor tool](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#advisor-tool) with a supported advisor, and expect encrypted advice.
481* Read [text between tool calls](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#text-between-tool-calls) from `thinking` blocks.
482* [Handle refusals](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#safety-classifiers-and-fallback), and configure fallback.
483* [Re-run your effort sweep](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#recommended-changes), and re-baseline cost.
484 
485### Claude Sonnet 4.6 or earlier
486 
487* Expect [thinking on requests with no `thinking` field](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#thinking-on-by-default), and revisit `max_tokens`.
488* Replace [thinking budgets](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#sonnet-46-breaking-changes) with an effort level.
489* Remove non-default `temperature`, `top_p`, and `top_k` values.
490* If you [show thinking text](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#thinking-in-responses), set `display: "summarized"`.
491* [Recount tokens](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#other-changes-from-claude-sonnet-4-6), and re-budget image tokens.
492 
493### Claude Sonnet 4.5 or earlier
494 
495* Replace [assistant prefills](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-sonnet-45).
496* Parse tool call input with a standard JSON parser.
497* On Amazon Bedrock, move computer use from `computer_20250124` to [`computer_20251124`](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#computer-use-toolset).
498* Set `output_config.effort` explicitly.
499* Remove any context-window beta header.
500* Remove `interleaved-thinking-2025-05-14`, and replace `fine-grained-tool-streaming-2025-05-14` with `eager_input_streaming`.
501* Move `output_format` to `output_config.format`.
502 
503### Claude Sonnet 4 or earlier
504 
505* Update [tool versions](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-claude-sonnet-4-or-earlier) to `text_editor_20250728` and `code_execution_20260521`.
506* Handle the `refusal` and `model_context_window_exceeded` stop reasons.
507* Check tool string parameters for trailing newlines.
508* Remove `token-efficient-tools-2025-02-19` and `output-128k-2025-02-19`.
509* Review your prompts.
510 
511### Claude Haiku 4.5 only
512 
513* Replace [`claude-haiku-4-5-20251001`](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-claude-haiku-4-5) or its alias.
514* Re-baseline cost at the higher price per token.
515* Review prompts that were too short to cache on Claude Haiku 4.5.
516 
517## Migrating to Claude Sonnet 5.5 from Claude Sonnet 5
518 
519Every starting model needs the changes in this section. Replace your model ID with `claude-sonnet-5-5`, which has no date suffix. On other platforms, use the ID listed under [Availability](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#availability).
520 
521### Forced tool use is not supported
522 
523Every earlier model on this page accepts a `tool_choice` of type `any` or `tool`. Claude Sonnet 5.5 rejects both with a 400 error, including on the [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) endpoint:
524 
525```text wrap
526tool_choice: type "tool" and "any" are not supported for this model.
527```
528 
529Send `tool_choice: {"type": "auto"}`, and mark the tool `strict: true` so its input matches the schema. The model can then answer without calling the tool, so say in the prompt when to use it. [Strict tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use) supports a subset of JSON Schema and needs `additionalProperties: false` on every object. See [JSON Schema limitations](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#json-schema-limitations). On Amazon Bedrock, [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), which include strict tool use, aren't available for Claude Sonnet 5.5. There, send `auto` without `strict`, say in the prompt when to call the tool, and validate the tool input in your code.
530 
531Before (Claude Sonnet 5):
532 
533<CodeGroup>
534 ```bash cURL
535 curl https://api.anthropic.com/v1/messages \
536 -H "x-api-key: $ANTHROPIC_API_KEY" \
537 -H "anthropic-version: 2023-06-01" \
538 -H "content-type: application/json" \
539 -d '{
540 "model": "claude-sonnet-5",
541 "max_tokens": 1024,
542 "tools": [{
543 "name": "get_weather",
544 "description": "Get the current weather in a given location",
545 "input_schema": {
546 "type": "object",
547 "properties": {
548 "location": {
549 "type": "string",
550 "description": "The city and state, e.g. San Francisco, CA"
551 }
552 },
553 "required": ["location"],
554 "additionalProperties": false
555 }
556 }],
557 "tool_choice": {"type": "tool", "name": "get_weather"},
558 "messages": [{"role": "user", "content": "What'\''s the weather in Paris?"}]
559 }'
560 ```
561 
562 ```bash CLI
563 ant messages create <<'YAML'
564 model: claude-sonnet-5
565 max_tokens: 1024
566 tools:
567 - name: get_weather
568 description: Get the current weather in a given location
569 input_schema:
570 type: object
571 properties:
572 location:
573 type: string
574 description: The city and state, e.g. San Francisco, CA
575 required: [location]
576 additionalProperties: false
577 tool_choice:
578 type: tool
579 name: get_weather
580 messages:
581 - role: user
582 content: What's the weather in Paris?
583 YAML
584 ```
585 
586 ```python Python
587 client.messages.create(
588 model="claude-sonnet-5",
589 max_tokens=1024,
590 tools=tools,
591 tool_choice={"type": "tool", "name": "get_weather"},
592 messages=[{"role": "user", "content": "What's the weather in Paris?"}],
593 )
594 ```
595 
596 ```typescript TypeScript
597 await client.messages.create({
598 model: "claude-sonnet-5",
599 max_tokens: 1024,
600 tools,
601 tool_choice: { type: "tool", name: "get_weather" },
602 messages: [{ role: "user", content: "What's the weather in Paris?" }]
603 });
604 ```
605 
606 ```csharp C#
607 await client.Messages.Create(new MessageCreateParams
608 {
609 Model = Model.ClaudeSonnet5,
610 MaxTokens = 1024,
611 Tools = [.. tools],
612 ToolChoice = new ToolChoiceTool { Name = "get_weather" },
613 Messages = [new() { Role = Role.User, Content = "What's the weather in Paris?" }],
614 });
615 ```
616 
617 ```go Go
618 client.Messages.New(context.TODO(), anthropic.MessageNewParams{
619 Model: anthropic.ModelClaudeSonnet5,
620 MaxTokens: 1024,
621 Tools: tools,
622 ToolChoice: anthropic.ToolChoiceParamOfTool("get_weather"),
623 Messages: []anthropic.MessageParam{
624 anthropic.NewUserMessage(anthropic.NewTextBlock("What's the weather in Paris?")),
625 },
626 })
627 ```
628 
629 ```java Java
630 MessageCreateParams params = MessageCreateParams.builder()
631 .model(Model.CLAUDE_SONNET_5)
632 .maxTokens(1024L)
633 .tools(tools)
634 .toolChoice(ToolChoiceTool.of("get_weather"))
635 .addUserMessage("What's the weather in Paris?")
636 .build();
637 
638 client.messages().create(params);
639 ```
640 
641 ```php PHP
642 $client->messages->create(
643 model: Model::CLAUDE_SONNET_5,
644 maxTokens: 1024,
645 tools: $tools,
646 toolChoice: ToolChoiceTool::with(name: 'get_weather'),
647 messages: [['role' => 'user', 'content' => "What's the weather in Paris?"]],
648 );
649 ```
650 
651 ```ruby Ruby
652 client.messages.create(
653 model: Anthropic::Model::CLAUDE_SONNET_5,
654 max_tokens: 1024,
655 tools: tools,
656 tool_choice: Anthropic::ToolChoiceTool.new(name: "get_weather"),
657 messages: [{ role: "user", content: "What's the weather in Paris?" }]
658 )
659 ```
660</CodeGroup>
661 
662After (Claude Sonnet 5.5):
663 
664<CodeGroup>
665 ```bash cURL
666 # strict tool use: every call matches the tool's input_schema
667 curl https://api.anthropic.com/v1/messages \
668 -H "x-api-key: $ANTHROPIC_API_KEY" \
669 -H "anthropic-version: 2023-06-01" \
670 -H "content-type: application/json" \
671 -d '{
672 "model": "claude-sonnet-5-5",
673 "max_tokens": 1024,
674 "tools": [{
675 "name": "get_weather",
676 "description": "Get the current weather in a given location",
677 "input_schema": {
678 "type": "object",
679 "properties": {
680 "location": {
681 "type": "string",
682 "description": "The city and state, e.g. San Francisco, CA"
683 }
684 },
685 "required": ["location"],
686 "additionalProperties": false
687 },
688 "strict": true
689 }],
690 "tool_choice": {"type": "auto"},
691 "messages": [{
692 "role": "user",
693 "content": "What'\''s the weather in Paris? Use the get_weather tool."
694 }]
695 }'
696 ```
697 
698 ```bash CLI
699 ant messages create <<'YAML'
700 model: claude-sonnet-5-5
701 max_tokens: 1024
702 tools:
703 - name: get_weather
704 description: Get the current weather in a given location
705 input_schema:
706 type: object
707 properties:
708 location:
709 type: string
710 description: The city and state, e.g. San Francisco, CA
711 required: [location]
712 additionalProperties: false
713 # strict tool use: every call matches the tool's input_schema
714 strict: true
715 tool_choice:
716 type: auto
717 messages:
718 - role: user
719 content: What's the weather in Paris? Use the get_weather tool.
720 YAML
721 ```
722 
723 ```python Python
724 client.messages.create(
725 model="claude-sonnet-5-5",
726 max_tokens=1024,
727 # strict tool use: every call matches the tool's input_schema
728 tools=[{**tool, "strict": True} for tool in tools],
729 tool_choice={"type": "auto"},
730 messages=[
731 {
732 "role": "user",
733 "content": "What's the weather in Paris? Use the get_weather tool.",
734 }
735 ],
736 )
737 ```
738 
739 ```typescript TypeScript
740 await client.messages.create({
741 model: "claude-sonnet-5-5",
742 max_tokens: 1024,
743 // strict tool use: every call matches the tool's input_schema
744 tools: tools.map((tool) => ({ ...tool, strict: true })),
745 tool_choice: { type: "auto" },
746 messages: [
747 {
748 role: "user",
749 content: "What's the weather in Paris? Use the get_weather tool."
750 }
751 ]
752 });
753 ```
754 
755 ```csharp C#
756 await client.Messages.Create(new MessageCreateParams
757 {
758 Model = Model.ClaudeSonnet5_5,
759 MaxTokens = 1024,
760 // strict tool use: every call matches the tool's input_schema
761 Tools = [.. tools.Select(tool => tool with { Strict = true })],
762 ToolChoice = new ToolChoiceAuto(),
763 Messages =
764 [
765 new()
766 {
767 Role = Role.User,
768 Content = "What's the weather in Paris? Use the get_weather tool.",
769 },
770 ],
771 });
772 ```
773 
774 ```go Go
775 // strict tool use: every call matches the tool's input_schema
776 var strictTools []anthropic.ToolUnionParam
777 for _, tool := range tools {
778 strictTool := *tool.OfTool
779 strictTool.Strict = anthropic.Bool(true)
780 strictTools = append(strictTools, anthropic.ToolUnionParam{OfTool: &strictTool})
781 }
782 client.Messages.New(context.TODO(), anthropic.MessageNewParams{
783 Model: anthropic.ModelClaudeSonnet5_5,
784 MaxTokens: 1024,
785 Tools: strictTools,
786 ToolChoice: anthropic.ToolChoiceUnionParam{OfAuto: &anthropic.ToolChoiceAutoParam{}},
787 Messages: []anthropic.MessageParam{
788 anthropic.NewUserMessage(
789 anthropic.NewTextBlock("What's the weather in Paris? Use the get_weather tool."),
790 ),
791 },
792 })
793 ```
794 
795 ```java Java
796 MessageCreateParams params = MessageCreateParams.builder()
797 .model(Model.CLAUDE_SONNET_5_5)
798 .maxTokens(1024L)
799 // strict tool use: every call matches the tool's input_schema
800 .tools(tools.stream()
801 .map(tool -> tool.tool()
802 .map(customTool -> customTool.toBuilder().strict(true).build())
803 .map(ToolUnion::ofTool)
804 .orElse(tool))
805 .toList())
806 .toolChoice(ToolChoiceAuto.builder().build())
807 .addUserMessage("What's the weather in Paris? Use the get_weather tool.")
808 .build();
809 
810 client.messages().create(params);
811 ```
812 
813 ```php PHP
814 $client->messages->create(
815 model: Model::CLAUDE_SONNET_5_5,
816 maxTokens: 1024,
817 // strict tool use: every call matches the tool's input_schema
818 tools: array_map(fn (Tool $tool) => $tool->withStrict(true), $tools),
819 toolChoice: ToolChoiceAuto::with(),
820 messages: [
821 [
822 'role' => 'user',
823 'content' => "What's the weather in Paris? Use the get_weather tool.",
824 ],
825 ],
826 );
827 ```
828 
829 ```ruby Ruby
830 client.messages.create(
831 model: Anthropic::Model::CLAUDE_SONNET_5_5,
832 max_tokens: 1024,
833 # strict tool use: every call matches the tool's input_schema
834 tools: tools.map { |tool| tool.merge(strict: true) },
835 tool_choice: Anthropic::ToolChoiceAuto.new,
836 messages: [
837 { role: "user", content: "What's the weather in Paris? Use the get_weather tool." }
838 ]
839 )
840 ```
841</CodeGroup>
842 
843The example marks every tool in the list strict. A request can have at most 20 strict tools, and the MCP, computer use, and browser use toolset entries don't accept `strict`. In a longer tools list, mark only the tools that need it.
844 
845### Thinking blocks are tied to the model and the conversation
846 
847Claude Sonnet 5.5 reads thinking blocks from Claude Sonnet 5, Claude Opus 4.8, Claude Haiku 4.5, and earlier models. It doesn't read blocks from Claude Opus 5, Claude Opus 5.5, or any Claude Fable or Claude Mythos model. The API drops blocks the model can't read. The request still returns 200, and dropped blocks aren't billed. See [Switching models mid-conversation](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#switching-models).
848 
849Each Claude Sonnet 5.5 thinking block is also signed over the conversation before it. For accounts created on or after August 31, 2026, 00:00 UTC, the API enforces this by default, on the Claude API, Amazon Bedrock, and Google Cloud. On those accounts, a request that replays a block after an edit to earlier history returns a 400 error. Keep conversations append-only, and change instructions or tools with [mid-conversation system messages](https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages). Thinking blocks that Claude Sonnet 5.5 produces work only in the account that produced them, or in an account linked to it. See [Preserved thinking](https://platform.claude.com/docs/en/build-with-claude/preserved-thinking#account-bound-thinking).
850 
851### Computer use needs the toolset on the Claude API and Google Cloud
852 
853On the Claude API and Google Cloud, Claude Sonnet 5.5 supports computer use only through the `computer_toolset_20260801` toolset. There, `computer_20251124` returns a 400 error. Claude Sonnet 5.5 doesn't accept `computer_20250124` on any platform. Find the version you send today:
854 
855| Version you send today | Starting models that send it | Send on the Claude API and Google Cloud | Send on Amazon Bedrock |
856| ---------------------- | ---------------------------------------------------- | --------------------------------------- | ---------------------- |
857| `computer_20251124` | Claude Sonnet 5, Claude Sonnet 4.6 | `computer_toolset_20260801` | `computer_20251124` |
858| `computer_20250124` | Claude Sonnet 4.5, Claude Haiku 4.5, Claude Sonnet 4 | `computer_toolset_20260801` | `computer_20251124` |
859 
860If you send the `fine-grained-tool-streaming-2025-05-14` beta header, remove it when you move to the toolset. Alongside a toolset entry, it returns a 400 error. Set `eager_input_streaming: true` on each tool that needs it instead.
861 
862Code that already sends the toolset needs no change. [Migrate from `computer_20251124`](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool#migrate-from-computer-20251124) lists the request and agent-loop changes. For other platforms, see [Compatibility](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool#compatibility).
863 
864### The advisor tool accepts fewer advisors
865 
866With the [advisor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool), a Claude Sonnet 5.5 executor needs one of these advisors: Claude Opus 5, Claude Opus 5.5, Claude Sonnet 5.5, Claude Fable 5, Claude Fable 5.1, Claude Mythos 5, or Claude Mythos 5.1. Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, Claude Sonnet 5, and Claude Sonnet 4.6 advisors return a 400 error. The advice comes back encrypted as an `advisor_redacted_result` block, so its text isn't readable in the response. See [Model compatibility](https://platform.claude.com/docs/en/agents-and-tools/tool-use/advisor-tool#model-compatibility).
867 
868### Text between tool calls is returned in thinking blocks
869 
870On Claude Sonnet 5.5, notes longer than a sentence or two that the model writes between tool calls come back as [progress-update `thinking` blocks](https://platform.claude.com/docs/en/build-with-claude/thinking#progress-updates), empty at the default `display`. Shorter remarks stay `text`. On Claude Sonnet 5 and earlier models, all text between tool calls comes back as `text` blocks. No request fails, but an interface that shows those notes goes quiet.
871 
872With adaptive thinking, set `display` to `"updates"` (beta, `thinking-display-updates-2026-08-18` header) to get the updates alone, or to `"summarized"` to get them mixed with reasoning. Render each non-empty `thinking` block before the `tool_use` block that follows it. With [`between_tools`](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#turn-off-up-front-thinking), the text comes back without `display`. See [User-facing progress updates](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5#user-facing-progress-updates).
873 
874### Safety classifiers and fallback
875 
876Claude Sonnet 5.5 declines in more categories than Claude Sonnet 5. A decline returns `stop_reason: "refusal"`, and its `stop_details` can name one of these [categories](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#refusal-response):
877 
878* **`"cyber"`:** The request could enable cyber harm, such as malware or exploit development.
879* **`"bio"`:** The request could enable biological harm, such as dangerous lab methods.
880* **`"frontier_llm"`:** The request could assist the development of competing AI models.
881* **`"reasoning_extraction"`:** The request asks the model to reproduce its internal reasoning in the response text.
882* **`"general_harms"`:** The request falls under another usage-policy area. Benign work can also trigger this category.
883 
884[Server-side fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback) (`fallbacks: "default"`, beta, Claude API only) retries `"cyber"` and `"frontier_llm"` declines on Claude Sonnet 5. It doesn't retry `"bio"`, `"reasoning_extraction"`, or `"general_harms"` declines. See [Refusals and fallback](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback) and [How refusals are billed](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#how-refusals-are-billed).
885 
886Real-time cyber safeguards are new for code from Claude Sonnet 4.6, Claude Sonnet 4.5, and Claude Haiku 4.5. For legitimate security work, apply to the [Cyber Verification Program](https://support.claude.com/en/articles/14604842-real-time-cyber-safeguards-on-claude-opus-and-sonnet).
887 
888### Other changes
889 
890* **Prompt caching:** The minimum cacheable prompt is 512 tokens, down from 1,024 on Claude Sonnet 5, Claude Sonnet 4.6, and Claude Sonnet 4.5. See [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching#cache-limitations).
891* **New features:** For mid-conversation system messages, mid-conversation tool changes, and per-message effort, see [What's new in Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5#feature-support). With [`between_tools`](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#turn-off-up-front-thinking), effort can't change mid-conversation.
892 
893### Recommended changes
894 
895Re-run your effort sweep. Claude Sonnet 5.5 has five effort levels: `low`, `medium`, `high`, `xhigh`, and `max`. The default on the Claude API is `high`. The levels are recalibrated, so a level doesn't produce the same amount of thinking as on Claude Sonnet 5. Start at `high` unless your workload is agentic or latency-sensitive. For agentic coding and multistep tool use, start at `medium` for well-specified tasks and move to `high` for harder or longer ones. For chat and other latency-sensitive work, start at `medium` or `low`. Set the level in `output_config.effort`. See [Recommended effort levels for Claude Sonnet 5.5](https://platform.claude.com/docs/en/build-with-claude/effort#recommended-effort-levels-for-claude-sonnet-5-5). Then re-evaluate model-specific prompt instructions against [Prompting Claude Sonnet 5.5](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5-5).
896 
897## Migrating to Claude Sonnet 5.5 from Claude Sonnet 4.6 and earlier Sonnet models
898 
899First apply every preceding section, replacing `claude-sonnet-4-6`. Then make these changes. On Claude Sonnet 4.5 or earlier, continue with the subsections that follow.
578900 
579901### Breaking changes
580902 
581#### When migrating from Sonnet 4.5
582 
5831. **Prefilling assistant messages is no longer supported**
584 
585 <Warning>
586 This is a breaking change when migrating from Sonnet 4.5 or earlier.
587 </Warning>
588 
589 Prefilling assistant messages returns a `400` error on Claude Sonnet 4.6 and later models, including Claude Sonnet 5. Use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), system prompt instructions, or `output_config.format` instead.
590 
591 **Common prefill use cases and migrations:**
592 
593 * **Controlling output formatting** (forcing JSON/YAML output): Use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs) or tools with enum fields for classification tasks.
594 
595 * **Eliminating preambles** (removing "Here is..." phrases): Add direct instructions in the system prompt: "Respond directly without preamble. Do not start with phrases like 'Here is...', 'Based on...', etc."
596 
597 * **Avoiding bad refusals:** Claude is much better at appropriate refusals now. Clear prompting in the user message without prefill should be sufficient.
598 
599 * **Continuations** (resuming interrupted responses): Move the continuation to the user message: "Your previous response was interrupted and ended with `[previous_response]`. Continue from where you left off."
600 
601 * **Context hydration / role consistency** (refreshing context in long conversations): Inject what were previously prefilled-assistant reminders into the user turn instead.
602 
6032. **Tool parameter JSON escaping may differ**
604 
605 <Warning>
606 This is a breaking change when migrating from Sonnet 4.5 or earlier.
607 </Warning>
608 
609 JSON string escaping in tool parameters may differ from previous models. Standard JSON parsers handle this automatically, but custom string-based parsing may need updates.
610 
611**Extended thinking changes:** `budget_tokens` configurations from Claude Sonnet 4.5 (`thinking: {type: "enabled", budget_tokens: N}`) are not supported on Claude Sonnet 5 and return a 400 error. Adaptive thinking is on by default, so most workloads need no `thinking` configuration at all; use the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) to control thinking depth. If you ran Claude Sonnet 4.5 without extended thinking, pass `thinking: {type: "disabled"}` to preserve that behavior.
612 
613#### When migrating from Claude 3.x
614 
6153. **Remove sampling parameters**
616 
617 <Warning>
618 This is a breaking change when migrating from Claude 3.x models.
619 </Warning>
620 
621 Sampling parameters (`temperature`, `top_p`, `top_k`) set to a non-default value return a 400 error on Claude Sonnet 5. Remove them from requests, and use prompting to guide the model's behavior instead.
622 
6234. **Update tool versions**
624 
625 <Warning>
626 This is a breaking change when migrating from Claude 3.x models.
627 </Warning>
628 
629 Update to the latest tool versions (`text_editor_20250728`, `code_execution_20260521`). Remove any code using the `undo_edit` command.
630 
6315. **Handle the `refusal` stop reason**
632 
633 Update your application to [handle `refusal` stop reasons](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/handle-streaming-refusals).
634 
6356. **Update your prompts for behavioral changes**
636 
637 Claude 4 models have a more concise, direct communication style. Review [prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) for optimization guidance.
638 
639## Migrating to Claude Sonnet 5 from Claude Haiku 4.5
640 
641Claude Haiku 4.5 and Claude Sonnet 5 differ more at the API level than adjacent models within one class: Claude Haiku 4.5 uses manual [extended thinking](https://platform.claude.com/docs/en/build-with-claude/extended-thinking) (off by default), a 200k token context window, and up to 64k output tokens, while Claude Sonnet 5 runs with [adaptive thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) on by default, serves a [1M token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) by default, and supports up to [128k output tokens](https://platform.claude.com/docs/en/models/overview).
642 
643### Update your model name
644 
645```python
646model = "claude-haiku-4-5-20251001" # Before
647model = "claude-sonnet-5" # After
903**Thinking runs on requests that omitted it.** See [Thinking runs by default](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#thinking-on-by-default) and [Turn off up-front thinking](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#turn-off-up-front-thinking).
904 
905**Thinking budgets return an error.** Claude Sonnet 4.6 accepts `thinking: {"type": "enabled", "budget_tokens": N}` as a deprecated setting. Claude Sonnet 4.5 and Claude Haiku 4.5 use it for all thinking. Claude Sonnet 5.5 returns a 400 error:
906 
907```text wrap
908"thinking.type.enabled" is not supported for this model. Use "thinking.type.adaptive" and "output_config.effort" to control thinking behavior.
648909```
649910 
650### What changed
651 
6521. **Thinking configuration:** Claude Haiku 4.5 supports manual extended thinking (`thinking: {type: "enabled", budget_tokens: N}`) and rejects `thinking: {type: "adaptive"}`. On Claude Sonnet 5, the support is reversed: adaptive thinking is on by default, and manual extended thinking returns a 400 error. Remove `thinking: {type: "enabled", budget_tokens: N}` configurations and rely on the default, or pass `thinking: {type: "disabled"}` to turn thinking off. `budget_tokens` has no direct replacement; use the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) to control thinking depth. Effort is not available on Claude Haiku 4.5 and defaults to `high` on Claude Sonnet 5.
653 
654 The response shape changes for both kinds of Claude Haiku 4.5 request. Requests that ran without extended thinking can now return one or more `thinking` blocks before the first `text` block, so code that reads the reply by position, such as `content[0].text`, must select content blocks by their `type` field instead, and tool-use loops must pass `thinking` blocks back complete and unmodified with their tool results (see [Preserving thinking blocks](https://platform.claude.com/docs/en/build-with-claude/thinking#preserving-thinking-blocks)). Requests that used extended thinking keep receiving `thinking` blocks, but `thinking.display` defaults to `"omitted"` on Claude Sonnet 5 rather than `"summarized"`, so those blocks arrive with an empty `thinking` field; set `display: "summarized"` to keep receiving readable summaries (see [Controlling thinking display](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display)). Thinking tokens are billed as output tokens even when the thinking text is not returned.
655 
6562. **Sampling parameters removed:** `temperature` and `top_p` work on Claude Haiku 4.5 (one at a time, not both). On Claude Sonnet 5, setting `temperature`, `top_p`, or `top_k` to a non-default value returns a 400 error. Remove these parameters and use prompting to guide the model's behavior.
657 
6583. **Assistant prefill removed:** Prefilling the assistant message works on Claude Haiku 4.5 but returns a 400 error on Claude Sonnet 5. Use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), system prompt instructions, or `output_config.format` instead.
659 
6604. **Larger context window and output:** Claude Sonnet 5 serves a 1M token context window by default, up from 200k tokens on Claude Haiku 4.5, and supports up to 128k output tokens, up from 64k. Claude Sonnet 5 also uses a different tokenizer, so re-run [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) rather than reusing counts measured against Claude Haiku 4.5.
661 
6625. **Pricing:** Claude Haiku 4.5 is priced at $1/$5 USD per million input/output tokens. Claude Sonnet 5 is priced at $2/$10 USD per million input/output tokens. See [Claude pricing](https://platform.claude.com/docs/en/about-claude/pricing).
663 
6646. **Cybersecurity safeguards:** Claude Sonnet 5 has real-time cybersecurity safeguards. Requests that involve prohibited or high-risk cybersecurity topics may be refused, returned as a successful HTTP 200 response with `stop_reason: "refusal"`. 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.
665 
666### Migration checklist
667 
668* Update the model name from `claude-haiku-4-5-20251001` (or the `claude-haiku-4-5` alias) to `claude-sonnet-5`.
669* Remove `thinking: {type: "enabled", budget_tokens: N}` configuration (returns a 400 error). Adaptive thinking is on by default; pass `thinking: {type: "disabled"}` to preserve no-thinking behavior, and revisit `max_tokens` for workloads that ran without thinking.
670* Update response parsing that reads content by position, such as `content[0].text`: with thinking on, `thinking` blocks arrive before `text` blocks. Select content blocks by `type` instead, and pass `thinking` blocks back unmodified in tool-use loops; modified blocks return a 400 error.
671* If your UI displays thinking content, set `display: "summarized"`. `thinking.display` defaults to `"omitted"` on Claude Sonnet 5, so thinking blocks otherwise arrive with an empty `thinking` field. See [Controlling thinking display](https://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display).
672* Use the [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) (default `high`) to control thinking depth and token spend; it is not available on Claude Haiku 4.5, so no existing setting carries over.
673* Remove `temperature` and `top_p` settings (non-default values return a 400 error on Claude Sonnet 5).
674* Remove any assistant-message prefills (they return a 400 error on Claude Sonnet 5).
675* Re-run [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting) against Claude Sonnet 5, and revisit `max_tokens` limits, which you can raise up to the 128k maximum.
676* Add handling for `stop_reason: "refusal"` if your workload may touch cybersecurity topics.
677* Re-baseline cost on your typical workload before production deployment; per-token pricing differs.
911Remove the budget and set an [effort](https://platform.claude.com/docs/en/build-with-claude/effort) level. There's no fixed mapping from a budget to an effort level, so run your evaluations at two or three levels.
912 
913Before (Claude Sonnet 4.6):
914 
915<CodeGroup>
916 ```bash cURL
917 curl https://api.anthropic.com/v1/messages \
918 -H "x-api-key: $ANTHROPIC_API_KEY" \
919 -H "anthropic-version: 2023-06-01" \
920 -H "content-type: application/json" \
921 -d '{
922 "model": "claude-sonnet-4-6",
923 "max_tokens": 16000,
924 "thinking": {
925 "type": "enabled",
926 "budget_tokens": 10000
927 },
928 "messages": [
929 {
930 "role": "user",
931 "content": "..."
932 }
933 ]
934 }'
935 ```
936 
937 ```bash CLI
938 ant messages create <<'YAML'
939 model: claude-sonnet-4-6
940 max_tokens: 16000
941 thinking:
942 type: enabled
943 budget_tokens: 10000
944 messages:
945 - role: user
946 content: "..."
947 YAML
948 ```
949 
950 ```python Python
951 client.messages.create(
952 model="claude-sonnet-4-6",
953 max_tokens=16000,
954 thinking={"type": "enabled", "budget_tokens": 10000},
955 messages=[{"role": "user", "content": "..."}],
956 )
957 ```
958 
959 ```typescript TypeScript
960 await client.messages.create({
961 model: "claude-sonnet-4-6",
962 max_tokens: 16000,
963 thinking: { type: "enabled", budget_tokens: 10000 },
964 messages: [{ role: "user", content: "..." }]
965 });
966 ```
967 
968 ```csharp C#
969 using Anthropic;
970 using Anthropic.Models.Messages;
971 
972 AnthropicClient client = new();
973 
974 var parameters = new MessageCreateParams
975 {
976 Model = "claude-sonnet-4-6",
977 MaxTokens = 16000,
978 Thinking = new ThinkingConfigEnabled(budgetTokens: 10000),
979 Messages = [new() { Role = Role.User, Content = "..." }]
980 };
981 
982 var response = await client.Messages.Create(parameters);
983 Console.WriteLine(response);
984 ```
985 
986 ```go Go
987 client := anthropic.NewClient()
988 
989 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
990 Model: "claude-sonnet-4-6",
991 MaxTokens: 16000,
992 Thinking: anthropic.ThinkingConfigParamOfEnabled(10000),
993 Messages: []anthropic.MessageParam{
994 anthropic.NewUserMessage(anthropic.NewTextBlock("...")),
995 },
996 })
997 if err != nil {
998 log.Fatal(err)
999 }
1000 fmt.Println(response)
1001 ```
1002 
1003 ```java Java
1004 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1005 
1006 MessageCreateParams params = MessageCreateParams.builder()
1007 .model("claude-sonnet-4-6")
1008 .maxTokens(16000L)
1009 .enabledThinking(10000L)
1010 .addUserMessage("...")
1011 .build();
1012 
1013 Message response = client.messages().create(params);
1014 IO.println(response);
1015 ```
1016 
1017 ```php PHP
1018 $client = new Client();
1019 
1020 $message = $client->messages->create(
1021 maxTokens: 16000,
1022 messages: [['role' => 'user', 'content' => '...']],
1023 model: 'claude-sonnet-4-6',
1024 thinking: ['type' => 'enabled', 'budget_tokens' => 10000],
1025 );
1026 ```
1027 
1028 ```ruby Ruby
1029 client = Anthropic::Client.new
1030 
1031 message = client.messages.create(
1032 model: "claude-sonnet-4-6",
1033 max_tokens: 16000,
1034 thinking: {
1035 type: "enabled",
1036 budget_tokens: 10000
1037 },
1038 messages: [
1039 { role: "user", content: "..." }
1040 ]
1041 )
1042 ```
1043</CodeGroup>
1044 
1045After (Claude Sonnet 5.5):
1046 
1047<CodeGroup>
1048 ```bash cURL
1049 curl https://api.anthropic.com/v1/messages \
1050 -H "x-api-key: $ANTHROPIC_API_KEY" \
1051 -H "anthropic-version: 2023-06-01" \
1052 -H "content-type: application/json" \
1053 -d '{
1054 "model": "claude-sonnet-5-5",
1055 "max_tokens": 16000,
1056 "thinking": {
1057 "type": "adaptive"
1058 },
1059 "output_config": {
1060 "effort": "high"
1061 },
1062 "messages": [
1063 {
1064 "role": "user",
1065 "content": "..."
1066 }
1067 ]
1068 }'
1069 ```
1070 
1071 ```bash CLI
1072 ant messages create <<'YAML'
1073 model: claude-sonnet-5-5
1074 max_tokens: 16000
1075 thinking:
1076 type: adaptive
1077 output_config:
1078 effort: high
1079 messages:
1080 - role: user
1081 content: "..."
1082 YAML
1083 ```
1084 
1085 ```python Python
1086 client.messages.create(
1087 model="claude-sonnet-5-5",
1088 max_tokens=16000,
1089 thinking={"type": "adaptive"},
1090 output_config={"effort": "high"}, # or "max", "xhigh", "medium", "low"
1091 messages=[{"role": "user", "content": "..."}],
1092 )
1093 ```
1094 
1095 ```typescript TypeScript
1096 await client.messages.create({
1097 model: "claude-sonnet-5-5",
1098 max_tokens: 16000,
1099 thinking: { type: "adaptive" },
1100 output_config: { effort: "high" }, // or "max", "xhigh", "medium", "low"
1101 messages: [{ role: "user", content: "..." }]
1102 });
1103 ```
1104 
1105 ```csharp C#
1106 using Anthropic;
1107 using Anthropic.Models.Messages;
1108 
1109 AnthropicClient client = new();
1110 
1111 var parameters = new MessageCreateParams
1112 {
1113 Model = "claude-sonnet-5-5",
1114 MaxTokens = 16000,
1115 Thinking = new ThinkingConfigAdaptive(),
1116 OutputConfig = new OutputConfig { Effort = Effort.High }, // or Max, Xhigh, Medium, Low
1117 Messages = [new() { Role = Role.User, Content = "..." }]
1118 };
1119 
1120 var response = await client.Messages.Create(parameters);
1121 Console.WriteLine(response);
1122 ```
1123 
1124 ```go Go
1125 client := anthropic.NewClient()
1126 
1127 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
1128 Model: "claude-sonnet-5-5",
1129 MaxTokens: 16000,
1130 Thinking: anthropic.ThinkingConfigParamUnion{
1131 OfAdaptive: &anthropic.ThinkingConfigAdaptiveParam{},
1132 },
1133 OutputConfig: anthropic.OutputConfigParam{
1134 Effort: anthropic.OutputConfigEffortHigh, // or Max, Xhigh, Medium, Low
1135 },
1136 Messages: []anthropic.MessageParam{
1137 anthropic.NewUserMessage(anthropic.NewTextBlock("...")),
1138 },
1139 })
1140 if err != nil {
1141 log.Fatal(err)
1142 }
1143 fmt.Println(response)
1144 ```
1145 
1146 ```java Java
1147 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
1148 
1149 MessageCreateParams params = MessageCreateParams.builder()
1150 .model("claude-sonnet-5-5")
1151 .maxTokens(16000L)
1152 .thinking(ThinkingConfigAdaptive.builder().build())
1153 .outputConfig(OutputConfig.builder()
1154 .effort(OutputConfig.Effort.HIGH) // or MAX, XHIGH, MEDIUM, LOW
1155 .build())
1156 .addUserMessage("...")
1157 .build();
1158 
1159 Message response = client.messages().create(params);
1160 IO.println(response);
1161 ```
1162 
1163 ```php PHP
1164 $client = new Client();
1165 
1166 $message = $client->messages->create(
1167 maxTokens: 16000,
1168 messages: [['role' => 'user', 'content' => '...']],
1169 model: 'claude-sonnet-5-5',
1170 thinking: ['type' => 'adaptive'],
1171 outputConfig: ['effort' => 'high'], // or 'max', 'xhigh', 'medium', 'low'
1172 );
1173 ```
1174 
1175 ```ruby Ruby
1176 client = Anthropic::Client.new
1177 
1178 message = client.messages.create(
1179 model: "claude-sonnet-5-5",
1180 max_tokens: 16000,
1181 thinking: {
1182 type: "adaptive"
1183 },
1184 output_config: {
1185 effort: "high" # or "max", "xhigh", "medium", "low"
1186 },
1187 messages: [
1188 { role: "user", content: "..." }
1189 ]
1190 )
1191 ```
1192</CodeGroup>
1193 
1194**Sampling parameters return an error.** Claude Sonnet 4.6 and earlier models and Claude Haiku 4.5 accept `temperature`, `top_p`, and `top_k`. On Claude Sonnet 5.5, a non-default value returns a 400 error. Remove them.
1195 
1196**Thinking text is omitted by default.** See [Handle thinking in responses](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#thinking-in-responses).
1197 
1198### Other changes
1199 
1200* **About 30% more tokens:** Claude Sonnet 5.5 uses Claude Sonnet 5's tokenizer. Against Claude Sonnet 4.6, Claude Sonnet 4.5, and Claude Haiku 4.5, the same text produces about 30% more tokens, depending on the content. Recount with [token counting](https://platform.claude.com/docs/en/build-with-claude/token-counting), and revisit `max_tokens` and cost.
1201* **Effort:** `xhigh` is new, and the levels are recalibrated. See [Recommended changes](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#recommended-changes).
1202* **Images:** Claude Sonnet 5.5 uses the high-resolution image tier, up to 2576 pixels on the long edge and 4,784 visual tokens per image. Claude Sonnet 4.6, Claude Sonnet 4.5, and Claude Haiku 4.5 stop at 1568 pixels and 1,568 tokens. A 2000×1500 image costs about 2.5 times as many tokens on Claude Sonnet 5.5. See [Resolution and token cost](https://platform.claude.com/docs/en/build-with-claude/vision#evaluate-image-size).
1203 
1204### Migrating from Claude Sonnet 4.5 or earlier
1205 
1206On Claude Sonnet 4.5, Claude Sonnet 4, or Claude 3.7 Sonnet, first apply every preceding section, then these changes.
1207 
1208**Prefill returns an error.** Claude Sonnet 5.5 rejects a prefilled last assistant turn with a 400 error, as Claude Sonnet 4.6 and Claude Sonnet 5 do. Claude Sonnet 4.5, Claude Haiku 4.5, and older models accept one. The error reads:
1209 
1210```text wrap
1211This model does not support assistant message prefill. The conversation must end with a user message.
1212```
1213 
1214Replace each prefill according to what it was for:
1215 
1216* **Output format:** use [structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs), or tools with enum fields for classification.
1217* **Preambles:** ask in the system prompt for a direct answer.
1218* **Unwanted refusals:** clear instructions in the user message are usually enough.
1219* **Continuations:** move them to the user message, for example "Your previous response was interrupted and ended with `[previous_response]`. Continue from where you left off."
1220* **Context reminders:** put them in the user turn.
1221 
1222**Tool input escaping.** Escaping in tool call arguments can differ. Parse `input` with a standard JSON parser.
1223 
1224**Computer use.** Claude Sonnet 5.5 doesn't accept `computer_20250124`. See the [computer use table](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#computer-use-toolset).
1225 
1226**Effort.** Claude Sonnet 4.5 has no effort parameter. Set an effort level explicitly, as [Recommended changes](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#recommended-changes) describes.
1227 
1228**Context and output.** Claude Sonnet 5.5 has a larger context window, with no beta header, and a higher output limit. See the [model page](https://platform.claude.com/docs/en/models/sonnet-5-5/overview). Remove any context-window beta header.
1229 
1230**Beta headers.** Remove `interleaved-thinking-2025-05-14`, since adaptive thinking interleaves automatically. Replace `fine-grained-tool-streaming-2025-05-14` with `eager_input_streaming: true` on each tool that needs it. That header returns a 400 error alongside a computer use or browser use toolset entry. See [Fine-grained tool streaming](https://platform.claude.com/docs/en/agents-and-tools/tool-use/fine-grained-tool-streaming).
1231 
1232**Structured outputs.** The `output_format` parameter is deprecated and will be removed in the future. To use it anyway, add the `structured-outputs-2025-11-13` beta header. Without it, the API returns a 400 error. Use `output_config.format` instead.
1233 
1234### Migrating from Claude Sonnet 4 or earlier
1235 
1236Claude Sonnet 4 is retired on the Claude API and still available on Amazon Bedrock and Google Cloud. Claude 3.7 Sonnet is retired. From either model, first apply every preceding section, then these changes:
1237 
1238* **Tool versions:** Use `text_editor_20250728`, with the tool name `str_replace_based_edit_tool` and no `undo_edit` command. Use `code_execution_20260521`. See the [text editor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/text-editor-tool) and the [code execution tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/code-execution-tool#upgrade-to-latest-tool-version).
1239* **Stop reasons:** Handle `refusal`. Claude 4.5 and later models also stop with `model_context_window_exceeded` at the context window limit. See [Handling stop reasons](https://platform.claude.com/docs/en/build-with-claude/handling-stop-reasons).
1240* **Trailing newlines:** Claude 4.5 and later models keep them in tool call string parameters.
1241* **Legacy beta headers:** Remove `token-efficient-tools-2025-02-19` and `output-128k-2025-02-19`.
1242* **Prompts:** Review them against [prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices).
1243 
1244## Migrating to Claude Sonnet 5.5 from Claude Haiku 4.5
1245 
1246First apply every section up to and including [Migrating from Claude Sonnet 4.5 or earlier](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-sonnet-45), skipping the Claude Sonnet 4 subsection. Then make these changes:
1247 
1248* **Model ID:** Replace `claude-haiku-4-5-20251001`, or the alias `claude-haiku-4-5`, with `claude-sonnet-5-5`.
1249* **Cost:** The price per token is higher, and the same text produces more tokens. Recount tokens and re-baseline cost. See [Claude pricing](https://platform.claude.com/docs/en/about-claude/pricing).
1250* **Prompt caching:** The minimum cacheable prompt drops from 4,096 tokens to the [Claude Sonnet 5.5 minimum](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#other-changes-from-claude-sonnet-5).
1251* **Interleaved thinking:** Adaptive thinking runs between tool calls automatically, with no beta header.
1252* **Routing:** Claude Sonnet 5.5 reads Claude Haiku 4.5 thinking blocks. A conversation that moves up keeps its reasoning. One that moves back down to Claude Haiku 4.5 drops Claude Sonnet 5.5's blocks.
6781253 

models/sonnet-5/overview Changed · +9 / -13 lines

## How it compares to the current lineup ## Overview ## How it compares

from line 1
11---
22title: Claude Sonnet 5
33url: https://platform.claude.com/docs/en/models/sonnet-5/overview
4description: "Claude Sonnet 5 reference: lifecycle status, model IDs on every platform, context window, output limits, pricing, and migration resources. Claude Sonnet 5.5 is the current Sonnet model."
4description: "Claude Sonnet 5 reference: lifecycle status, model IDs on every platform, context window, output limits, pricing, and migration resources. Claude Sonnet 5 is a legacy model; Claude Sonnet 5.5 is the current Sonnet model."
55---
66 
77**Legacy.** Released June 30, 2026.
88 
9The best combination of speed and intelligence
9Although Claude Sonnet 5 is still available, you should consider migrating to Claude Sonnet 5.5 for improved performance. [See Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) · [Migrate to Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-claude-sonnet-5)
1010 
11Although Claude Sonnet 5 is still available, you should consider migrating to Claude Sonnet 5.5 for improved performance. [See Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) · [Migrate to Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide)
12 
1311Model ID: `claude-sonnet-5`
1412 
1513Context window: 1M tokens · Max output: 128K tokens · Input pricing: $2 / MTok · Output pricing: $10 / MTok
1614 
17[Announcement](https://www.anthropic.com/news/claude-sonnet-5) · [What’s new](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5)
15[Announcement](https://www.anthropic.com/news/claude-sonnet-5)
1816 
19## Overview
17## How it compares to the current lineup
2018 
21Claude 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.
22 
23[What's new in Claude Sonnet 5](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5)
24 
25## How it compares
26 
2719| Model | Context | Max output | Price / MTok | Thinking | Default effort | Knowledge cutoff |
2820| :---------------------------------------------------------------------------------- | :------ | :--------- | :----------- | :------------------- | :------------- | :--------------- |
2921| [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) | 1M | 128K | $10 / $50 | Adaptive (always on) | `high` | Jun 2026 |
from line 81
8981## Good to know
9082 
9183* On the [Message Batches API](https://platform.claude.com/docs/en/build-with-claude/batch-processing#extended-output-beta), Claude Sonnet 5 supports up to 300k output tokens with the `output-300k-2026-03-24` beta header.
92* Setting `temperature`, `top_p`, or `top_k` to non-default values returns a 400 error. See [What's new in Claude Sonnet 5](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5#sampling-parameters-not-accepted).
84* Setting `temperature`, `top_p`, or `top_k` to non-default values returns a 400 error.
9385* Query limits and capabilities programmatically with the [Models API](https://platform.claude.com/docs/en/api/models/list).
9486 
9587## Resources
from line 115
123115## Reference
124116 
125117<CardGroup cols={3}>
118 <Card title="System prompt" icon="text" href="https://platform.claude.com/docs/en/release-notes/system-prompts/claude-sonnet-5">
119 The system prompt Claude Sonnet 5 uses on claude.ai and the Claude apps.
120 </Card>
121 
126122 <Card title="System card" icon="file" href="https://www.anthropic.com/claude-sonnet-5-system-card">
127123 Safety evaluations and deployment decisions for Claude Sonnet 5.
128124 </Card>

models/sonnet-5/whats-new-sonnet-5 Changed · +102 / -185 lines

## How it compares to the current lineup ## Specifications ### Model IDs ### Pricing ### Capabilities ### Availability ## Good to know ## Resources ## Reference ## New model ## Behavior changes ### Adaptive thinking on by default ### Sampling parameters not accepted ### Manual extended thinking removed ## New tokenizer ## API constraints inherited from Claude Sonnet 4.6 ### Assistant message prefilling not supported ## Capability improvements ## Cybersecurity safeguards ## Pricing ## Availability ## Migration guide ## Next steps

from line 1
11---
2title: What's new in Claude Sonnet 5
3url: https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5
4description: Overview of new features and behavior changes in Claude Sonnet 5.
2title: Claude Sonnet 5
3url: https://platform.claude.com/docs/en/models/sonnet-5/overview
4description: "Claude Sonnet 5 reference: lifecycle status, model IDs on every platform, context window, output limits, pricing, and migration resources. Claude Sonnet 5 is a legacy model; Claude Sonnet 5.5 is the current Sonnet model."
55---
66 
7<Note>
8 Claude Sonnet 5.5 is the current Sonnet model. See [What's new in Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5).
9</Note>
7**Legacy.** Released June 30, 2026.
108 
11Claude 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.
9Although Claude Sonnet 5 is still available, you should consider migrating to Claude Sonnet 5.5 for improved performance. [See Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) · [Migrate to Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-claude-sonnet-5)
1210 
13## New model
11Model ID: `claude-sonnet-5`
1412 
15| Model | API model ID | Description |
16| --------------- | ----------------- | ---------------------------------------------- |
17| Claude Sonnet 5 | `claude-sonnet-5` | The best combination of speed and intelligence |
13Context window: 1M tokens · Max output: 128K tokens · Input pricing: $2 / MTok · Output pricing: $10 / MTok
1814 
19Claude 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).
15[Announcement](https://www.anthropic.com/news/claude-sonnet-5)
2016 
21For complete pricing and specs, see the [models overview](https://platform.claude.com/docs/en/models/overview).
17## How it compares to the current lineup
2218 
23## Behavior changes
19| Model | Context | Max output | Price / MTok | Thinking | Default effort | Knowledge cutoff |
20| :---------------------------------------------------------------------------------- | :------ | :--------- | :----------- | :------------------- | :------------- | :--------------- |
21| [Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/overview) | 1M | 128K | $10 / $50 | Adaptive (always on) | `high` | Jun 2026 |
22| [Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/overview) | 1M | 128K | $4 / $20 | Adaptive (always on) | `medium` | Jun 2026 |
23| [Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) | 1M | 128K | $2 / $10 | Adaptive | `high` | Jun 2026 |
24| **Claude Sonnet 5** (this model) | 1M | 128K | $2 / $10 | Adaptive | `high` | Jan 2026 |
25| [Claude Haiku 4.5](https://platform.claude.com/docs/en/models/haiku-4-5/overview) | 200K | 64K | $1 / $5 | Extended | — | Feb 2025 |
2426 
25### Adaptive thinking on by default
27* **Context:** 1M tokens is roughly 555k words or 2.5M Unicode characters on the current tokenizer (introduced with Claude Opus 4.7); models before it fit about 750k words in 1M tokens. 200k tokens is roughly 150k words.
28* **Max output:** Synchronous Messages API limit. On the Message Batches API, Claude Opus 5.5, Claude Opus 5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, and Claude Sonnet 4.6 support up to 300k output tokens with the output-300k-2026-03-24 beta header.
29* **Price / MTok:** Input / output, base price per million tokens. Batch API requests are 50% off; prompt caching reads cost 10% of the base input price (2.5% on Claude Fable 5.1 and Claude Mythos 5.1, 5% on Claude Opus 5.5). See Pricing for the full list.
30* **Thinking:** Adaptive thinking lets the model decide how much to think, steered by effort. Extended thinking is the manual budget\_tokens mode on earlier models.
31* **Default effort:** The effort parameter’s default on the Claude API. Models without a value don’t support the parameter.
32* **Knowledge cutoff:** Reliable knowledge cutoff: the date through which the model’s knowledge is most extensive and reliable.
2633 
27On 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.
34## Specifications
2835 
29### Sampling parameters not accepted
36### Model IDs
3037 
31Setting `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.
38| Platform | Model ID |
39| :----------------------------------------------------------------------------------------------------- | :-------------------------- |
40| Claude API | `claude-sonnet-5` |
41| [Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock) | `anthropic.claude-sonnet-5` |
42| [Google Cloud](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai) | `claude-sonnet-5` |
43| [Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry) | `claude-sonnet-5` |
44| [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws) | `claude-sonnet-5` |
3245 
33### Manual extended thinking removed
46### Pricing
3447 
35Manual 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.
48| Feature | Value |
49| :------------------------------------------------------------------------------------- | :------------------------------- |
50| Input | $2 / MTok |
51| Output | $10 / MTok |
52| [5m cache write](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $2.50 / MTok |
53| [1h cache write](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $4 / MTok |
54| [Cache read](https://platform.claude.com/docs/en/build-with-claude/prompt-caching) | $0.20 / MTok |
55| [Batch API](https://platform.claude.com/docs/en/build-with-claude/batch-processing) | 50% discount on input and output |
3656 
37<CodeGroup exclude="shell">
38 ```python Python
39 # Not supported on Claude Sonnet 5 (returns 400)
40 thinking = {"type": "enabled", "budget_tokens": 32000}
57[Full price list](https://platform.claude.com/docs/en/about-claude/pricing)
4158 
42 # Use this instead
43 thinking = {"type": "adaptive"}
44 ```
59### Capabilities
4560 
46 ```typescript TypeScript
47 // Not supported on Claude Sonnet 5 (returns 400)
48 const legacyThinking = { type: "enabled", budget_tokens: 32000 };
61| Feature | Value |
62| :-------------------------------------------------------------------------------------------------------------------------- | :--------------------- |
63| [Context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) | 1M tokens |
64| Max output | 128K tokens |
65| [Max output (Batch API, beta)](https://platform.claude.com/docs/en/build-with-claude/batch-processing#extended-output-beta) | 300K tokens |
66| [Thinking](https://platform.claude.com/docs/en/build-with-claude/thinking) | Adaptive |
67| [Default effort](https://platform.claude.com/docs/en/build-with-claude/effort) | `high` |
68| Input → output | Text and images → text |
69| Reliable knowledge cutoff | Jan 2026 |
70| Training data cutoff | Jan 2026 |
4971 
50 // Use this instead
51 const thinking = { type: "adaptive" };
52 ```
72### Availability
5373 
54 ```csharp C#
55 // Not supported on Claude Sonnet 5 (returns 400)
56 var legacyThinking = new ThinkingConfigEnabled(budgetTokens: 32000);
74| Feature | Value |
75| :---------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
76| [Status](https://platform.claude.com/docs/en/about-claude/model-deprecations) | Active (legacy) |
77| Released | June 30, 2026 |
78| Retirement | Not sooner than June 30, 2027 |
79| Platforms | Claude API, [Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock), [Google Cloud](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai), [Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry), [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws) |
5780 
58 // Use this instead
59 var thinking = new ThinkingConfigAdaptive();
60 ```
81## Good to know
6182 
62 ```go Go
63 // Not supported on Claude Sonnet 5 (returns 400)
64 legacyThinking := anthropic.ThinkingConfigParamUnion{
65 OfEnabled: &anthropic.ThinkingConfigEnabledParam{BudgetTokens: 32000},
66 }
83* On the [Message Batches API](https://platform.claude.com/docs/en/build-with-claude/batch-processing#extended-output-beta), Claude Sonnet 5 supports up to 300k output tokens with the `output-300k-2026-03-24` beta header.
84* Setting `temperature`, `top_p`, or `top_k` to non-default values returns a 400 error.
85* Query limits and capabilities programmatically with the [Models API](https://platform.claude.com/docs/en/api/models/list).
6786 
68 // Use this instead
69 thinking := anthropic.ThinkingConfigParamUnion{
70 OfAdaptive: &anthropic.ThinkingConfigAdaptiveParam{},
71 }
72 ```
87## Resources
7388 
74 ```java Java
75 // Not supported on Claude Sonnet 5 (returns 400)
76 var legacyThinking = ThinkingConfigEnabled.builder().budgetTokens(32_000L).build();
89<CardGroup cols={3}>
90 <Card title="Migrate to Claude Sonnet 5.5" icon="arrows-left-right" href="https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-claude-sonnet-5">
91 What changes when moving from Claude Sonnet 5 to Claude Sonnet 5.5.
92 </Card>
7793 
78 // Use this instead
79 var thinking = ThinkingConfigAdaptive.builder().build();
80 ```
94 <Card title="Claude Sonnet 5.5" icon="arrow-right" href="https://platform.claude.com/docs/en/models/sonnet-5-5/overview">
95 The current Sonnet model: overview, specs, and resources.
96 </Card>
8197 
82 ```php PHP
83 // Not supported on Claude Sonnet 5 (returns 400)
84 $thinking = ['type' => 'enabled', 'budget_tokens' => 32000];
98 <Card title="Prompting Claude Sonnet 5" icon="lightbulb" href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5">
99 Model-specific prompting guidance.
100 </Card>
85101 
86 // Use this instead
87 $thinking = ['type' => 'adaptive'];
88 ```
102 <Card title="Adaptive thinking" icon="brain" href="https://platform.claude.com/docs/en/build-with-claude/thinking">
103 On by default on Claude Sonnet 5. Steer depth with `effort`.
104 </Card>
89105 
90 ```ruby Ruby
91 # Not supported on Claude Sonnet 5 (returns 400)
92 legacy_thinking = {type: "enabled", budget_tokens: 32_000}
106 <Card title="Effort" icon="sliders" href="https://platform.claude.com/docs/en/build-with-claude/effort">
107 Effort defaults to `high` on the Claude API and Claude Code. Choose a level per workload.
108 </Card>
93109 
94 # Use this instead
95 thinking = {type: "adaptive"}
96 ```
97</CodeGroup>
110 <Card title="Context windows" icon="stack" href="https://platform.claude.com/docs/en/build-with-claude/context-windows">
111 1M tokens by default. How the window is counted and managed.
112 </Card>
113</CardGroup>
98114 
99## New tokenizer
115## Reference
100116 
101Claude 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.
102 
103The change affects anything you measure or budget in tokens:
104 
105* **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.
106* **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.
107* **`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.
108* **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.
109 
110## API constraints inherited from Claude Sonnet 4.6
111 
112<Note>
113 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.
114</Note>
115 
116### Assistant message prefilling not supported
117 
118Prefilling 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.
119 
120## Capability improvements
121 
122Claude 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.
123 
124The 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).
125 
126## Cybersecurity safeguards
127 
128Claude 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.
129 
130## Pricing
131 
132Claude 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.
133 
134See [Pricing](https://platform.claude.com/docs/en/about-claude/pricing) for complete pricing, including batch processing and prompt caching rates.
135 
136## Availability
137 
138At launch, Claude Sonnet 5 is available on:
139 
140* **Claude API:** available to all customers.
141* **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.
142* **Google Cloud:** available through [Claude on Google Cloud](https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai).
143* **Microsoft Foundry:** available through [Claude in Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry).
144 
145Claude Sonnet 5 supports [zero data retention](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention) for organizations with ZDR agreements.
146 
147## Migration guide
148 
149Claude Sonnet 5 is a drop-in replacement for Claude Sonnet 4.6. Update your model ID:
150 
151<CodeGroup exclude="shell">
152 ```python Python
153 model = "claude-sonnet-4-6" # Before
154 model = "claude-sonnet-5" # After
155 ```
156 
157 ```typescript TypeScript
158 const legacyModel = "claude-sonnet-4-6"; // Before
159 const model = "claude-sonnet-5"; // After
160 ```
161 
162 ```csharp C#
163 var legacyModel = Model.ClaudeSonnet4_6; // Before
164 var model = Model.ClaudeSonnet5; // After
165 ```
166 
167 ```go Go
168 // Before
169 legacyModel := anthropic.ModelClaudeSonnet4_6
170 // After
171 model := anthropic.ModelClaudeSonnet5
172 ```
173 
174 ```java Java
175 var legacyModel = Model.CLAUDE_SONNET_4_6; // Before
176 var model = Model.CLAUDE_SONNET_5; // After
177 ```
178 
179 ```php PHP
180 $model = 'claude-sonnet-4-6'; // Before
181 $model = 'claude-sonnet-5'; // After
182 ```
183 
184 ```ruby Ruby
185 legacy_model = "claude-sonnet-4-6" # Before
186 model = "claude-sonnet-5" # After
187 ```
188</CodeGroup>
189 
190Then review the following:
191 
1921. **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.
1932. **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.
1943. **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.
195 
196See [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.
197 
198## Next steps
199 
200<CardGroup>
201 <Card title="Models overview" icon="arrow-right" href="https://platform.claude.com/docs/en/models/overview">
202 Complete specs and pricing for all current Claude models.
117<CardGroup cols={3}>
118 <Card title="System prompt" icon="text" href="https://platform.claude.com/docs/en/release-notes/system-prompts/claude-sonnet-5">
119 The system prompt Claude Sonnet 5 uses on claude.ai and the Claude apps.
203120 </Card>
204121 
205 <Card title="Token counting" icon="database" href="https://platform.claude.com/docs/en/build-with-claude/token-counting">
206 Measure your prompts under the new tokenizer before you migrate.
122 <Card title="System card" icon="file" href="https://www.anthropic.com/claude-sonnet-5-system-card">
123 Safety evaluations and deployment decisions for Claude Sonnet 5.
207124 </Card>
208125 
209 <Card title="Adaptive thinking" icon="brain" href="https://platform.claude.com/docs/en/build-with-claude/thinking">
210 The recommended thinking-on mode on Claude Sonnet 5.
126 <Card title="Pricing" icon="coins" href="https://platform.claude.com/docs/en/about-claude/pricing">
127 Full price list, including batch discounts and prompt caching rates.
211128 </Card>
212129 
213 <Card title="Context windows" icon="sliders" href="https://platform.claude.com/docs/en/build-with-claude/context-windows">
214 How the 1M token context window works.
130 <Card title="Model IDs and versioning" icon="fingerprint" href="https://platform.claude.com/docs/en/about-claude/models/model-ids-and-versions">
131 How model IDs, aliases, and pinned snapshots work.
215132 </Card>
216133 
217 <Card title="Pricing" icon="shield" href="https://platform.claude.com/docs/en/about-claude/pricing">
218 Complete pricing, including batch processing and prompt caching rates.
134 <Card title="Model deprecations" icon="clock" href="https://platform.claude.com/docs/en/about-claude/model-deprecations">
135 Lifecycle status and retirement commitments for every Claude model.
219136 </Card>
220137</CardGroup>
221138 

about-claude/models/choosing-a-model Changed · +0 / -4 lines

from line 111
111111 The latest Sonnet model: breaking changes, new features, and behavior differences
112112 </Card>
113113 
114 <Card title="What's new in Claude Sonnet 5" icon="sparkle" href="https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5">
115 New features and behavior changes in Claude Sonnet 5
116 </Card>
117 
118114 <Card title="Start building" icon="code" href="https://platform.claude.com/docs/en/get-started">
119115 Get started with your first API call
120116 </Card>

api/beta/organization/analytics/cost/list Changed · +1 / -1 lines

from line 234
234234 
235235 - `"web_search"`
236236 
237 - `currency: "USD"`
237 - `currency: string`
238238 
239239 Currency code for the cost amount. Currently always `"USD"`.
240240 

api/beta/organization/analytics/cost/list_by_user Changed · +1 / -1 lines

from line 275
275275 
276276 - `"web_search"`
277277 
278 - `currency: "USD"`
278 - `currency: string`
279279 
280280 Currency code for the cost amount. Currently always `"USD"`.
281281 

api/beta/organization/analytics/skills/list Changed · +2 / -2 lines

from line 144
144144 
145145 List-price (rate-card) value of the member requests attributed to this skill, as a decimal string in the minor unit of `currency` (cents for USD), from Claude Code, Cowork, and Office Agent request-level attribution — the value of requests that involved the skill, not the skill's incremental cost. Unlike `estimated_overage_spend` this reflects usage value regardless of how it was funded — seat-covered usage counts — but it is undiscounted and does not tie to billed spend or the organization's spend reporting. claude.ai chat usage carries no request-level attribution and contributes nothing: the field is null on `chat` product rows and on `office_agent` product cuts dated before 2026-06-18 (the Office Agent attribution data-start), and on ungrouped rows it covers the Claude Code + Cowork + Office Agent share only (null when no attributable usage exists). Also null under the same conditions as `estimated_overage_spend` (spend reporting not enabled for this organization, `office_agent` product cuts before the 2026-06-18 data-start). "0" means attributable usage existed but none was attributed to this skill. Addable across days: date-range rollup mode returns the window's sum. On `group_by[]` and `filter[]` shapes both amounts can total below the ungrouped value for the same skill over the same date or range: spend attributed to a member–skill pair with no counted usage on that day is excluded from those cuts.
146146 
147 - `currency: optional "USD" or null`
147 - `currency: optional string or null`
148148 
149149 Currency for this row's monetary fields (`estimated_overage_spend` and `attributed_list_price`), as an uppercase ISO-4217 code. Always "USD" when either amount is populated; null whenever both amounts are null.
150150 
from line 234
234234 },
235235 "skill_name": "skill_name",
236236 "attributed_list_price": "attributed_list_price",
237 "currency": "USD",
237 "currency": "currency",
238238 "enable_count": 0,
239239 "estimated_overage_spend": "estimated_overage_spend",
240240 "invocation_count": 0,

api/beta/organization/mcp_tunnels/archive Changed · +2 / -2 lines

from line 169
169169 
170170 - `workspace_id: string or null`
171171 
172 ID of the Workspace this Tunnel belongs to, or `null` for the default
173 Workspace. Immutable after creation.
172 ID of the Workspace this Tunnel belongs to. May be `null` for a Tunnel in
173 the default Workspace. A Tunnel never moves to another Workspace.
174174 
175175## Example
176176 

api/beta/organization/mcp_tunnels/list Changed · +2 / -2 lines

from line 187
187187 
188188 - `workspace_id: string or null`
189189 
190 ID of the Workspace this Tunnel belongs to, or `null` for the default
191 Workspace. Immutable after creation.
190 ID of the Workspace this Tunnel belongs to. May be `null` for a Tunnel in
191 the default Workspace. A Tunnel never moves to another Workspace.
192192 
193193- `next_page: string or null`
194194 

api/beta/organization/mcp_tunnels/retrieve Changed · +2 / -2 lines

from line 164
164164 
165165 - `workspace_id: string or null`
166166 
167 ID of the Workspace this Tunnel belongs to, or `null` for the default
168 Workspace. Immutable after creation.
167 ID of the Workspace this Tunnel belongs to. May be `null` for a Tunnel in
168 the default Workspace. A Tunnel never moves to another Workspace.
169169 
170170## Example
171171 

build-with-claude/prompt-engineering/claude-prompting-best-practices Changed · +2 / -2 lines

from line 11
1111* **Migration considerations** last, for prompts moving from earlier generations.
1212 
1313<Tip>
14 For an overview of model capabilities, see the [models overview](https://platform.claude.com/docs/en/models/overview). For Claude Fable 5.1 capabilities and API changes, see [What's new in Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/whats-new-fable-5-1). For Claude Fable 5 capabilities and API changes, see [Introducing Claude Fable 5 and Claude Mythos 5](https://platform.claude.com/docs/en/models/fable-5/introducing-claude-fable-5-and-claude-mythos-5). For details on what's new in Claude Sonnet 5, see [What's new in Claude Sonnet 5](https://platform.claude.com/docs/en/models/sonnet-5/whats-new-sonnet-5). For migration guidance, see the [Migration guide](https://platform.claude.com/docs/en/about-claude/models/migration-guide). For Claude Opus 5.5, see [What's new in Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5). For Claude Sonnet 5.5, see [What's new in Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5).
14 For an overview of model capabilities, see the [models overview](https://platform.claude.com/docs/en/models/overview). For Claude Fable 5.1 capabilities and API changes, see [What's new in Claude Fable 5.1](https://platform.claude.com/docs/en/models/fable-5-1/whats-new-fable-5-1). For Claude Fable 5 capabilities and API changes, see [Introducing Claude Fable 5 and Claude Mythos 5](https://platform.claude.com/docs/en/models/fable-5/introducing-claude-fable-5-and-claude-mythos-5). For migration guidance, see the [Migration guide](https://platform.claude.com/docs/en/about-claude/models/migration-guide). For Claude Opus 5.5, see [What's new in Claude Opus 5.5](https://platform.claude.com/docs/en/models/opus-5-5/whats-new-opus-5-5). For Claude Sonnet 5.5, see [What's new in Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/whats-new-sonnet-5-5).
1515</Tip>
1616 
1717## Model-specific guidance
from line 1106
11061106 </Card>
11071107 
11081108 <Card title="Prompting Claude Sonnet 5" icon="terminal" href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-sonnet-5">
1109 Behavioral differences and prompting patterns for Claude Sonnet 5, covering effort, adaptive thinking defaults, tool use, and migration from Claude Sonnet 4.6.
1109 Behavioral differences and prompting patterns for Claude Sonnet 5, covering effort, adaptive thinking defaults, and tool use.
11101110 </Card>
11111111 
11121112 <Card title="Prompting Claude Opus 5.5" icon="terminal" href="https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5-5">

cli-sdks-libraries/cli/quickstart Changed · +1 / -1 lines

from line 29
2929 For Linux environments, download the release binary directly.
3030 
3131 ```bash
32 VERSION=1.35.0
32 VERSION=1.36.0
3333 OS=$(uname -s | tr '[:upper:]' '[:lower:]')
3434 case $(uname -m) in
3535 x86_64) ARCH=amd64 ;;

cli-sdks-libraries/sdks/java Changed · +2 / -2 lines

from line 15
1515<Tabs>
1616 <Tab title="Gradle">
1717 ```kotlin
18 implementation("com.anthropic:anthropic-java:2.65.0")
18 implementation("com.anthropic:anthropic-java:2.66.0")
1919 ```
2020 </Tab>
2121 
from line 24
2424 <dependency>
2525 <groupId>com.anthropic</groupId>
2626 <artifactId>anthropic-java</artifactId>
27 <version>2.65.0</version>
27 <version>2.66.0</version>
2828 </dependency>
2929 ```
3030 </Tab>

get-started Changed · +2 / -2 lines

from line 436
436436 }
437437 
438438 dependencies {
439 implementation("com.anthropic:anthropic-java:2.65.0")
439 implementation("com.anthropic:anthropic-java:2.66.0")
440440 }
441441 
442442 application {
from line 462
462462 <dependency>
463463 <groupId>com.anthropic</groupId>
464464 <artifactId>anthropic-java</artifactId>
465 <version>2.65.0</version>
465 <version>2.66.0</version>
466466 </dependency>
467467 </dependencies>
468468 </project>

managed-agents/quickstart Changed · +2 / -2 lines

from line 43
4343 For Linux environments, download the release binary directly.
4444 
4545 ```bash
46 VERSION=1.35.0
46 VERSION=1.36.0
4747 OS=$(uname -s | tr '[:upper:]' '[:lower:]')
4848 case $(uname -m) in
4949 x86_64) ARCH=amd64 ;;
from line 94
9494 
9595 <Tab title="Java">
9696 ```groovy Gradle
97 implementation("com.anthropic:anthropic-java:2.65.0")
97 implementation("com.anthropic:anthropic-java:2.66.0")
9898 ```
9999 </Tab>
100100 

managed-agents/self-hosted-sandboxes Changed · +2 / -2 lines

from line 221
221221 For Linux environments, download the release binary directly.
222222 
223223 ```bash
224 VERSION=1.35.0
224 VERSION=1.36.0
225225 OS=$(uname -s | tr '[:upper:]' '[:lower:]')
226226 case $(uname -m) in
227227 x86_64) ARCH=amd64 ;;
from line 259
259259 
260260 ```text
261261 FROM your-base-image
262 ARG ANT_VERSION=1.35.0
262 ARG ANT_VERSION=1.36.0
263263 ARG TARGETARCH
264264 RUN ARCH=$([ "$TARGETARCH" = "arm64" ] && echo arm64 || echo amd64) && \
265265 curl -fsSL "https://github.com/anthropics/anthropic-cli/releases/download/v${ANT_VERSION}/ant_${ANT_VERSION}_linux_${ARCH}.tar.gz" \

models/sonnet-4-5/overview Changed · +1 / -1 lines

from line 6
66 
77**Legacy.** Released September 29, 2025.
88 
9Although Claude Sonnet 4.5 is still available, you should consider migrating to Claude Sonnet 5.5 for improved performance. [See Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) · [Migrate to Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide)
9Although Claude Sonnet 4.5 is still available, you should consider migrating to Claude Sonnet 5.5 for improved performance. [See Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/overview) · [Migrate to Claude Sonnet 5.5](https://platform.claude.com/docs/en/models/sonnet-5-5/migration-guide#migrating-from-sonnet-45)
1010 
1111Model ID: `claude-sonnet-4-5-20250929`
1212 
Feedback