CARVIEW |
Select Language
HTTP/2 301
date: Sat, 11 Oct 2025 23:43:36 GMT
content-type: text/html
content-length: 167
location: https://docs.claude.com/en/docs/build-with-claude/tool-use/token-efficient-tool-use
cache-control: max-age=3600
expires: Sun, 12 Oct 2025 00:43:36 GMT
vary: Accept-Encoding
server: cloudflare
cf-ray: 98d2387c1d1a8a2a-BLR
alt-svc: h3=":443"; ma=86400
HTTP/2 307
date: Sat, 11 Oct 2025 23:43:37 GMT
content-type: text/html; charset=utf-8
cf-ray: 98d2387c6cb895be-BLR
x-frame-options: DENY
content-security-policy: worker-src * blob: data: 'unsafe-eval' 'unsafe-inline'; object-src data: ; base-uri 'self'; upgrade-insecure-requests; frame-ancestors 'none'; form-action 'self' https://codesandbox.io;
x-middleware-rewrite: /_sites/docs.claude.com/en/docs/build-with-claude/tool-use/token-efficient-tool-use
vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding
location: /en/docs/agents-and-tools/tool-use/token-efficient-tool-use,/en/docs/agents-and-tools/tool-use/token-efficient-tool-use
x-nextjs-stale-time: 60
x-nextjs-stale-time: 60
x-nextjs-cache: MISS
x-nextjs-prerender: 1
x-powered-by: Next.js
cache-control: s-maxage=31536000
x-cloud-trace-context: ee1bfd1bd8a71d5c9504dd1470e94e3d
via: 1.1 google
alt-svc: h3=":443"; ma=86400
cf-cache-status: MISS
set-cookie: __cf_bm=1Kyf3eKC6L4mKAJT9Cz1E0LY.IxXcLOWUxVTFG76hVQ-1760226217-1.0.1.1-TxFnca0jAP0UOIav0sDZcjShBpXScXzd0l8Wg5ajYl1bsN0Sv091i9VvqJcwWpCkE60jwkGabVau25WCcmK0gNyL767yhIuoRWb0OX_sxUE; path=/; expires=Sun, 12-Oct-25 00:13:37 GMT; domain=.claude.com; HttpOnly; Secure; SameSite=None
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
server: cloudflare
HTTP/2 307
date: Sat, 11 Oct 2025 23:43:38 GMT
content-type: text/html
content-length: 169
location: https://docs.claude.com/en/docs/agents-and-tools/tool-use/token-efficient-tool-use
cache-control: private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0
expires: Thu, 01 Jan 1970 00:00:01 GMT
vary: Accept-Encoding
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
server: cloudflare
cf-ray: 98d23886b87095be-BLR
alt-svc: h3=":443"; ma=86400
HTTP/2 200
date: Sat, 11 Oct 2025 23:43:38 GMT
content-type: text/html; charset=utf-8
content-encoding: gzip
x-frame-options: DENY
content-security-policy: worker-src * blob: data: 'unsafe-eval' 'unsafe-inline'; object-src data: ; base-uri 'self'; upgrade-insecure-requests; frame-ancestors 'none'; form-action 'self' https://codesandbox.io;
x-middleware-rewrite: /_sites/docs.claude.com/en/docs/agents-and-tools/tool-use/token-efficient-tool-use
vary: RSC, Next-Router-State-Tree, Next-Router-Prefetch, Next-Router-Segment-Prefetch, Accept-Encoding
x-nextjs-cache: HIT
x-nextjs-prerender: 1
x-nextjs-stale-time: 60
x-powered-by: Next.js
cache-control: s-maxage=31536000
via: 1.1 google
alt-svc: h3=":443"; ma=86400
cf-cache-status: HIT
age: 189161
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
server: cloudflare
cf-ray: 98d23886c87695be-BLR
Token-efficient tool use - Claude Docs Developer Guide API Guide
First steps
Models & pricing
Learn about Claude
Capabilities
Tools
Model Context Protocol (MCP)
Prompt engineering
Tools
Token-efficient tool use
Claude Sonnet 3.7 is capable of calling tools in a token-efficient manner. Requests save an average of 14% in output tokens, up to 70%, which also reduces latency. Exact token reduction and latency improvements depend on the overall response shape and size.
To use this beta feature, simply add the beta header
The above request should, on average, use fewer input and output tokens than a normal request. To confirm this, try making the same request but remove
Token-efficient tool use is a beta feature. Please make sure to evaluate your responses before using it in production.Please use this form to provide feedback on the quality of the model responses, the API itself, or the quality of the documentation—we cannot wait to hear from you!
If you choose to experiment with this feature, we recommend using the Prompt Improver in the Console to improve your prompt.
Token-efficient tool use does not currently work with
disable_parallel_tool_use
.Claude 4 models (Opus 4.1, Opus 4, and Sonnet 4) do not support this feature. The beta header token-efficient-tools-2025-02-19
will not break an API request, but it will result in a no-op.token-efficient-tools-2025-02-19
to a tool use request. If you are using the SDK, ensure that you are using the beta SDK with anthropic.beta.messages
.
Here’s an example of how to use token-efficient tools with the API:
Copy
curl https://api.anthropic.com/v1/messages \
-H "content-type: application/json" \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: token-efficient-tools-2025-02-19" \
-d '{
"model": "claude-3-7-sonnet-20250219",
"max_tokens": 1024,
"tools": [
{
"name": "get_weather",
"description": "Get the current weather in a given location",
"input_schema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": [
"location"
]
}
}
],
"messages": [
{
"role": "user",
"content": "Tell me the weather in San Francisco."
}
]
}' | jq '.usage'
token-efficient-tools-2025-02-19
from the beta headers list.
To keep the benefits of prompt caching, use the beta header consistently for requests you’d like to cache. If you selectively use it, prompt caching will fail.
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.