AI & Machine Learning

Token Pricing

Also known as: token cost, LLM pricing, API token cost, prompt tokens, completion tokens

Token pricing is the billing model used by AI API providers like OpenAI, Anthropic, and Google to charge for large language model usage.

A token is roughly equivalent to four characters of text (about three-quarters of a word). Providers charge separately for input tokens (the text sent to the model, including the system prompt and any context) and output tokens (the text generated by the model). Prices vary by model, with more capable models costing significantly more per token. Understanding token pricing is essential for estimating API costs when building AI-powered products.

Token Pricing, explained at three levels

At home

When you use an AI through an API (the way software connects to AI), you pay per token. A token is roughly a short word -- 'cat' is one token, 'unbelievable' might be three. Every word you send to the AI costs money (input tokens) and every word it sends back costs money (output tokens). The more you send and receive, the more you pay. This is why you might notice AI products showing 'monthly usage' -- they are tracking tokens to calculate your bill.

At work

Token pricing matters for businesses building AI-powered products because API costs can scale unexpectedly. A customer service bot that handles 10,000 conversations per day, each with a 2,000-token context, is processing 20 million tokens daily. At typical current pricing for mid-tier models, that might cost hundreds to thousands of dollars per day. Understanding token consumption per workflow is the first step in estimating whether an AI feature is economically viable.

Real-world examples

At home

Aisha built a personal AI writing helper using an API key. She did not realize that her very long system prompt was being sent with every single request, costing her 2,000 tokens per conversation even before she typed anything. When her monthly bill came to $85, she reviewed her token usage, rewrote her system prompt to be 80% shorter, and saw her bill drop to $18 the following month.

At work

The product team at a SaaS company had built an AI feature using GPT-4 and were surprised when the AI API bill for their first month of beta testing was $12,000 -- far above budget. An audit showed that the product was including the user's entire work history (averaging 50,000 tokens) in every API call. They introduced a relevance-based retrieval system that selected only the 2,000 most relevant tokens from history, reducing the bill to $800 per month with no measurable quality degradation.

Common confusions

  • Tokens are not the same as words. A word like 'the' is one token; a technical term like 'supercalifragilistic' might be four tokens. Code and mathematical notation are particularly token-expensive because tokenizers are optimized for natural language prose. When estimating costs, use token counting tools (most providers offer tokenizer libraries) rather than word counting.
  • Input tokens and output tokens are priced differently. Output tokens (the text the model generates) typically cost 3-5x more per token than input tokens (the text you send to the model). A long model response is more expensive than a long prompt. For applications where you need structured short outputs (classification labels, yes/no, extracted fields), limiting output tokens aggressively reduces costs significantly.
  • API pricing changes frequently. Token prices for popular models have generally decreased significantly over time as providers achieve scale and efficiency. Cost estimates made six months ago may be significantly higher than current pricing. Check the provider's current pricing page before finalizing cost models, and build cost per model into your monitoring rather than assuming it is stable.

For analysts

In BA artefacts, token pricing generates cost estimation and monitoring requirements. When documenting requirements for an AI feature, include a token budget estimate: expected tokens per call (system prompt + context + user message + output), expected call volume per day, and resulting monthly cost estimate per model tier. Specify monitoring NFRs: 'The system must log input and output token counts per API call, report daily aggregates by workflow type, and alert when daily token spend exceeds 120% of the baseline estimate.' This makes AI API cost a managed, visible operating cost rather than a surprise.

History & origin

Token-based pricing emerged alongside the first commercial LLM APIs in the early 2020s. OpenAI established the pattern with GPT-3 pricing in 2020, charging per 1,000 tokens. As the market matured, providers began differentiating pricing between input and output tokens (output being typically 3-5x more expensive than input), between models at different capability levels, and between standard and batch pricing. Caching mechanisms (where repeated context is stored and not re-billed on subsequent calls) were introduced from 2024 to reduce costs for applications with large, repeated system prompts.