Skip to main content
Get the number of tokens required for creating a message, including tools, images, and documents, without creating it.
External DocumentationTo learn more, visit the Anthropic documentation.

Basic Parameters

ParameterDescription
Adaptive Thinking EffortSelect the thinking depth to guide adaptive thinking behavior.

* low - Minimize thinking. Best for simple, speed-sensitive tasks.
* medium - Use moderate thinking. May skip thinking for very simple queries.
* high - Always think with deep reasoning on complex tasks. This is the default when omitted.
* xhigh - Think deeply with extended exploration. Not supported on all models.
* max - Think with no constraints on depth. Not supported on all models.

Note: Only applicable when Thinking is set to adaptive.

For more information about the Adaptive Thinking Effort parameter, visit Anthropic documentation.
Disable Parallel Tool UseWhen checked - restrict the model to use at most one tool at a time and preventing parallel tool usage.
MessagesThe content of the current conversation with the model.

For example:
[
{“role”: “user”, “content”: “Hello there.”},
{“role”: “assistant”, “content”: “Hi, I’m Claude. How can I help you?”},
{“role”: “user”, “content”: “Can you explain LLMs in plain English?”}
]
For more information about the Messages parameter, visit Anthropic documentation for more details.
ModelThe model that will complete your prompt.
ThinkingThe extended thinking to use before responding.

* enabled - Use a fixed token budget for internal reasoning. Not supported on all models.
* adaptive - Let the model decide when and how much to think. Use Adaptive Thinking Effort to control thinking depth. Recommended for models that support adaptive thinking.
* disabled - Do not use extended thinking.

Notes:
* When set to enabled, a minimum budget of 1024 tokens is required.
* Thinking can be used together with Tools in the same request. When thinking is enabled, set Tool Choice to auto or none only. With adaptive thinking, the model can reason between tool calls.

For more information about the Thinking parameter, visit Anthropic documentation.
Thinking Budget TokensThe number of tokens the model can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems which improves response quality.

Note: Must be at least 1024.
Tool ChoiceDefine how the model should use the provided tools.

The model can:
* auto - Decide by itself.
* any - Use any available tool.
* tool - Use a specific tool.
* none - Not use tools at all.

Note: This parameter may only be specified while providing Tools.
Tool Choice NameThe name of the tool to use.
ToolsDefinitions of tools that the model may use.

Each tool definition includes:
* name - Name of the tool.
* description - Optional, but strongly-recommended description of the tool.
* input_schema - JSON schema for the tool input shape that the model will produce in tool_use output content blocks.

For example:
[
{
“name”: “get_stock_price”,
“description”: “Get the current stock price for a given ticker symbol.”,
“input_schema”: {
“type”: “object”,
“properties”: {
“ticker”: {
“type”: “string”,
“description”: “The stock ticker symbol, e.g. AAPL for Apple Inc.”
}
},
“required”: [“ticker”]
}
}
]
Note: Tools can be used together with Thinking in the same request. When thinking is enabled, set Tool Choice to auto or none only. For multi-turn tool use, include thinking blocks from prior responses in Messages.

For more information about the Tools parameter, visit Anthropic documentation.

Advanced Parameters

ParameterDescription
System InstructionsContext and instructions to provide to the model, such as specifying a particular goal or role.

For example:
You are a seasoned data scientist at a Fortune 500 company.
For more information about the System parameter, visit Anthropic documentation.

Example Output

{
	"input_tokens": 2095
}

Workflow Library Example

Count Message Tokens with Anthropic and Send Results Via Email
Workflow LibraryPreview this Workflow on desktop