QUICK ANSWER
Claude Token Calculator
A Claude token calculator applies the selected Claude model’s current Anthropic rates to its recorded usage categories. Calculate standard input, output, cache creation, and cache-read usage separately when they apply. For a completed request, use the usage object returned by the Claude API.
Start with the exact Claude model
Anthropic publishes model-specific input and output rates. A useful calculation identifies the model before applying a rate because pricing and supported context can differ between Claude models and versions.
Do not merge every input category
When prompt caching is used, Anthropic reports cache creation and cache-read input separately from standard input usage. Those categories can have different rates, so each category should be calculated independently before the charges are added.
Count the complete API request
Claude input can include system instructions, conversation messages, images, documents, tool definitions, and tool results in addition to the visible user prompt. Anthropic’s token-counting API can estimate input tokens before a request, while the response usage object records completed usage.
Use the correct next step
Use the Token Cost Kit homepage to compare token-based model costs. The OpenAI Token Counter is specifically for OpenAI encodings and should not be treated as an exact Claude tokenizer. Read Counter Token when the phrase itself needs clarification.