Agent in Practice
The Real Cost Behind a Single Message
The user sent just one message, but under the hood, the Agent may have run 10+ loops and generated dozens of API calls. When you open the billing dashboard, you might be in for a shock.
Select a user message to see what happens behind the scenes
Simulated user message:
Cost grows exponentially with complexity
Where does the cost go?
• System Prompt — Sent repeatedly every round; the more rounds, the greater the repeated cost
• Tool Results — Tool responses can be very long (entire file contents, search results…)
• Context accumulation — Each subsequent round carries all previous messages, snowballing in size
• System Prompt — Sent repeatedly every round; the more rounds, the greater the repeated cost
• Tool Results — Tool responses can be very long (entire file contents, search results…)
• Context accumulation — Each subsequent round carries all previous messages, snowballing in size
Every message your user sends could add $0.10 to your bill. Knowing where the cost comes from is the first step to controlling it. Agent costs grow exponentially with each round—far faster than linear—because every round must resend all previous content to the model.