count_tokens_file
Count tokens in a UTF-8 file using model-specific tokenizers, with optional model or encoding name for accurate token counts.
Instructions
Count tokens in a UTF-8 file.
Args:
file_path: Absolute path to the file.
model: Model or encoding name. Empty uses ANTHROPIC_TOKEN_COUNT_MODEL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |