Skip to main content
Version: v2.0

Cost and usage

A turn is one call to the model. Every turn sends text to the model, and model providers charge for the text they read and the text they write. This page explains what is in that text, and what Agenta records about it.

What each turn sends

A model has no memory of its own, so the harness sends the whole picture on every call:

  • your instructions, in full,
  • the names and descriptions of every skill the agent has,
  • the definition of every tool the agent has,
  • the conversation so far, including the results of tool calls,
  • and the new message.

The model reads all of that and writes a reply. You pay for both sides.

Two things follow from this. The first is that cost scales with how much context you carry, not with how many messages you send. A short question at the end of a long conversation costs more than the same question at the start, because everything above it is sent again.

The second is that one message from you is rarely one turn. When the model asks for a tool, the harness runs it, appends the result, and calls the model again. A task that takes six tool calls means seven turns, and each one carries a longer conversation than the one before it.

What is always loaded, and what is not

The parts of an agent are not equal in cost, because they do not all arrive at the same time.

PartWhen it is sent
Instructions (AGENTS.md)Every turn, in full
Tool definitionsEvery turn
Skill names and descriptionsEvery turn
Skill bodiesOnly when the agent decides to use that skill
Files in the agent folderOnly when the agent reads them

This is the reason skills are built the way they are. A skill can be long without being expensive, because the agent sees only its name and description until it needs the rest. A file in the agent folder costs nothing until it is read, and can be pointed at from the instructions in one line. Text in the instructions has no such escape. It is sent on every turn of every session, so its length is a recurring cost.

When a conversation grows past what the model can hold, the harness compacts it, replacing the earlier part with a summary. See Harnesses and models.

What Agenta records

Agenta traces every model call and every tool call an agent makes. A trace shows what was sent, what came back, which tools ran, and how long each step took.

On top of the traces, Agenta tracks per agent:

  • the number of model requests,
  • token usage,
  • and an estimated cost.

The cost is an estimate calculated from token counts and model prices. The charge itself comes from whoever serves the model, which is set by the credential on the agent. An agent running against a subscription rather than metered API billing still reports an estimate, and that estimate is not what you are billed.

To read these numbers and find where an agent is spending, see Analyze cost and usage.

  • Agents covers the instructions, which are the part sent on every turn.
  • Skills explains loading on demand.
  • Files and knowledge covers keeping knowledge out of the instructions.