count_tokens
Count token usage for any text across supported AI models. Select a model to get exact or approximated token counts.
Instructions
Count how many tokens a piece of text would use for a given model.
Args: text: Your text/prompt to tokenize model: Model name, e.g. "claude-sonnet-5", "gpt-5". Call list_supported_models to see all options.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| model | No | claude-sonnet-5 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |