What a token actually is
The unit you're billed in, and how to estimate it without a calculator.
Everything about model pricing is per token, so it helps to know roughly what one is.
The rough rule
A token is a chunk of text, usually part of a word. In English, one token is about four characters, or about three quarters of a word. A million tokens is roughly 750,000 words.
That's close enough for estimating. Don't reach for precision you don't need.
What it means for your files
A 500-line source file is very roughly 5,000 to 7,000 tokens. A long README might be 2,000. A dense API response can be far more than it looks, because JSON keys, punctuation and whitespace all count.
The practical consequence: pasting your whole project into a chat costs real tokens on every turn, because the entire conversation is resent with each message. That's the single biggest hidden cost in casual vibe coding.
What counts
Everything in the request: your system prompt, every previous message in the conversation, every tool definition, every tool result, every file you pasted. And everything in the response, including the model's thinking.
Input and output are priced differently, with output at five times the input rate on every current model. Thinking bills as output.
Counting it properly
If you're building on the API and need real numbers, use the token counting endpoint rather than guessing or reaching for a third-party tokenizer library. Those libraries are built for other providers' models and give wrong answers for Claude.
I need to know how many tokens this actually is before I send it: <paste, or name the file> Use the Anthropic token counting endpoint, not a third-party tokenizer library. Show me the call, then the count broken down by system prompt, tools, and messages. Then tell me what that costs at <model> rates, in and out.
One thing that trips people up
Different Claude models tokenize the same text differently. The newer models produce roughly 30% more tokens for identical input. That makes raw price-per-token comparisons across generations misleading, and it's worth understanding before you conclude one model is cheaper. See the tokenizer changed.
If you're estimating, use four characters per token and round up. If you're budgeting a product, measure it. The gap between those two is where surprises live.