> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Count Message Tokens

Get the number of tokens required for creating a message, including tools, images, and documents, without creating it.

<Note>
  External Documentation

  To learn more, visit the [Anthropic documentation](https://docs.anthropic.com/en/api/messages-count-tokens).
</Note>

## Basic Parameters

<div className="integrations-table">
  | Parameter                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
  | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Disable Parallel Tool Use | When checked - restrict the model to use at most one tool at a time and preventing parallel tool usage.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | Messages                  | The content of the current conversation with the model.<br /><br />For example:<br /><pre><code>\[<br />  \{"role": "user", "content": "Hello there."},<br />  \{"role": "assistant", "content": "Hi, I'm Claude. How can I help you?"},<br />  \{"role": "user", "content": "Can you explain LLMs in plain English?"}<br />]</code></pre>For more information about the `Messages` parameter, visit [Anthropic documentation](https://docs.anthropic.com/en/docs/about-claude/models/all-models) for more details.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
  | Model                     | The model that will complete your prompt.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
  | Thinking                  | When set to `enabled`, responses include thinking content blocks showing the model's thinking process before the final answer.<br /><br />**Note**: Requires a minimum budget of `1024` tokens.<br /><br />For more information about the `Thinking` parameter, visit [Anthropic documentation](https://docs.anthropic.com/en/docs/build-with-claude/extended-thinking).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
  | Thinking Budget Tokens    | The 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.<br /><br />**Note**: Must be higher than `1024` and less than the `Max Tokens` value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | Tool Choice               | Define how the model should use the provided tools.<br /><br />The model can:<br />\* `auto` - Decide by itself.<br />\* `any` - Use any available tool.<br />\* `tool` - Use a specific tool.<br />\* `none` - Not use tools at all.<br /><br />**Note**: This parameter may only be specified while providing `Tools`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
  | Tool Choice Name          | The name of the tool to use.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
  | Tools                     | Definitions of tools that the model may use.<br /><br />Each tool definition includes:<br />\* `name` - Name of the tool.<br />\* `description` - Optional, but strongly-recommended description of the tool.<br />\* `input_schema` - JSON schema for the tool input shape that the model will produce in `tool_use` output content blocks.<br /><br />For example:<br /><pre><code>\[<br />  \{<br />    "name": "get\_stock\_price",<br />    "description": "Get the current stock price for a given ticker symbol.",<br />    "input\_schema": \{<br />      "type": "object",<br />      "properties": \{<br />        "ticker": \{<br />          "type": "string",<br />          "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."<br />        }<br />      },<br />      "required": \["ticker"]<br />    }<br />  }<br />]</code></pre>For more information about the `Tools` parameter, visit [Anthropic documentation](https://docs.anthropic.com/en/api/messages#body-tools). |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter           | Description                                                                                                                                                                                                                                                                                                                                                                                 |
  | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | System Instructions | Context and instructions to provide to the model, such as specifying a particular goal or role.<br /><br />For example:<br /><pre><code>You are a seasoned data scientist at a Fortune 500 company.</code></pre>For more information about the `System` parameter, visit [Anthropic documentation](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/system-prompts). |
</div>

## Example Output

```json theme={"dark"}
{
	"input_tokens": 2095
}
```

## Workflow Library Example

[Count Message Tokens with Anthropic and Send Results Via Email](https://library.blinkops.com/workflows/count-message-tokens-with-anthropic-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/count-message-tokens-with-anthropic-and-send-results-via-email/canvas" />
</div>
