An LLM never sees raw text. So what does it process?
A token is the smallest unit a language model reads or writes. It is not a character and it is not a word. It is usually a sub-word chunk of bytes that the tokenizer has assigned an integer id.
The flow is simple. Before the model sees your prompt, a tokenizer splits the text into pieces and looks up an id for each piece. The model only ever processes those ids. When it generates a reply, it emits ids, and the tokenizer turns the ids back into text. The model never touches raw characters.
The same string can produce different token counts under different tokenizers. The word 'embedding' is a single token in tiktoken's o200k_base, but two tokens in GPT-2's smaller vocabulary. There is no universal answer to 'how many tokens is this'; it depends on which tokenizer.
API pricing is per token. Context window limits (how much text fits at once) are in tokens. Generation speed is tokens per second. Anything you measure about an LLM in dollars, memory, or latency is measured in tokens, not in characters or words.