AI Cost Visibility & Optimization Understand, allocate & reduce your AI costs - Learn More

AI Token Waste: The Complete Guide

An average coding-agent run on the SWE-bench Verified benchmark ends with about 48,000 tokens of context, yet the model processes roughly 1.0 million input tokens getting there, according to Peking University and ByteDance researchers. Every step re-sends everything that came before it, and much of what goes back is stale, repeated, or sent to a model priced above what the job needs. Stanford and Microsoft researchers found that input tokens, not output tokens, drive the overall cost of agentic work.

This guide covers the main causes of AI token waste, how to spot it in usage and spend data, and how to monitor and reduce it, both for the AI tools your teams use internally and for the AI features your customers use.

Top reasons behind AI token waste

Model providers bill by the token, and every request has two parts on the bill: the tokens sent in, which include instructions, documents, tool descriptions and the conversation so far, and the tokens the model writes back. Output tokens cost more, five times the input rate on Anthropic's current models. A chat reply is a single request. An agent works in a loop of requests, and each pass sends everything it has seen so far back to the model, which is why the same task can cost very different amounts depending on how it is set up.

Most token waste comes from one of three things: sending more than the task needs, paying a higher rate per token than the task needs, or letting an agent run with no limit on how long it works.

Sending more than the task needs

Every token in a request is billed, whether the model used it or not.

Growing agent context

An agent's conversation is its working memory. Each tool call and the full result it returns are added to that conversation, and the whole thing goes back to the model on the next step. A log file or search result pulled in at step three is paid for again at step four, step five and every step after, long after the agent has finished with it. Researchers at Peking University and ByteDance found that coding-agent histories fill up with material that is useless, repeated or out of date by the time it is sent again. Summarizing old results as the task goes, dropping the ones that no longer matter, and having tools return only what the agent asked for keep each step small.

Tool definitions on every request

Every tool an agent can use comes with a description in the request: its name, what it does and the format of its inputs. That description is sent every time, whether or not the agent calls the tool. A few tools add little, but an agent connected to dozens of them can carry thousands of tokens of descriptions on every step before it does any work, and the cost grows with the length of the task. Giving each agent only the tools its job needs removes that overhead. Long system prompts and large sets of examples work the same way and should be as short as they can be while still doing their job.

Oversized requests

Prompts get large when someone pastes in a whole document, codebase or chat history because that is easier than picking out what matters. The model reads all of it and the bill covers all of it, even when the answer depends on a few paragraphs. Some models also carry a second cost: past a certain prompt length, the price per token goes up, and the higher rate applies to the entire request. Retrieving only the passages that bear on the question and trimming chat history to what is still relevant keep requests small. It is also worth checking whether the model in use has a long-prompt surcharge.

Unlimited output length

Output tokens are the most expensive tokens in a request, and unless told otherwise, the model decides how much to write. Restating the question, explaining things nobody asked about, and returning a whole file when one function changed all add to the output bill. A maximum output length, instructions to answer concisely or in a fixed structure, and asking for only the changed section when editing keep output to what is needed.

Paying more per token than the task needs

The same tokens can be billed at very different rates depending on which model handles them, how and where they are served, and whether the provider has seen them before.

Caching turned off

Most requests open with the same material: a system prompt, tool descriptions, reference documents. Without caching, the provider processes that identical opening from scratch on every request and charges full price each time. With prompt caching, the provider stores it after the first request, and later requests that start with the same content read it back at a small fraction of the normal input price. Writing to the cache costs slightly more than a normal request the first time, and the first reuse covers that. The cache matches on the start of the prompt, so content that never changes belongs at the top and anything that varies, like the user's question, belongs at the end. A timestamp or username at the top changes the opening on every call and breaks the match.

Top-tier models on simple work

Prices within a provider's lineup vary widely, and most of what an application does does not need the most capable model. Sorting support tickets, pulling fields out of an invoice, reformatting text and choosing which tool to call are jobs smaller models handle well at a fraction of the cost. Defaulting to the top model for everything means paying top price for all of it. Testing cheaper models on real examples from the workload, then routing each kind of request to the cheapest one that does it well, lowers the average price and leaves the hard tasks on the model they need.

Real-time processing for work that can wait

Live requests are priced for an immediate answer, and plenty of work does not need one, such as running evaluations, labeling or summarizing a backlog, generating content in bulk, or nightly analysis. Batch processing handles this kind of work: requests go in together and results come back later. On Anthropic's API a batch costs half as much, most batches finish within an hour, none take more than a day, and the discount stacks with caching. Anything nobody is waiting on can usually go through batch.

Premium speed modes

Some providers sell faster output at a higher price per token. The premium makes sense when a person is watching the response arrive, and buys nothing when the output goes into a queue or another process. A fast mode switched on as an application-wide default charges that premium on background work too.

Older model versions

A new version of a model is sometimes cheaper than the one it replaces as well as better, and applications still on the old version keep paying the old price. Anthropic's recent Opus and Sonnet releases, for example, launched below the price of the versions before them. A new tokenizer can eat into the saving, because the same text may turn into more tokens, so compare cost on a sample of real requests, not just the price list.

Regional endpoints

Where a model runs affects what it costs. In-region and region-specific endpoints on cloud platforms such as Amazon Bedrock and Google Cloud cost about ten percent more than global ones, and Anthropic charges more for US-only processing on its own API. Data residency rules can justify the premium. Without them, a global endpoint serves the same model for less.

Agents running without limits

An agent decides how many steps to take, so the cost of a task is not fixed in advance.

Repeated tool calls and retries

When a call fails or returns something the agent does not like, it tries again, sometimes with the same input. Each attempt is a new request carrying the whole conversation, failed attempts included, so every retry costs more than the one before. An agent stuck on a broken tool or an unclear instruction can run up a large bill without producing anything. Capping retries, returning errors that say what to change, and stopping an agent that keeps repeating the same call end these loops early.

No limit on tokens per task

Without a ceiling, a task ends when the agent decides it is done, and agents are not good at deciding that cheaply. A Stanford and Microsoft study found that the same coding task could use up to thirty times more tokens from one run to the next, that heavier use did not mean better results, and that models underestimated their own token use. The limit has to be set outside the agent, as a maximum number of steps and a token budget per task in the code that runs it rather than in its prompt, so a run that hits the limit stops.

Identifying wasteful AI token spend

Waste shows up in how individual requests are built, not in the invoice total, so the first step is attributing spend to someone who owns it. Separate API keys or workspaces for each application and environment, plus metadata on each request such as team, feature, customer and agent, let usage data split the bill along those lines. Once it is split, outliers stand out: a feature that costs far more than its peers, a test environment spending like production, one customer using many times the tokens of the rest.

Within an application, the usage data returned with each request points to the causes covered above.

What to check

What a problem looks like

Likely cause

Input tokens compared with similar requests

One type of request sends far more than its peers, or input jumps after a release

Oversized requests, too many tool definitions

Cached against uncached input

The same long opening on every request, with cache reads near zero

Caching turned off, or a value at the top of the prompt that changes each call

Input tokens at each agent step

Climbs through the whole run with no drops, or spikes on a single step

Growing agent context, an oversized tool result

Calls per run

Many near-identical calls in a row, or retries after errors

Repeated tool calls and retries

Output length

Long responses to tasks with short answers

Unlimited output length

Spend by task type and model

A top-tier model on classification or formatting, older model versions, live requests for work that could wait

Top-tier models on simple work, older model versions, real-time processing

None of these signals says whether the spend was worth it, since a long run can be doing real work. Cost per completed task, tracked for each kind of task, tells the two apart. Because the cost of the same task can vary widely between runs, as the Stanford and Microsoft study found, look at the spread rather than the average. Setting the most expensive runs of a task beside a typical one shows what went wrong in them, and a baseline for each task makes a prompt edit or model swap that raises cost visible right away instead of at the next invoice.

How to monitor and optimize AI token waste

Monitoring and optimizing token waste looks different for the tools a company's own people use and for the AI features its customers use.

Monitoring and optimizing AI token usage for internal team

Most internal token spend comes from developers using AI coding tools, and the question is what that spend ships. Split it by type of work, such as new features, bug fixes, tests and evaluations, and track the share that reaches production, the AI cost of each merged pull request, and the rework rate compared with pull requests written without AI.

Monitoring and optimizing AI token usage for customers

For customer-facing AI features, the question is what each customer costs compared with what they pay. Track each customer's monthly AI cost, the AI margin on each plan, the share of total spend from the top accounts, and the cost of each feature or task per customer. A handful of heavy accounts and a few expensive features usually account for most of the gap.

Frequently asked questions

Short answers on what causes token waste, how much of it can be cut and which tools help.

Manage AI token waste with nOps

Most teams can see their AI bill but not what it bought, which makes waste hard to tell apart from spend that ships. nOps connects AI spend to the work it produces, showing where tokens go and what to change.

  • AI cost per pull request shows what AI-assisted work costs by team and type of work, and how much of it reaches production.
  • Rework and efficiency benchmarks compare AI-assisted pull requests with the rest, across developers, teams and projects.
  • Each developer's usage is broken down by what drives its cost, such as caching, reasoning effort, fast modes and large tool results, with recommendations like a cheaper model for the same work.
  • A comment on each release pull request shows its AI cost and flags releases that cross a set threshold, so nobody has to open a dashboard.

Book a demo to see AI ROI on your own teams, pull requests and AI coding tools.

nOps manages $5 billion in cloud and AI spending and was recently ranked #1 in G2's Cloud Cost Management Category.

What are top AI token waste reasons?

The main reasons are agent context that keeps growing, caching turned off, top-tier models used for simple work, oversized prompts and premium speed settings. nOps's Optimization Hub flags each of these as an AI recommendation, including long-context optimization, prompt cache optimization, model tier right-sizing, cheapest model tier, model version upgrade and speed tier optimization.

On average how much of token waste can be reduced?

It depends on the workload. In one study of a top-performing coding agent, tested with two models on two benchmarks, removing useless, repeated and outdated content from the agent's history cut input tokens by 39.9% to 59.7% and total cost by 21.1% to 35.9%, with the same performance.

What are the best tools to monitor and optimize AI token waste?

A useful tool attributes spend to teams, features or customers and recommends changes you can act on. nOps does both: it shows what AI spend produced, down to the pull request for engineering teams, and recommends specific fixes such as cheaper models, caching and context changes. CloudZero, Finout and Vantage focus on showing where spend went, while gateways and observability tools such as LiteLLM, Portkey and Langfuse log requests and have to be built into your own reporting. nOps's guides to AI cost monitoring tools and LLM cost optimization tools compare the options in detail.

nOps

nOps

Published Date: December 3, 2026, AI & Tokenomics

Related Posts

AI Cost Per Customer: The Essential Guide

AI & Tokenomics

AI Cost Per Customer: The Essential Guide

byChintu ParikhChintu Parikh•Published Date: Dec 2, 2026
AI Spend Management: The Complete Guide (2026)

AI & Tokenomics

AI Spend Management: The Complete Guide (2026)

bynOpsnOps•Published Date: Dec 1, 2026
Model Routing: When to Switch AI Models and What It Actually Saves

AI & Tokenomics

Model Routing: When to Switch AI Models and What It Actually Saves

bynOpsnOps•Published Date: Nov 15, 2026
Prompt Caching: How It Works and What It Actually Saves You

AI & Tokenomics

Prompt Caching: How It Works and What It Actually Saves You

bynOpsnOps•Published Date: Nov 16, 2026
nOps AI Optimization Recommendations: Closing the Gap From Insight to Verified Savings

AI & Tokenomics

nOps AI Optimization Recommendations: Closing the Gap From Insight to Verified Savings

byRick HaggartRick Haggart•Published Date: Nov 3, 2026
Snowflake Cortex Cost: How to Track and Control AI Spend (2026)

AI & Tokenomics

Snowflake Cortex Cost: How to Track and Control AI Spend (2026)

byShouri ThallamShouri Thallam•Published Date: Oct 28, 2026