An AI agent's cost tracks the number of model calls times the context size on each call, not the amount of code it writes. In one long app build we measured, 86% of the cost was input tokens and only 14% was output.
This is for founders and makers who build apps with AI and wonder why one request costs more than another. The numbers come from a long first build on GrowApps in August 2026, analyzed call by call.
In short:
- Each tool call usually means one more model call that re-sends everything.
- Average context in that build was about 153,000 tokens.
- Big feature lists cost more because they need more calls.
- Narrow tools and batched edits cut calls and context together.
The build that wrote 10,000 lines
The example is a single first-build request: 33 files and about 10,300 lines of Flutter code in 45 minutes. The agent made 225 model calls and 223 tool calls.
Input cost about six times more than output, which is the code itself.
| Token type | Tokens | Share of cost |
|---|---|---|
| Cached input | 32.8 million | 56.5% |
| Fresh input | 1.7 million | 29.6% |
| Output | 0.16 million | 13.9% |
Cached input was billed at a tenth of the fresh price, and it was still the biggest line.
Every tool call re-sends the conversation
An agent works in a loop. The model asks for a tool, such as "read this file". The tool runs, and its result is added to the conversation. Then the model is called again with everything so far.
So each tool call usually costs one more full model call. In a second benchmark, a 10-turn session on a larger app, there were 1.02 model calls per tool call. There was no wasted overhead to remove. Cost was simply calls times average context.
Context grows with every result you keep
Every tool result stays in the conversation, and the next call carries it. In that build, the context averaged about 153,000 tokens per call.
Some tools add far more than others. In our benchmark, a file read returned about 982 tokens and a grep about 96, at the same speed. Carried read output was 69% of all tool-result cost. Screenshots add more, because images stay in context too.
The fixed part matters as well. The system prompt, project briefing and tool definitions were 25% of the benchmark's cost. Tool definitions alone were 19,276 tokens, sent on every call.
Bigger requests cost more because of calls
A request with many features needs more steps, and later steps carry more context. Both grow together, so cost rises faster than the feature count.
The 10,000-line build above cost about 2.6 times the average first build on GrowApps at the time, and nearly 3 times the average in our 10-build benchmark from August 2026. It was a large multi-feature prompt, not a bug.
Three levers cut the cost of a build
The levers below come from that analysis, ordered by payoff.
- Make fewer round trips. The build did 130 file operations for 33 files. Batching edits cuts calls and waiting time together.
- Compact the context. Cached input was the largest line, so keeping context small attacks the biggest cost directly.
- Use narrow tools. Search for a symbol before reading a whole file, and read only the lines you need.
We simulated different compaction thresholds on the benchmark. Against the old 150K line, folding at 250K cost 16% more and 110K about 16% less. Going down to 85K saved only 10%, so the best point we tested sits near 110K.
What GrowApps changed after measuring
GrowApps acted on each lever. Our agent now asks for independent tool calls in one response, so they share one round trip instead of taking one each. It has code-search tools to find a symbol or its references before reading files.
Long builds fold their context at 110K tokens and keep the newest 15K word for word. Rarely used tools load on demand. See how GrowApps keeps your build's context small.
Write a request that needs fewer calls
Before your next request, write down the screens, the data each one shows, and what counts as done. Paste it as one message to GrowApps or your AI tool. A clear spec saves the agent the exploring it would otherwise do, call by call. Next, read how to read your AI bill.
Frequently asked questions
Does a longer app always cost more to build?
Not exactly. Cost follows calls and context, so a long but simple app can be cheaper than a short app with tricky logic that needs many fix-and-retest loops.
Why not just use a cheaper model?
A cheaper model can need more calls, and more calls carry more context. In one session we reviewed, a smaller model took no screenshots and shipped a layout overflow. Cheaper per token is not always cheaper per working app.