Count tokens in a Message changedapi/beta/messages/count_tokens
Nearest release: v2.1.269, published under an hour 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+0added
Lines−20removed
From line
517
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits29to this page, all time
The whole hunk
from line 517, old and new numbered
/
from line 517
517517
518518 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
519519
520 Tool invocation directly from the model.
521
522520 - `BetaDirectCaller object`
523521
524522 Tool invocation directly from the model.
from line 772
774772
775773 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
776774
777 Tool invocation directly from the model.
778
779775 - `BetaDirectCaller object`
780776
781777 Tool invocation directly from the model.
from line 828
832828
833829 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
834830
835 Tool invocation directly from the model.
836
837831 - `BetaDirectCaller object`
838832
839833 Tool invocation directly from the model.
from line 894
900894
901895 - `caller: optional BetaDirectCaller or BetaServerToolCaller or BetaServerToolCaller20260120`
902896
903 Tool invocation directly from the model.
904
905897 - `BetaDirectCaller object`
906898
907899 Tool invocation directly from the model.
from line 962
970962
971963 - `content: BetaCodeExecutionToolResultBlockParamContent`
972964
973 Code execution result with encrypted stdout for PFC + web_search results.
974
975965 - `BetaCodeExecutionToolResultErrorParam object`
976966
977967 - `type: "code_execution_tool_result_error"`
from line 1283
12931283
12941284 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
12951285
1296 Reference to a single tool the caller declared directly in
1297 `tools[]`. Does not accept the composed `{server}_{name}` form the
1298 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
1299 `mcp_toolset_reference` for those.
1300
13011286 - `BetaToolChangeToolReference object`
13021287
13031288 Reference to a single tool the caller declared directly in
from line 1330
13451330 - `type: "tool_removal"`
13461331
13471332 - `tool: BetaToolChangeToolReference or BetaToolChangeMCPToolReference or BetaToolChangeMCPToolsetReference`
1348
1349 Reference to a single tool the caller declared directly in
1350 `tools[]`. Does not accept the composed `{server}_{name}` form the
1351 server assigns to MCP-resolved tools — use `mcp_tool_reference` or
1352 `mcp_toolset_reference` for those.
13531333
13541334 - `BetaToolChangeToolReference object`
13551335
No line in this hunk matches that.