All blogs
10 mins
LLM Inference Cost: What Actually Drives AI Inference Costs?
Piyush-Kalra
Two teams can run the same model and end up with very different bills. One team caps output and routes simple tasks to smaller models. The other lets users make multiple tool calls and uses larger models for every task. Same per-token rate. Very different bills.
Pricing pages don't show that. A rate card shows the price per token. But it doesn't show how many tokens your workload consumes, how many model calls each user action triggers, or how efficiently your GPUs are utilized.
The right question to ask isn't, “What is this model’s cost per million tokens?” The right question to ask is, “How efficiently does my workload use compute to create useful output?” That is what this article I will aims to show.
What Is LLM Inference Cost?
There are costs associated with training models. Think of training as building a factory, and every time a customer places an order, you have to run that factory, which costs money.
Training cost is the cost associated with building, training, or fine-tuning a model. This cost can be high upfront but may recur if the model is updated or retrained.
Inference cost is the cost associated with serving model requests. This includes chat responses, API requests, agent steps, and background tasks. As usage of the model increases, inference costs typically increase as well.
There are two main ways to perform inference:
API inference: With this option, you pay for the resources your API requests consume. Some APIs charge based on input and output tokens, while others may have different rates for capabilities such as reasoning or cached input.
Self-hosted inference: With this option, you pay for the infrastructure needed to run the model, including GPUs, memory, storage, networking, and serving software. The actual cost also depends on how efficiently that capacity is used.
Both approaches can work well, but which one is more cost-effective depends on your workload, including request volume, traffic patterns, model choice, and infrastructure needs.
What Actually Drives LLM Inference Cost?

Token price is the starting point. Workload and infrastructure affect what you actually pay.
1. Model Size and Model Selection
Larger models generally require more compute to run. Parameter count, architecture, and capability tier all affect how much a request costs. Depending on the models being compared, a frontier model can cost 10 to 20 times more per token than a smaller, capable model.
The problem is that teams often use the same expensive model for every request, even when a simpler task would work just as well with a smaller model. A classification task doesn't need the same model as a complex reasoning task.
The fix is model routing: send simple, predictable work to smaller models and reserve more capable models for tasks that need them. Savings can be substantial, but they depend on the workload and whether the less expensive model delivers the required quality.
2. Input Tokens and Context Length
Every input token contributes to the processing and, for most APIs, the cost of a request. Conversation history, retrieved documents, system prompts, and tool definitions can quickly increase the total number of tokens.
The problem is that applications often send more context than a task actually needs. An untrimmed conversation history or an overly broad retrieval step can significantly increase input-token consumption.
Fix it by retrieving only what's relevant, compressing context where possible, trimming conversation history, and using prompt or prefix caching for repeated content. Depending on the provider, cached input can receive discounts of 50% to 90% or more.
3. Output Tokens and Response Length
Output tokens often cost more than input tokens because generation happens sequentially, one token at a time, while input processing can be handled in parallel.
The problem is that responses can grow without much control: verbose outputs, no maximum token limit, or reasoning enabled for tasks that don't need it.
Set sensible output limits and design prompts around the shortest response that still completes the task. That can reduce spending on the more expensive side of the bill.
4. Number of Inference Calls Per Task
Agentic workflows can change the math quickly. A simple chatbot might make one model call for a user question. An agent handling the same task might make multiple calls to reason, use tools, retrieve information, check its work, and self-correct. CloudZero's analysis uses 10 to 20 calls per agentic task as an example of how quickly consumption can multiply.
That means costs can rise significantly without any change in pricing or headcount.
Measure calls per task, not just calls per user. Reduce unnecessary loops, limit retries, eliminate duplicate calls, and combine steps where practical.
5. Reasoning and Agentic Workloads
Some reasoning models can generate internal reasoning tokens before generating their final output. For models like those offered by OpenAI, those internal reasoning tokens are charged as output tokens, even though the user doesn’t see them.
This is something to look into if your bill suddenly increased and there was no visible increase in use. Complex agent workflows and higher reasoning settings increase the amount of work that the AI has to do.
6. GPU and Accelerator Costs
If you are self-hosting, the cost of the GPU is important, but not in the way you may expect. A cheaper GPU doesn’t necessarily mean cheaper inference.
A recent benchmark of 21 GPUs running the same Qwen2.5-7B-Instruct workload showed that the cost per million output tokens was between $0.64 and $17.40. So, even with an inexpensive GPU, the cost and the usefulness of the tokens may not align. See the guide to Google Cloud GPU pricing for a deeper breakdown.
7. GPU Utilization and Inference Throughput
Here's the difference that affects a lot of self-hosting decisions: The cost per hour of a GPU is not the same as the cost per request. A cheaper per-hour GPU may end up costing you more if it isn't used enough or can't keep up with demand.
Utilization matters because you are still paying for provisioned accelerator capacity when it isn't being used. NVIDIA notes that lower utilization increases effective cost per generated token because infrastructure costs remain while output falls.
To improve utilization, batch requests more effectively, use smarter request scheduling, improve infrastructure throughput, and avoid overprovisioning for peak usage.
8. Latency and Peak Capacity Requirements
Teams often size infrastructure to handle peak demand, which can leave capacity underused during normal periods. That may be necessary when strict latency requirements demand it, but it can become expensive when peak demand is infrequent.
Benchmark your actual workload before sizing infrastructure. Define your real latency requirements, measure concurrency, and use autoscaling where appropriate instead of continuously paying for peak capacity.
Why Token Prices Don't Tell You the Full Cost of Inference

When discussing the cost of API inference, prices usually consist of input and output tokens, plus a model price. While this pricing structure is better than nothing, modern APIs can price various things like cached inputs, reasoning, tool calls, and other elements of usage.
For self-hosted inference, pricing is more complicated still. Costs associated with deploying and running an inference service must be taken into account, including the cost of GPUs and other accelerators, utilization, throughput, planning, capacity, and other operating costs. Beyond these, costs associated with the software and infrastructure that enables inference must also be taken into account. NVIDIA takes a similar view when discussing the total cost of ownership of their GPUs.
Ultimately, the key question is not "What's the price per million tokens?" The real question is, "What does it cost us to produce one million useful tokens at the level of performance our product requires?" Effective inference cost can differ greatly from the prices listed on a rate card, especially once factors like utilization, workload volume, and call multiplication come into play.
How to Calculate LLM Inference Cost
API Inference Cost
The formula for calculating cost is relatively simple.
Inference cost = (input tokens × input rate) + (output tokens × output rate)
Then scale it up:
Monthly inference cost = cost per request × monthly request volume
So, for example, let’s say a chatbot averages 800 input tokens and 400 output tokens per conversation and has 50,000 conversations per month. With illustrative rates of $3 per million input tokens and $15 per million output tokens, the cost would be roughly (40,000,000 x $3) + (20,000,000 x $15) = $120 + $300 = $420.
Self-Hosted Inference Cost
For self-hosted workloads, the cost calculation is:
Effective cost per token = total inference infrastructure cost ÷ tokens generated
Total infrastructure costs can include computing, storage, networking, and the operational work to run the system. NVIDIA also suggests looking at cost per 1,000 prompts and cost per 1 million tokens when evaluating the economics of inference.
Cost Per Request vs. Cost Per Outcome
For many business applications, cost per request provides less information than cost per completed outcome. An unsuccessful request still consumes resources. Measuring the cost per completed outcome gives more accurate costs.
How to Reduce LLM Inference Cost

Think of cost reduction in four layers, from the easiest wins to the most involved.
Reduce Unnecessary Inference
Avoid redundant loops and retries by combining multiple requests into one.
Use just enough context to complete the task, no more.
Cache the contents instead of recomputing them every time.
Cap output length to what the task actually needed.
Use the Right Model
Use less capable models for less challenging tasks.
Keep your strongest model for only the most challenging tasks.
Set up an escalation process for model requests.
Improve Inference Efficiency
For tasks that allow it, batch similar requests to improve the use of your GPU.
Use quantization for smaller models and lower memory requirements.
Use an optimal framework to serve the models.
Improve the use of your accelerators with better workload packing.
Optimize Cloud Infrastructure
For your typical traffic, set your GPU capacity to the lower end.
If you have resources that are idle, make them smaller if latency does not matter.
Set your cloud resources to your actual usage pattern (on-demand, committed, or spot).
Review your resource usage and adjust to better align with usage needs.
How Pump Helps Optimize AI Infrastructure Costs
Reducing model and token costs gets you partway there. The other half of the equation is the cloud infrastructure underneath your AI workloads, and that's where inefficient capacity can add unnecessary spend.
See where your AI infrastructure spend is going: Pump View provides unified spend visibility across AWS, GCP, Azure, and connected engineering tools. Its OpenAI and Anthropic integrations also provide visibility into AI API usage and spending, helping teams understand how AI-related costs fit into their broader technology spend.
Identify inefficient capacity: Pump surfaces infrastructure optimization opportunities, including idle resources and rightsizing recommendations, helping teams identify capacity that may be contributing to unnecessary cost.
Understand what changed: Pump View provides context around spending changes, while anomaly detection helps flag unexpected cost spikes. Annotations and team tagging can also add context and ownership around cost changes.
Optimize the underlying cloud costs: Pump Save manages commitment-based savings across AWS, GCP, and Azure, while Pump's AI/ML offering is designed to reshape commitments as usage changes. Pump also provides infrastructure optimization capabilities such as rightsizing and idle-resource detection.
Why LLM Inference Costs Can Rise Even When Model Prices Fall
A cost paradox: the cost to achieve a given level of performance for AI has decreased dramatically, according to prior analysis by roughly 10x per year. More recent analysis by Epoch AI suggested that this is closer to 13x. However, this does not mean the total inference cost for an organization will also decrease.
As inference costs decrease, more AI tasks can be justified. Requests for inference can increase. Context can also increase, and so can the number of tokens used for each request. Agentic and reasoning workflows can add even more inference work.
These can be combined to say:
Model price ↓, but users ↑, requests ↑, tokens per request ↑, agent calls ↑, and reasoning use ↑ → total inference spend can still rise.
This is why price per token is useful as a basic gauge, but it doesn't capture the full picture. Falling prices are a positive change, but teams only capture the benefit when they understand how their models and infrastructure are used.
Conclusion
LLM inference costs are impacted by model economics, token consumption, workload behavior, how efficiently a server can respond, how fully a dataset can be utilized, and what kind of infrastructure is committed. There are often tradeoffs between the different factors.
The teams that manage inference costs well aren't always using the cheapest models or committed to the cheapest GPUs. They often utilize their infrastructure to optimize the compute usage to create useful AI outputs.
To start, measure where the spend is. Once you pinpoint where costs are, further improvements to model costs and efficiency are often easier.
FAQs
What is the cost of LLM inference per million tokens?
Costs vary by model and provider. Some providers have models under a dollar per million input tokens. Higher-end models charge inputs in the several-dollar range and outputs in the double-digit-dollar range. Variables like length, caching, and processing tiers influence the costs, so the true comparison is based on the workload rather than the pricing page minimums.
Why is LLM inference expensive?
Training an LLM is a one-time cost, while using it to generate text is a per-request cost. Also, generating text using a LLM is a computationally expensive task. Some workflows require numerous model calls to complete a task, which drives up the cost of the workflow. Hosting the models and the infrastructure to run them also adds to the cost.
How can I reduce LLM inference costs?
Look at the layer of the workflow that is the most expensive. It could be due to unnecessary model calls, a too-large context, or the use of a high-end model when a lower-end model could be used. Optimizing model calls, caching, and right sizing the infrastructure can lower costs.
Does GPU utilization affect LLM inference cost?
Yes. For self-hosted inference, underutilized GPUs mean that you are paying for capacity that is producing little to no output, increasing the cost per token. NVIDIA states that, for a fixed capacity cluster, a 40% utilized cluster will have approximately double the cost per token compared to a 80% utilized cluster. The actual cost and workload behavior depend on the batch, latency, and other factors.
Similar Blog Posts
LLM Token Cost: How to Calculate and Reduce AI Spend
From Spreadsheet Nightmares to Cloud Cost Optimization









