Count tokens in a Message changedapi/messages/count_tokens
Nearest release: v2.1.283, published 3 hours after this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+79added
Lines−105removed
From line
127
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits10to this page, all time
The whole hunk
from line 127, old and new numbered
/
from line 127
127127
128128 - `document_title: string or null`
129129
130 maxLength: 500, minLength: 1
130 minLength: 1, maxLength: 500
131131
132132 - `end_char_index: number`
133133
from line 147
147147
148148 - `document_title: string or null`
149149
150 maxLength: 500, minLength: 1
150 minLength: 1, maxLength: 500
151151
152152 - `end_page_number: number`
153153
from line 171
171171
172172 - `document_title: string or null`
173173
174 maxLength: 500, minLength: 1
174 minLength: 1, maxLength: 500
175175
176176 - `end_block_index: number`
177177
from line 195
195195
196196 - `title: string or null`
197197
198 maxLength: 512, minLength: 1
198 minLength: 1, maxLength: 512
199199
200200 - `url: string`
201201
from line 351
351351
352352 - `title: optional string or null`
353353
354 maxLength: 500, minLength: 1
354 minLength: 1, maxLength: 500
355355
356356 - `SearchResultBlockParam object`
357357
from line 415
415415
416416 - `name: string`
417417
418 maxLength: 200, minLength: 1
418 minLength: 1, maxLength: 200
419419
420420 - `cache_control: optional CacheControlEphemeral or null`
421421
from line 451
451451
452452 For a toolset member tool_use, the toolset family this member belongs to.
453453
454 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
454 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
455455
456456 - `ToolResultBlockParam object`
457457
from line 487
487487
488488 - `tool_name: string`
489489
490 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
490 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
491491
492492 - `cache_control: optional CacheControlEphemeral or null`
493493
from line 515
515515
516516 The caller-assigned identifier for this tab, unique within the inventory.
517517
518 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
518 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
519519
520520 - `title: string`
521521
from line 541
541541
542542 Tabs opened and download state changes during this call. "Nothing to report" is expressed by omitting the field, never by an empty list.
543543
544 maxItems: 200, minItems: 1
544 minItems: 1, maxItems: 200
545545
546546 - `BrowserStateChangeTabOpened object`
547547
from line 559
559559
560560 The `tab_id` of the opened tab, present in `tabs`.
561561
562 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
562 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
563563
564564 - `BrowserStateChangeDownloadStarted object`
565565
from line 571
571571
572572 The caller-assigned identifier for this download, stable across the state changes reporting it.
573573
574 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
574 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
575575
576576 - `url: string`
577577
from line 592
592592
593593 The caller-assigned identifier for this download, stable across the state changes reporting it.
594594
595 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
595 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
596596
597597 - `url: string`
598598
from line 604
604604
605605 Where the executor saved the file, on the executor's filesystem. Only included when another tool in the same environment can read the file at that path.
606606
607 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
607 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
608608
609609 - `size_bytes: optional number or null`
610610
from line 622
622622
623623 The caller-assigned identifier for this download, stable across the state changes reporting it.
624624
625 maxLength: 4096, minLength: 1, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
625 minLength: 1, maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
626626
627627 - `url: string`
628628
from line 634
634634
635635 The failure or cancellation detail, when known.
636636
637 pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$, maxLength: 4096
637 maxLength: 4096, pattern: ^[^\x00-\x1f\x7f-\x9f\u2028\u2029]*$
638638
639639 - `is_error: optional boolean`
640640
from line 642
642642
643643 For a toolset member tool_result, the toolset family of the paired tool_use.
644644
645 maxLength: 64, minLength: 1, pattern: ^[a-zA-Z0-9_-]+$
645 minLength: 1, maxLength: 64, pattern: ^[a-zA-Z0-9_-]+$
646646
647647 - `ServerToolUseBlockParam object`
648648
from line 1020
10201020
10211021 - `tool_name: string`
10221022
1023 maxLength: 256, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,256}$
1023 minLength: 1, maxLength: 256, pattern: ^[a-zA-Z0-9_-]{1,256}$
10241024
10251025 - `cache_control: optional CacheControlEphemeral or null`
10261026
from line 1061
10611061
10621062 See [models](https://docs.anthropic.com/en/docs/models-overview) for additional details and options.
10631063
1064 - `string`
1065
10641066 - `"claude-fable-5-1" or "claude-opus-5-5" or "claude-mythos-5-1" or 15 more`
10651067
10661068 The model that will complete your prompt.
from line 1105
11031105
11041106 Powerful intelligence for long-running agents and coding
11051107
1106 - `"claude-mythos-preview"`
1107
1108 New class of intelligence, strongest in coding and cybersecurity
1109
11101108 - `"claude-opus-4-6"`
11111109
11121110 Powerful intelligence for long-running agents and coding
from line 1137
11391137
11401138 High-performance model for agents and coding
11411139
1142 - `string`
1140 - `"claude-mythos-preview"`
11431141
1142 **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.
1143
1144 New class of intelligence, strongest in coding and cybersecurity
1145
11441146- `cache_control: optional CacheControlEphemeral or null`
11451147
11461148 Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.
from line 1153
11511153
11521154 - `effort: optional "low" or "medium" or "high" or 2 more or null`
11531155
1154 All possible effort levels.
1156 How much effort the model should put into its response. Higher effort levels may result in more thorough analysis but take longer.
11551157
1158 Valid values are `low`, `medium`, `high`, `xhigh`, or `max`.
1159
11561160 - `"low"`
11571161
11581162 - `"medium"`
from line 1381
13771381
13781382 This is how the tool will be called by the model and in `tool_use` blocks.
13791383
1380 maxLength: 128, minLength: 1, pattern: ^[a-zA-Z0-9_-]{1,128}$
1384 minLength: 1, maxLength: 128, pattern: ^[a-zA-Z0-9_-]{1,128}$
13811385
13821386 - `allowed_callers: optional array of "direct" or "code_execution_20250825" or "code_execution_20260120" or "code_execution_20260521"`
13831387
from line 1598
15941598
15951599 - `configs: optional BrowserToolsetConfigs or null`
15961600
1597 Per-member configuration for `browser_toolset_20260801`: one
1598 optional field per member tool, keyed by the member name — the same
1599 name the member's `tool_use` blocks carry. Every member is an
1600 accepted key, and a member's defaults apply wherever its key is
1601 absent. Unknown keys are rejected: the field set is this toolset
1602 version's complete member set.
1601 Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
16031602
16041603 - `type: optional BrowserTypeConfig or null`
16051604
from line 2025
20262025
20272026 - `configs: optional ComputerToolsetConfigs or null`
20282027
2029 Per-member configuration for `computer_toolset_20260801`: one
2030 optional field per member tool, keyed by the member name — the same
2031 name the member's `tool_use` blocks carry. Every member is an
2032 accepted key, and a member's defaults apply wherever its key is
2033 absent. Unknown keys are rejected: the field set is this toolset
2034 version's complete member set.
2028 Sparse per-member overrides, keyed by member name. Absent, null, and {} are equivalent; a member's defaults apply wherever its key is absent.
20352029
20362030 - `type: optional ComputerTypeConfig or null`
20372031
from line 2379
23852379
23862380 Maximum number of times the tool can be used in the API request.
23872381
2388 exclusiveMinimum: 0
2382 minimum: 1
23892383
23902384 - `strict: optional boolean`
23912385
from line 2395
24012395
24022396 The city of the user.
24032397
2404 maxLength: 255, minLength: 1
2398 minLength: 1, maxLength: 255
24052399
24062400 - `country: optional string or null`
24072401
24082402 The two letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the user.
24092403
2410 maxLength: 2, minLength: 2
2404 minLength: 2, maxLength: 2
24112405
24122406 - `region: optional string or null`
24132407
24142408 The region of the user.
24152409
2416 maxLength: 255, minLength: 1
2410 minLength: 1, maxLength: 255
24172411
24182412 - `timezone: optional string or null`
24192413
24202414 The [IANA timezone](https://nodatime.org/TimeZones) of the user.
24212415
2422 maxLength: 255, minLength: 1
2416 minLength: 1, maxLength: 255
24232417
24242418 - `WebFetchTool20250910 object`
24252419
from line 2459
24652459
24662460 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
24672461
2468 exclusiveMinimum: 0
2462 minimum: 1
24692463
24702464 - `max_uses: optional number or null`
24712465
24722466 Maximum number of times the tool can be used in the API request.
24732467
2474 exclusiveMinimum: 0
2468 minimum: 1
24752469
24762470 - `strict: optional boolean`
24772471
from line 2473
24792473
24802474 - `url_sources: optional WebFetchURLSources or null`
24812475
2482 Which sources contribute to the set of URLs web fetch may fetch.
2476 Which sources contribute to the set of URLs the tool may fetch. Omitted means every source.
24832477
2484 Each key is a tagged variant: `user_input` is `all` or `none`; the
2485 two tool filters are `all`, `none`, `only` (only the named tools'
2486 results) or `except` (every result but the named tools'). A named tool
2487 must be declared in this request's `tools[]`.
2488
24892478 - `client_tool_results: optional WebFetchURLSourceAll or WebFetchURLSourceNone or WebFetchURLSourceOnly or WebFetchURLSourceExcept`
24902479
24912480 Which client tools' results contribute fetchable URLs: "all", "none", or an only or except list of client tool names from tools[].
from line 2597
26082597
26092598 Maximum number of times the tool can be used in the API request.
26102599
2611 exclusiveMinimum: 0
2600 minimum: 1
26122601
26132602 - `strict: optional boolean`
26142603
from line 2651
26622651
26632652 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
26642653
2665 exclusiveMinimum: 0
2654 minimum: 1
26662655
26672656 - `max_uses: optional number or null`
26682657
26692658 Maximum number of times the tool can be used in the API request.
26702659
2671 exclusiveMinimum: 0
2660 minimum: 1
26722661
26732662 - `strict: optional boolean`
26742663
from line 2665
26762665
26772666 - `url_sources: optional WebFetchURLSources or null`
26782667
2679 Which sources contribute to the set of URLs web fetch may fetch.
2668 Which sources contribute to the set of URLs the tool may fetch. Omitted means every source.
26802669
2681 Each key is a tagged variant: `user_input` is `all` or `none`; the
2682 two tool filters are `all`, `none`, `only` (only the named tools'
2683 results) or `except` (every result but the named tools'). A named tool
2684 must be declared in this request's `tools[]`.
2685
26862670 - `WebFetchTool20260309 object`
26872671
26882672 Web fetch tool with use_cache parameter for bypassing cached content.
from line 2713
27292713
27302714 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
27312715
2732 exclusiveMinimum: 0
2716 minimum: 1
27332717
27342718 - `max_uses: optional number or null`
27352719
27362720 Maximum number of times the tool can be used in the API request.
27372721
2738 exclusiveMinimum: 0
2722 minimum: 1
27392723
27402724 - `strict: optional boolean`
27412725
from line 2727
27432727
27442728 - `url_sources: optional WebFetchURLSources or null`
27452729
2746 Which sources contribute to the set of URLs web fetch may fetch.
2730 Which sources contribute to the set of URLs the tool may fetch. Omitted means every source.
27472731
2748 Each key is a tagged variant: `user_input` is `all` or `none`; the
2749 two tool filters are `all`, `none`, `only` (only the named tools'
2750 results) or `except` (every result but the named tools'). A named tool
2751 must be declared in this request's `tools[]`.
2752
27532732 - `use_cache: optional boolean`
27542733
27552734 Whether to use cached content. Set to false to bypass the cache and fetch fresh content. Only set to false when the user explicitly requests fresh content or when fetching rapidly-changing sources.
from line 2773
27942773
27952774 Maximum number of times the tool can be used in the API request.
27962775
2797 exclusiveMinimum: 0
2776 minimum: 1
27982777
27992778 - `response_inclusion: optional "full" or "excluded"`
28002779
from line 2835
28562835
28572836 Maximum number of tokens used by including web page text content in the context. The limit is approximate and does not apply to binary content such as PDFs.
28582837
2859 exclusiveMinimum: 0
2838 minimum: 1
28602839
28612840 - `max_uses: optional number or null`
28622841
28632842 Maximum number of times the tool can be used in the API request.
28642843
2865 exclusiveMinimum: 0
2844 minimum: 1
28662845
28672846 - `response_inclusion: optional "full" or "excluded"`
28682847
from line 2857
28782857
28792858 - `url_sources: optional WebFetchURLSources or null`
28802859
2881 Which sources contribute to the set of URLs web fetch may fetch.
2882
2883 Each key is a tagged variant: `user_input` is `all` or `none`; the
2884 two tool filters are `all`, `none`, `only` (only the named tools'
2885 results) or `except` (every result but the named tools'). A named tool
2886 must be declared in this request's `tools[]`.
2860 Which sources contribute to the set of URLs the tool may fetch. Omitted means every source.
28872861
28882862 - `use_cache: optional boolean`
28892863
No line in this hunk matches that.