Inference cost

Also known as: cost of inference

On this page 7

Inference cost is the recurring expense of running a trained model to produce outputs, such as generated text, classifications or embeddings, as opposed to the one-time expense of training it. In AI in business, the cost of inference is usually expressed per million tokens, per request or per hour of GPU time, and it scales directly with usage, which makes it the dominant operating cost of production AI for most organizations.

Unlike AI training cost, which is incurred once per model version, inference cost grows with every user, every document and every agent step. A pilot that costs a few hundred dollars a month can become a six- or seven-figure annual line item once it reaches full adoption, so finance and engineering teams treat inference economics as a design constraint rather than an afterthought.

What drives the cost of inference

The cost of inference is determined by the compute and memory consumed per output, multiplied by the price of that capacity. For large language models, the main drivers are model size, the number of input and output tokens, the hardware used and how efficiently requests are batched on that hardware.

Output tokens are typically three to five times more expensive than input tokens on commercial APIs, because generation happens one token at a time and cannot be parallelized as well as reading the prompt. Long contexts add cost through the key-value cache, which occupies accelerator memory and limits how many requests can share one GPU.

The following table summarizes the principal cost drivers and how each one shifts the bill.

DriverEffect on costTypical lever
Model sizeLarger models need more compute per tokenRoute simple tasks to smaller models
Output lengthEach generated token is priced at a premiumSet length limits and concise formats
Context lengthLong prompts raise input charges and memory useRetrieve only relevant passages
Batch utilizationIdle accelerators still cost moneyBatch requests and share capacity
Latency targetFaster responses need reserved headroomUse asynchronous or batch tiers
Agent stepsEach tool call adds another model invocationCap iterations and cache results
Main drivers of inference cost

Pricing models for inference

Organizations pay for inference through one of several commercial arrangements, and the choice changes both the unit price and the financial risk. Token-based pricing through a model-as-a-service API converts inference into a pure variable cost, while self-hosting on owned or rented GPUs converts much of it into a fixed cost that becomes cheaper only at high, steady utilization.

The table below compares the common models from the buyer’s perspective.

Pricing modelUnit of chargeBest fitMain risk
Pay-per-token APIInput and output tokensVariable or early-stage workloadsBills grow with uncontrolled usage
Batch API tierDiscounted tokens, delayed resultsOffline document processingResults arrive in hours, not seconds
Provisioned throughputReserved capacity per hour or monthPredictable high-volume trafficPaying for unused capacity
Self-hosted open modelGPU hours plus operations staffVery high volume or strict data rulesEngineering effort and idle hardware
Per-seat software licenseUsers per monthPackaged assistants for employeesVendor absorbs cost, then raises prices
Common inference pricing models

Many providers also offer prompt caching, which charges a reduced rate for repeated prompt prefixes such as long system instructions. For workloads that reuse the same context across many calls, caching can cut input charges by well over half, although the exact discount and cache lifetime vary by provider.

Inference cost is one component of the total cost of ownership of an AI system, and it is often confused with neighboring concepts. Separating them matters because each is controlled by different decisions and owned by different teams.

ConceptWhat it measuresWhen it is incurred
Inference costCompute to serve each predictionContinuously, with every request
AI training costCompute and data to create a modelOnce per model version
Fine-tuning costAdapting an existing model to a taskOccasionally, per adaptation cycle
AI capital expenditureData centers and acceleratorsUpfront, then depreciated
Total cost of ownershipAll costs including staff and integrationOver the full system life
How inference cost differs from related concepts

At the industry level, the share of spending devoted to inference has grown as models moved from research into products. Reasoning models, which generate long internal chains of thought before answering, have reinforced this shift because they can consume ten times or more tokens per answer than a standard model on the same question.

How organizations reduce inference cost

Inference cost is reduced by matching the model to the task and by eliminating wasted tokens. The most effective measures are architectural rather than contractual, and they usually deliver larger savings than negotiating a lower unit price.

TechniqueHow it saves moneyTypical trade-off
Model routingSends easy requests to a cheap modelNeeds a reliable classifier
QuantizationRuns weights at 8 or 4 bitsSmall accuracy loss on some tasks
DistillationTrains a small model on large-model outputsUpfront training effort
Semantic cachingReuses answers to similar questionsRisk of stale or mismatched answers
Prompt compressionRemoves redundant contextMay drop useful details
Batch processingUses discounted non-urgent tiersHigher latency
Practical cost reduction techniques

Measurement comes first. Teams practicing AI FinOps tag every request with the product feature, customer and model that generated it, then report cost per successful task rather than cost per token. A cheaper model that needs three retries to finish a task is not cheaper in practice.

Common mistakes in estimating inference cost

Inference budgets are frequently wrong because early estimates use pilot traffic and short prompts, which rarely resemble production behavior. Several recurring errors explain most budget overruns.

  • Ignoring output tokens: estimating only from prompt size understates the bill, since outputs carry the higher price.
  • Underestimating agent loops: an AI agent may call the model 10 to 50 times for a single user goal.
  • Assuming falling prices solve the problem: per-token prices have dropped sharply, yet usage typically grows faster, so total spending still rises.
  • Forgetting hidden reasoning tokens: reasoning models bill for internal tokens that the user never sees.
  • Treating self-hosting as free: owned GPUs carry depreciation, power, staff and idle-time costs.

A sound AI business case therefore models inference cost as a function of adoption, with low, expected and high usage scenarios, and links it to the value each request creates. This connection is what determines AI return on investment.

A non-technical view

Building an AI model is like building a factory. Inference is running that factory every day. Each answer the AI gives costs a small amount of electricity and computer time.

One answer is cheap. Millions of answers are not. That is why inference cost grows as more people use the tool. A company pays it every month, not once.

The key idea is simple. Use the smallest model that does the job well, and avoid asking the AI for more text than needed.

A concrete example

A mid-sized insurance company deploys a language model to summarize incoming claim documents. Each claim averages about 6,000 input tokens and 800 output tokens, and the company processes roughly 40,000 claims per month. Using a large frontier model through a pay-per-token API, the monthly bill reaches several thousand dollars, and projections show it tripling within a year as more claim types are added.

The team then routes standard claims to a smaller, cheaper model and reserves the large model for complex cases, which make up about 15 percent of volume. Because summaries are not needed instantly, overnight processing moves to a discounted batch tier. Shared instructions are placed at the start of every prompt so that prompt caching applies.

After three months, the company reports a cost reduction of roughly 70 percent per processed claim, while reviewer satisfaction scores remain unchanged. The finance team now tracks cost per summarized claim as a standing operational metric.