ComfyUI Node
Claude Token Counter
Count tokens and estimate API costs for Claude models.
Claude Token Counter
- client
- token_count
- summary
◄text►
◄modelclaude-sonnet-5►
CategoryERPK/Claude
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| text | STRING | Text to count tokens for | |
| model | COMBO | claude-sonnet-5 | Model for token counting and cost estimation |
| clientopt | CLAUDE_API_CLIENT | Optional: Connect client for accurate API-based counting (otherwise uses ~4 chars/token estimation) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| token_count | INT | — |
| summary | STRING | — |