In this article
When talking about AI pricing, most people look at a single number in a table and assume that's what they'll pay. The reality is more nuanced. The actual cost of an artificial intelligence API depends on several multiplying factors, and those who only look at the list price often face surprises.
This article explains how token pricing truly works in AI APIs, so you can accurately estimate costs and understand where the levers are.
The basics: price per million tokens
Almost all AI APIs charge in the same way: per million tokens processed, with separate values for input and output. Remember that one million tokens is equivalent to about 750,000 words. If it isn't yet clear what counts as a token, start with what an AI token is.
The calculation for a call is straightforward:
cost = (input tokens ÷ 1 million × input price) + (output tokens ÷ 1 million × output price)
Practical example: a call with 10,000 input tokens and 2,000 output tokens, using a model priced at $2.50 for input and $15 for output per million (GPT-5.4, in September 2026), costs about 2.5 cents for input plus 3 cents for output. Five and a half cents in total. Seems like nothing. Multiply that by one million calls per month and you're talking tens of thousands of dollars.
Input costs less, output costs more
The rule that all providers follow: output is more expensive than input, typically in a five-to-one ratio. It makes sense; generating text requires more computational work than reading it.
The practical consequence is important. Applications that generate long responses, such as content writing or reports, have their cost dominated by output. Applications that process a lot of context but respond little, such as classification or data extraction, have their cost dominated by input. Knowing which category you're in indicates where to optimize.
The levers that change the real price
Here's what almost no one sees in the price table. Providers offer mechanisms that drastically alter the effective cost.
Prompt caching. If you reuse the same part of the prompt in multiple calls, such as long system instructions or a context document, caching allows you to store it in memory. Subsequent reads of that part become at least 90 percent cheaper. For agents and applications with repeated context, this is the most significant saving.
Batch processing. If your tasks don't require an immediate response, you can send them in a batch and accept that they will be processed within a timeframe set by the provider. In return, the price drops by 50 percent across all models. Ideal for processing large volumes asynchronously.
Model selection. This is the biggest lever of all. The price per token varies by more than a hundred times between the cheapest and most expensive model from the same provider. Using a top-tier model for a simple task is pure waste.
Hidden costs to consider
Beyond the price per token, there are factors that inflate the bill without appearing on the headline:
- Growing context. In long conversations, each new turn resends the entire history as input. The cost of a conversation grows with each message.
- Extended reasoning. Models that think more before responding generate internal tokens that are also billed.
- Tokens per language. The same text in Portuguese generates more tokens than in English, thus costing a little more.
How to think about cost the right way
The professional way to look at this is not the isolated list price, but the cost per completed task. A task that needs a lot of context and long responses from an expensive model can cost cents. The same task, optimized with caching, batching, and the appropriate model, can cost a fraction of that, with the same quality.
Conclusion
The price of an AI API is not a number; it's an equation. Input and output have different prices, output may or may not dominate depending on the use case, and mechanisms like caching, batching, and model selection can reduce the effective cost by 90 percent or more. Those who master these levers build sustainable products. Those who only look at the table risk an uncontrolled budget.
The next step is to compare the actual prices among the main providers and understand where each makes the most sense.
From the token bill to the project cost
Tokens are the small part of an AI project's cost. Most of it sits in integrating with the systems you already have, preparing the data and changing how the team works. To do the full sum, see how much it costs to implement AI in a company, how to measure AI ROI and the automation ROI calculator.
Sources
Discounts checked on 27 October 2026 on the official pricing pages: on the current models of all three providers, reading cached tokens costs 10% of the input price or less (5% on Opus 5.5, Sonnet 5.5, GPT-6.1 sol and Gemini 4 Argon, 2.5% on Fable 5.1; Google adds an hourly storage cost), and batch processing is 50% off at all three. The example uses GPT-5.4 pricing ($2.50 / $15 per million).
Writes about AI consulting for operations and processes: how to map and simplify processes, apply AI where it has the most impact and measure the gains.
