Photo by Gabriele Malaspina on Unsplash. Source: https://unsplash.com/photos/a-white-robot-is-standing-in-front-of-a-black-background-CjWsslYVnPI (Unsplash License).

Executive Summary

Most of a coding agent’s bill is spent before it writes any code. The source files, tickets, build logs, and dependency alerts it reads on the way to a pull request cost more than the change itself. Model choice gets the attention. Output format quietly sets the meter.

Verbose JSON is the leak. When a tool returns a long list of records with the same shape, the agent pays for field names, quotes, and syntax on every record, and those calls run hundreds of times in a session. An issue list repeats an identifier, a rule, a severity, a file, a line number, a status, and an estimate for each entry. Return arrays in compact columnar form, drop labels that never change, and keep only what the task needs. The same facts then arrive for a fraction of the tokens. Leaner output is also easier to reason about, so the cheaper format is often the clearer one.

Before an AI coding agent writes a line of code it has already spent tokens. It read the source files, the ticket description, the build logs, the quality findings, and the dependency alerts. Most of what you pay for is not the pull request. It is everything the agent read on the way to it.

Teams focus cost controls on model choice, prompt length, and request limits. Those are real levers, but a quieter one sits in the interfaces between the agent and your developer tools. That is the format of the data returned to the model.

The representation costs more than the content

When a tool returns a long list of records that all share the same shape, verbose JSON makes the agent pay for field names, quote marks, and structural syntax over and over again. The content is useful. A lot of the representation is not.

For agentic workflows the output format is an engineering decision, not a cosmetic one. It determines how many tokens a single tool call burns, and those calls happen hundreds of times in a session. Multiply that across a team of agents and the difference becomes a line item on the bill.

This does not mean every integration should abandon JSON. JSON is broadly supported and is often the right call for nested or irregular data. The question is narrower. When a model needs to consume a large, uniform collection, can the tool return the same information in a representation built for that shape?

Take an issue list. Each entry carries an identifier, a rule, a severity, a file, a line number, a message, a status, and an estimate. In conventional JSON those labels repeat for every record. The information is identical each time, but the agent pays for all of it.

Shape the data for the model

The fix is deliberate output design. Return arrays as compact, columnar formats. Drop field names that do not change. Keep only the data the task actually needs. The agent gets the same facts for a small fraction of the tokens.

This is not about guessing what a model wants. It is about removing redundant signaling from the bytes the model has to read. A record that repeats a static label fifty times is fifty wasted reads.

Teams already instrument their pipelines, so the tooling exists. A quick pass that measures tokens per tool call, then rewrites the hottest endpoints to a leaner shape, often pays off immediately. The change is small. The savings compound across every call.

There is a second benefit beyond cost. Leaner output is easier for the model to reason about, because the signal is not buried in repetition. Fewer tokens also means fewer chances for the model to misread a field. The cheaper format is often the clearer one.

Token cost is a format decision

The honest takeaway is that agent costs are not only a model-price problem. They are an API-contract problem. The interfaces between your agent and your tools decide what the model spends, and most of that spend is representation, not reasoning.

Treat output format as a cost control. The teams that do see the same agent behavior for a materially smaller bill, and they did not change the model to get there.

There is a measurement problem at the heart of this. Teams track model price per token but rarely track how many tokens a tool call actually consumes. The result is that agent spending looks like a fixed cost when it is mostly a design cost. Change a single endpoint to return compact rows and the number moves. Change it back and the number returns.

That makes output format one of the highest-impact controls available, because it is a decision you make once and get paid for on every call. It does not require switching providers or cutting capability. It only requires asking whether the data a tool returns is shaped for a model to read.

The discipline is to stop treating tool responses as generic JSON and start treating them as a unit of model economy. Measure it, optimize it, and the bill follows.

The AI Infrastructure report covers where the money actually sits, including the shift from token price to the cost of a whole workflow.

Related reading. The Cost of AI Is Finally Falling. The Cost of Using It Is Not.. OpenAI Just Made the Agent Harness a Managed Service. Agentic Resource Discovery Wants to Give Agents Their Own DNS. AI Infrastructure Runs on Four Layers. Most Break Below the Model..

By Tech Thought Leaders

Independent analysis of cloud-native infrastructure, virtualization and data centre economics.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the next one before it is old news

Independent analysis of cloud-native infrastructure, Kubernetes and data centre economics. No vendor spin.