What token pricing measures
Language model APIs commonly measure text in tokens. Input tokens cover instructions and context sent to the model, while output tokens cover the generated response. Provider pricing pages list these directions separately for many models.
A long conversation can cost more over time when previous messages are sent again as input context. The visible response is therefore only one part of request usage.
Estimate the complete request
Cost estimates should include system instructions, retrieved documents, tool results, conversation history, and expected response length. Evaluate typical and high-percentile requests rather than relying on one short example.
For multimodal systems, check the exact provider pricing unit. Images, audio, video, cached input, storage, and tools can be billed differently from ordinary text tokens.
Reduce cost without losing quality
Trim repeated context, limit output length, use provider-supported caching for stable prompt sections, and test smaller models on straightforward tasks. Confirm each optimization against current provider documentation and your own evaluation set.
Track quality and cost together. A low-cost request is not useful when weak output causes retries or manual review.
