Understand tokens and every API call
Learn the basics of input, output, and cached usage.
Tokens are not characters
Models split input into tokens. Chinese, English, and code of equal length can have different token counts. Tokenization varies by model; no fixed character ratio gives an exact conversion.
Distinguish input from output
Input usually includes system prompts, previous messages, and the current question. Output is generated content. Their rates can differ; check the actual model and group billing rules.
Optimize using usage records
Look for repeated context and unnecessarily long outputs, then adjust history length and task descriptions. If using caching, verify the channel’s actual support and pricing.