count_tokens
Count input tokens for a Claude model prompt before sending, including optional system prompt, to estimate token usage and costs.
Instructions
Count the input tokens a prompt would consume for a given Claude model, without sending it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Model id to count against (counts are model-specific). Defaults to the same model `ask_claude` uses. | |
| prompt | Yes | The prompt whose token count you want. | |
| system | No | Optional system prompt to include in the count. |