AIWiki
Malaysia
Back to all articles
AI Foundationstokensinferencecost

Token economics

4 min readUpdated November 2026
Token Economics
Type
Cost model for language models
Unit
Token (subword unit)
Main drivers
Model size, context length, hardware utilisation
Levers
Caching, batching, quantization, routing
Emerged
2020s with API-based LLM usage
Related
Tokenisation, LLM Inference, Quantization
Token economics is the study of what it actually costs to run large language models and how that cost is measured, priced and reduced. Everything a model reads or writes is counted in tokens — subword units produced by a tokenizer — and nearly all commercial access to language models is metered on them. The economics of those tokens is shaped by model size, how much context is held in memory, and how efficiently the underlying hardware is used.[1][2]

Background

Because transformer inference is memory-bound — the GPU spends most of its time moving weights and activation data rather than computing — the cost of serving a model depends heavily on how quickly memory can feed the arithmetic. Two consequences follow: larger models cost more per token, and faster hardware with more memory bandwidth lowers the cost of every token produced. Over the 2020s the price of a given level of model capability fell repeatedly as models became more efficient and hardware improved, a trend the field summarises as the bitter lesson of scalable methods beating hand-crafted ones.[3][4]

Providers price input and output tokens separately: reading a prompt is cheaper than producing a response, because output is generated one token at a time while input is processed in parallel. Long conversations therefore grow more expensive as the entire history is re-sent with each turn.[1][2]

Key concepts

  • Input vs output tokens. Input (prompt) processing is parallel and cache-friendly; output generation is sequential and latency-bound, so providers quote different rates for each.[1]
  • Context length. Every additional token in the context must be stored and attended to for the duration of the request, which raises both memory use and cost.[5]
  • Prompt caching. Repeated prefixes of a conversation or a long system prompt can be stored and reused across requests, cutting the work for those tokens substantially.[1]
  • Batching. Work submitted asynchronously for later processing is served on spare capacity and is priced lower than interactive traffic.[2]
  • Reasoning tokens. Models that deliberate before answering consume output tokens for their internal reasoning, which is billed even though it never appears in the reply.[1]
  • Active parameters. In a mixture-of-experts model only a fraction of parameters handle each token, so a very large model can cost far less to run than its total size implies.[4]
  • Self-hosting vs API. Running open-weight models on owned or rented GPUs replaces per-token fees with hardware and operations cost; the break-even depends on volume, required throughput and how well the hardware is utilised.[5]

Applications

Teams apply token economics when choosing a model, designing prompts, structuring agent loops and forecasting budgets. Typical measures include cost per completed task rather than cost per token, tokens per second per device, and cache-hit rate. Techniques include routing easy requests to smaller models, trimming retrieved context before sending it, keeping prompts compact, and quantizing weights to reduce memory footprint when self-hosting.[3][5]

>See Also

🇲🇾Malaysian Context

🇲🇾 Relevance to Malaysia: most Malaysian businesses consume language models through APIs rather than operating their own clusters, so token pricing directly affects the feasibility of AI features in local products — from customer-service chatbots to document summarisation for SMEs. Because costs are quoted in foreign currency and metre in tokens, finance teams budgeting AI spend need to forecast usage in tokens, not seats. Local developers optimise in familiar ways: shorter system prompts, retrieval that returns only the needed passages, caching for repeated contexts, and routing to cheaper models where quality allows. Malaysia's National AI Office and MDEC push for applied AI adoption, while the Personal Data Protection Act means documents containing personal data sent to external model providers must be handled under a lawful basis — a constraint that sometimes favours self-hosted or in-region deployment even when it costs more per token.

References

  1. ↑OpenAI. Usage and pricing documentation. https://platform.openai.com/docs/pricing
  2. ↑Google. Gemini API pricing. https://ai.google.dev/gemini-api/docs/pricing
  3. ↑Sutton R. The Bitter Lesson. 2019. http://www.incompleteideas.net/IncIdeas/BitterLesson.html
  4. ↑DeepSeek-AI. DeepSeek-V3 Technical Report. arXiv:2412.19437. https://arxiv.org/abs/2412.19437
  5. ↑Hoffman J. et al. Training Compute-Optimal Large Language Models. arXiv:2203.15556. https://arxiv.org/abs/2203.15556