Units used by the model
A language model cuts the content into units called tokens. According to the tokenizer, a unit can correspond to a word, a part of a word or a sign. The cutting varies with the model and language. Therefore, a fixed rule should not be used as "a word equal to a token" to provide for an exact limit or invoice.
The term token may also refer to authentication data. This is not the same use: a text token is a processing unit; an access token allows a request. When reading documentation, check what meaning it is.
Entrance, exit and historical
The input tokens correspond to the information processed for the request. Depending on the route, they can include your instructions, documents and history transmitted. Output tokens concern the product content. Some offers also distinguish the cache or other categories of consumption. Consult the units actually indicated by the supplier rather than deduct the cost of the only visible length of the response.
Count and control the length
Use the meter or documented method for the chosen model when you need a specific result. The number of characters gives only an order of magnitude. An output limit can prevent a complete response; a context window is about the content that the model can handle under documented conditions. These two limits must be distinguished.
To reduce unnecessary work, provide relevant documents, remove repetitions and request an appropriate format. Do not shorten the time to remove important rules. Measure quality and consumption together: a less expensive response that requires several times is not necessarily an improvement.
Questions before you start
Does a token always match a word?
No. The cutting depends on the tokenizer, content and language.
Are tokens a digital currency?
In this context, they represent units processed by a model; they are not cryptocurrency.
Can the exact cost be calculated with the number of characters?
No. Use the supplier's units and meters for the relevant model and route.