The whole hunk
from line 15, old and new numbered
/
lines
from line 15
1515 -H "anthropic-version: 2023-06-01" \
1616 -H "content-type: application/json" \
1717 -d '{
18 "model": "claude-opus-5",
18 "model": "claude-opus-5-5",
1919 "max_tokens": 1024,
2020 "tools": [{"type": "web_search_20260209", "name": "web_search"}],
2121 "messages": [{"role": "user", "content": "What'\''s the latest on the Mars rover?"}]
from line 24
2424
2525 ```bash CLI
2626 ant messages create --transform content --format yaml \
27 --model claude-opus-5 \
27 --model claude-opus-5-5 \
2828 --max-tokens 1024 \
2929 --tool '{type: web_search_20260209, name: web_search}' \
3030 --message '{role: user, content: "What is the latest on the Mars rover?"}'
from line 33
3333 ```python Python
3434 client = anthropic.Anthropic()
3535 response = client.messages.create(
36 model="claude-opus-5",
36 model="claude-opus-5-5",
3737 max_tokens=1024,
3838 tools=[{"type": "web_search_20260209", "name": "web_search"}],
3939 messages=[{"role": "user", "content": "What's the latest on the Mars rover?"}],
from line 44
4444 ```typescript TypeScript
4545 const client = new Anthropic();
4646 const response = await client.messages.create({
47 model: "claude-opus-5",
47 model: "claude-opus-5-5",
4848 max_tokens: 1024,
4949 tools: [{ type: "web_search_20260209", name: "web_search" }],
5050 messages: [{ role: "user", content: "What's the latest on the Mars rover?" }]
from line 57
5757
5858 var parameters = new MessageCreateParams
5959 {
60 Model = Model.ClaudeOpus5,
60 Model = Model.ClaudeOpus5_5,
6161 MaxTokens = 1024,
6262 Tools = [new ToolUnion(new WebSearchTool20260209())],
6363 Messages = [new() { Role = Role.User, Content = "What's the latest on the Mars rover?" }]
from line 71
7171 client := anthropic.NewClient()
7272
7373 response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
74 Model: anthropic.ModelClaudeOpus5,
74 Model: anthropic.ModelClaudeOpus5_5,
7575 MaxTokens: 1024,
7676 Tools: []anthropic.ToolUnionParam{
7777 {OfWebSearchTool20260209: &anthropic.WebSearchTool20260209Param{}},
from line 93
9393 AnthropicClient client = AnthropicOkHttpClient.fromEnv();
9494
9595 MessageCreateParams params = MessageCreateParams.builder()
96 .model(Model.CLAUDE_OPUS_5)
96 .model(Model.CLAUDE_OPUS_5_5)
9797 .maxTokens(1024L)
9898 .addTool(WebSearchTool20260209.builder().build())
9999 .addUserMessage("What's the latest on the Mars rover?")
from line 108
108108 $client = new Client();
109109
110110 $message = $client->messages->create(
111 model: 'claude-opus-5',
111 model: 'claude-opus-5-5',
112112 maxTokens: 1024,
113113 tools: [
114114 ['type' => 'web_search_20260209', 'name' => 'web_search'],
from line 125
125125 client = Anthropic::Client.new
126126
127127 message = client.messages.create(
128 model: "claude-opus-5",
128 model: "claude-opus-5-5",
129129 max_tokens: 1024,
130130 tools: [{ type: "web_search_20260209", name: "web_search" }],
131131 messages: [{ role: "user", content: "What's the latest on the Mars rover?" }]
from line 164
164164 -H "anthropic-version: 2023-06-01" \
165165 -H "content-type: application/json" \
166166 -d "$(jq -n --argjson tools "$TOOLS" --arg msg "$USER_MSG" '{
167 model: "claude-opus-5",
167 model: "claude-opus-5-5",
168168 max_tokens: 1024,
169169 tools: $tools,
170170 # Ask for at most one tool call per turn.
from line 188
188188 --arg tool_use_id "$(echo "$TOOL_USE" | jq -r '.id')" \
189189 --arg weather "$WEATHER" \
190190 '{
191 model: "claude-opus-5",
191 model: "claude-opus-5-5",
192192 max_tokens: 1024,
193193 tools: $tools,
194194 tool_choice: {type: "auto", disable_parallel_tool_use: true},
from line 210
210210 call_api() {
211211 {
212212 cat <<'YAML'
213 model: claude-opus-5
213 model: claude-opus-5-5
214214 max_tokens: 1024
215215 # Ask for at most one tool call per turn.
216216 tool_choice: {type: auto, disable_parallel_tool_use: true}
from line 272
272272
273273 # Claude replies with a tool_use block naming the tool and its arguments.
274274 response = client.messages.create(
275 model="claude-opus-5",
275 model="claude-opus-5-5",
276276 max_tokens=1024,
277277 tools=tools,
278278 # Ask for at most one tool call per turn.
from line 294
294294 },
295295 ]
296296 followup = client.messages.create(
297 model="claude-opus-5",
297 model="claude-opus-5-5",
298298 max_tokens=1024,
299299 tools=tools,
300300 tool_choice={"type": "auto", "disable_parallel_tool_use": True},
from line 328
328328
329329 // Claude replies with a tool_use block naming the tool and its arguments.
330330 const response = await client.messages.create({
331 model: "claude-opus-5",
331 model: "claude-opus-5-5",
332332 max_tokens: 1024,
333333 tools,
334334 // Ask for at most one tool call per turn.
from line 350
350350 }
351351 );
352352 const followup = await client.messages.create({
353 model: "claude-opus-5",
353 model: "claude-opus-5-5",
354354 max_tokens: 1024,
355355 tools,
356356 tool_choice: { type: "auto", disable_parallel_tool_use: true },
from line 396
396396 // Claude replies with a tool_use block naming the tool and its arguments.
397397 var response = await client.Messages.Create(new MessageCreateParams
398398 {
399 Model = Model.ClaudeOpus5,
399 Model = Model.ClaudeOpus5_5,
400400 MaxTokens = 1024,
401401 Tools = tools,
402402 ToolChoice = toolChoice,
from line 425
425425 ];
426426 var followup = await client.Messages.Create(new MessageCreateParams
427427 {
428 Model = Model.ClaudeOpus5,
428 Model = Model.ClaudeOpus5_5,
429429 MaxTokens = 1024,
430430 Tools = tools,
431431 ToolChoice = toolChoice,
from line 476
476476
477477 // Claude replies with a tool_use block naming the tool and its arguments.
478478 response, err := client.Messages.New(ctx, anthropic.MessageNewParams{
479 Model: anthropic.ModelClaudeOpus5,
479 Model: anthropic.ModelClaudeOpus5_5,
480480 MaxTokens: 1024,
481481 Tools: tools,
482482 ToolChoice: toolChoice,
from line 505
505505 anthropic.NewUserMessage(anthropic.NewToolResultBlock(toolUse.ID, weather, false)),
506506 )
507507 followup, err := client.Messages.New(ctx, anthropic.MessageNewParams{
508 Model: anthropic.ModelClaudeOpus5,
508 Model: anthropic.ModelClaudeOpus5_5,
509509 MaxTokens: 1024,
510510 Tools: tools,
511511 ToolChoice: toolChoice,
from line 560
560560
561561 // Claude replies with a tool_use block naming the tool and its arguments.
562562 Message response = client.messages().create(MessageCreateParams.builder()
563 .model(Model.CLAUDE_OPUS_5)
563 .model(Model.CLAUDE_OPUS_5_5)
564564 .maxTokens(1024L)
565565 .addTool(weatherTool)
566566 .toolChoice(toolChoice)
from line 575
575575 // Run the tool, then send the result back in a tool_result block.
576576 String weather = "15 degrees Celsius, partly cloudy";
577577 Message followup = client.messages().create(MessageCreateParams.builder()
578 .model(Model.CLAUDE_OPUS_5)
578 .model(Model.CLAUDE_OPUS_5_5)
579579 .maxTokens(1024L)
580580 .addTool(weatherTool)
581581 .toolChoice(toolChoice)
from line 623
623623
624624 // Claude replies with a tool_use block naming the tool and its arguments.
625625 $response = $client->messages->create(
626 model: 'claude-opus-5',
626 model: 'claude-opus-5-5',
627627 maxTokens: 1024,
628628 tools: $tools,
629629 toolChoice: $toolChoice,
from line 641
641641 // Run the tool, then send the result back in a tool_result block.
642642 $weather = '15 degrees Celsius, partly cloudy';
643643 $followup = $client->messages->create(
644 model: 'claude-opus-5',
644 model: 'claude-opus-5-5',
645645 maxTokens: 1024,
646646 tools: $tools,
647647 toolChoice: $toolChoice,
from line 689
689689
690690 # Claude replies with a tool_use block naming the tool and its arguments.
691691 response = client.messages.create(
692 model: "claude-opus-5",
692 model: "claude-opus-5-5",
693693 max_tokens: 1024,
694694 tools: tools,
695695 # Ask for at most one tool call per turn.
from line 711
711711 }
712712 ]
713713 followup = client.messages.create(
714 model: "claude-opus-5",
714 model: "claude-opus-5-5",
715715 max_tokens: 1024,
716716 tools: tools,
717717 tool_choice: {type: "auto", disable_parallel_tool_use: true},
from line 866
866866
867867| Model | Tool choice | Tool use system prompt token count |
868868| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | ---------------------------------- |
869| Claude Opus 5.5 | `auto`, `none` | 286 tokens |
869870| Claude Opus 5 | `auto`, `none`***`any`, `tool` | 286 tokens***406 tokens |
870871| Claude Opus 4.8 | `auto`, `none`***`any`, `tool` | 290 tokens***410 tokens |
871872| Claude Opus 4.7 | `auto`, `none`***`any`, `tool` | 675 tokens***804 tokens |