Why Does a Single “Hello” Burn 10,000+ Tokens in an AI Agent? Cost Breakdown and Troubleshooting Guide
A simple greeting can consume tens of thousands of input tokens in an AI Agent while producing only a few dozen output tokens. This guide explains why Agent requests are often much larger than they appear, identifies the five most common sources of token usage, and presents a practical process for diagnosing and reducing unnecessary costs.
A user types “Hello,” but the request consumes more than 10,000 input tokens while generating only a few dozen output tokens. This is a common anomaly when building or using AI Agents. Intuitively, such a simple message should be inexpensive, but the billing data tells a different story.
This article breaks down how tokens are consumed in Agent workflows and provides a practical approach to troubleshooting and optimization.
Why AI Agents Use Far More Tokens Than Expected
The first key idea is simple: the input you see is not the input the model sees.
From the user’s perspective, “Hello” is a single short message. In an Agent framework, however, it may represent only a small part of the final request payload sent to the model. The complete input commonly includes several layers:
- System prompts: Instructions that define the Agent’s role, behavior, rules, and output format. These can easily contain thousands of tokens.
- Tool definitions: The names, descriptions, and parameter schemas of all available tools.
- Injected context: Project files, documentation, conversation history, retrieval results, logs, and other background information.
- The user message itself: Often only a small fraction of the total request.
A simplified request might look like this:
{"system": "You are a general-purpose AI assistant... (approximately 3,000 tokens)","tools": [{"name": "search_web", "description": "... (approximately 200 tokens)"},{"name": "read_file", "description": "... (approximately 200 tokens)"},"... more tool definitions"],"messages": [{"role": "user", "content": "Hello"}]}
This explains why high input usage is often a structural characteristic of Agent architectures rather than an isolated bug. However, when a simple greeting consumes more than 15,000 tokens, there is usually significant room for optimization.
Five Common Causes of High Token Usage
1. Task Complexity
The more complex the task, the more documents, tool calls, reasoning steps, and context the Agent may need.
Consider these two examples:
- Task A: Summarize one article.
- Task B: Read 20 articles, compare their viewpoints, verify information, and produce a 5,000-word analysis.
Task B will inevitably cost more because it requires more input, more intermediate steps, a larger retained context, and more output. Complexity is the primary cost driver in this case. Optimization should focus on task decomposition and workflow design.
2. Excessive Context Injection
Many Agent frameworks automatically insert files from the working directory, README files, requirement documents, error logs, previous messages, and other content into the context. The user may think they submitted one sentence, while the model is actually processing tens of thousands of tokens of background material.
This kind of implicit injection is one of the most common causes of unexpectedly high usage. In large projects, injecting the entire directory without filtering can multiply the input cost of every request.
3. Tool and Skill Proliferation
Before each request, an Agent generally needs to tell the model which capabilities are available. The more tools it has, the longer this section becomes.
For example, if an Agent has 50 tools and each tool’s schema description averages 200 to 400 tokens, the tool definitions alone may consume 10,000 to 20,000 tokens. These definitions may be sent repeatedly with every request, whether the user asks “What day is it?” or requests a complex data analysis.
Installing too many extensions or skill packages can create a similar problem. Before executing a task, the Agent may need to read each skill’s documentation to determine whether it applies. These descriptions become a recurring source of token consumption.
4. Unbounded Conversation History
During a long conversation, most Agents send previous messages along with every new request. As the conversation grows, the history becomes longer and each request becomes more expensive.
Without history trimming or summarization, the input for each request later in a long session can easily exceed tens of thousands of tokens.
5. Amplification from Loops and Retries
An Agent workflow rarely finishes with a single model call. It may plan, call a tool, inspect the result, plan again, and continue through multiple iterations.
A complex task can trigger dozens of model calls. If each call already carries a large baseline—such as a 10,000-token system prompt and tool definitions—the total usage is multiplied by the number of iterations. Failed retries and regenerated responses after format validation errors add further costs.
A Four-Step Process for Finding the Cause
When token usage is unexpectedly high, investigate it in the following order.
Step 1: Check request-level usage details.
Start with the usage details provided by the model service or with local application logs. Confirm whether the usage is concentrated in input or output tokens. High input usage usually indicates context expansion, while high output usage may indicate excessive generation or an uncontrolled loop.
Step 2: Export the complete request payload.
Enable debug logging at the framework level and inspect the exact content sent to the model. Measure how much space is occupied by the system prompt, tool definitions, injected files, and other context. This is usually the most direct and effective diagnostic method.
Step 3: Run reduction experiments.
Disable selected tools, simplify skill packages, clear the conversation history, and reduce injected files one change at a time. Compare token usage after each change to identify the largest contributors.
Step 4: Review session and memory mechanisms.
Check whether the framework is allowing conversation history to grow indefinitely or repeatedly injecting the same retrieval results.
Optimization Strategies and Practical Recommendations
- Load tools on demand: Avoid attaching every tool to every request. Register tools dynamically according to the task, or rewrite tool descriptions in a more concise form.
- Trim the context: Inject only the file sections relevant to the current task instead of the entire project directory. For long documents, use summaries or retrieve content in segments through a RAG workflow.
- Manage conversation history: Set a maximum history window. Replace older messages with a compressed summary instead of sending the full original text.
- Reduce system prompt size: Review system prompts regularly, remove redundant rules, and combine repeated instructions.
- Limit execution rounds: Set maximum tool-call and retry limits to prevent runaway loops.
- Monitor usage: Record the token distribution for every request at the application level and build an observable cost dashboard so abnormal increases can be detected quickly.
Conclusion
When a single “Hello” consumes tens of thousands of tokens, the problem is usually not that the model is malfunctioning. It is the result of multiple layers of context being combined inside the Agent architecture.
Once you understand that “the user’s input” is not the same as “the model’s input,” most abnormal usage can be located and reduced through payload inspection and controlled reduction experiments.
For developers building Agent applications or using Agent-based products, token cost should be treated as an engineering metric that requires continuous governance—not just a number reviewed after the bill arrives.
