Why a Single "Hello" Can Burn 17,000 Tokens: A Breakdown of AI Agent Cost Black Holes

    A single greeting can consume 16,000 to 17,000 input tokens while producing only a few dozen output tokens. This article explains why user input is only a tiny fraction of a billable request, breaks agent token costs into five layers—task complexity, full project context injection, tool and skill declarations, conversation history, and hidden loops—and outlines a four-step troubleshooting path along with engineering practices such as layered context loading, retrieval limits, history compression, budget caps, and observability.

    1. The Problem: Why a Greeting Is So Expensive

    A recurring question in developer communities is this: sending an agent an input with almost no information, such as “hello,” can still consume 16,000 to 17,000 input tokens, while the output is only a few dozen tokens. Even after manually trimming some skill loading, the bill barely changes.

    This is a telling example of an often-overlooked fact: the prompt users see is only a tiny part of the entire request. What actually gets billed is the complete context assembled by the system behind the scenes.

    To understand the cost, you need the right mental model. The input of a model call is usually built from several stacked layers: system-level instructions, role and behavior constraints, structured declarations of tools and skills, retrieved external material, files read from the project directory, the rolling window of conversation history, and finally the user’s current input. User input sits at the outermost layer and is the smallest in size. That is why “I only said one sentence” and “it consumed tens of thousands of tokens” are not contradictory.

    2. Breaking Down the Cost Structure into Five Layers

    2.1 Task Complexity Sets the Baseline

    The more complex the task, the more material must be read in, the more tools must be called, the more context must be retained, and the more reasoning rounds are required. Compare two tasks: summarizing a single document versus reading twenty sources, cross-comparing viewpoints, verifying facts through retrieval, and producing a 5,000-word article. The latter costs an order of magnitude more—not because the output is longer, but because the input side is repeatedly filled. A common misconception in the industry is attributing high consumption to “answers that are too long.” In reality, most excess spending comes from “feeding in too much content.”

    2.2 Unconscious Full Injection of Project Context

    When an agent is asked to analyze a local project, it may read source code, documentation, requirements and design docs, logs and error stacks, and even prior session records in the directory. If the context assembly strategy lacks boundary control, the input side can accumulate over 10,000 tokens before the model even starts reasoning. This overhead is the most hidden, because subjectively the user only issued one short instruction.

    2.3 Always-On Overhead from Tool Declarations and Skill Descriptions

    Every agent request must tell the model “here are the capabilities I have.” The more tools there are, the longer this structured schema definition becomes. An agent with dozens of tools attached may send the full set of tool declarations even when the user only asks “what day is it today.” Skills work the same way: the more skills installed, the more text is used for matching and description before each task round. This is always-on cost, unrelated to task difficulty and tied only to configuration scale.

    2.4 Rolling Accumulation of Conversation History

    When a conversation continues within the same session and a full-history replay window strategy is used, token consumption grows roughly linearly with the number of rounds. The tenth request may cost several times what the first one did, and the user does not perceive this growth.

    2.5 Hidden Loops and Repeated Calls

    Plan–execute–verify multi-round loops, retries after failures, and redispatch of subtasks all cause the same context to be billed multiple times. Without termination conditions and budget caps, the actual number of calls for a single task can far exceed expectations.

    A schematic context budget structure can be expressed as follows:

    1. Single request input = system instructions
    2. + behavior constraints
    3. + tool/skill declarations
    4. + retrieved snippets
    5. + project file contents
    6. + history window
    7. + current user input

    3. A Systematic Troubleshooting Path

    Step 1: Measure by segment. Break the context down and count it by the layers above to locate the largest contributor, instead of looking only at the total.

    Step 2: Verify by subtraction. Disable skill loading, trim tool declarations, clear the history window, and narrow the project read scope one at a time. Change only one variable per step and observe the consumption change to pinpoint the main cause.

    Step 3: Check the number of calls. Confirm how many model calls a single user request actually triggers, and look for unbounded loops or repeated retries.

    Step 4: Review the retrieval strategy. Confirm whether full retrieval runs on every round, and whether recalled snippets are too long or injected repeatedly.

    4. Engineering Optimization Practices

    • Layered context and on-demand loading: Keep system instructions lean, and mount tool and skill declarations dynamically per scenario instead of keeping them all resident.
    • Tool count governance: Merge similar capabilities, control declaration size, and move low-frequency capabilities out of the default context.
    • Refined retrieval: Set caps on the number of recalled items and snippet length, and deduplicate before injection.
    • History compression: Use rolling summaries instead of full replay, keeping decision conclusions and discarding process noise.
    • Budgets and circuit breakers: Set token and call-count limits per task, and degrade or terminate when limits are exceeded.
    • Observability: Use logging services and monitoring alerts to continuously collect and dashboard the composition of each round’s input, call-chain latency, and consumption, turning cost from an “after-the-fact bill” into a “real-time metric.”

    5. Conclusion

    “Burning tens of thousands of tokens on a single hello” is not a model anomaly but an inevitable result of missing context engineering. As agents move from demos to production, cost governance must be built into the design just like performance and reliability: first make the overhead visible, then make it controllable. General practices from Baidu AI Cloud in model services and observability also offer a reference engineering pattern for this kind of context budget governance.