Measure

Token cost

You might say: run spend, model cost, usage cost

The money spent by one run on model input, model output, cached tokens, and related calls. It is attributed to a run, task, repository, or team.

What it does
Shows whether a task's value justifies its model usage and reveals runaway retries or oversized context.
Ask
What did this run spend, and which model call or retry caused the bill?
Typical
Report input and output tokens separately, then apply the provider's current rates. Aggregate by run, task, model, repository, and team.
Trouble
A run has tokens but no price, retries inflate spend, cost is assigned to the wrong task, or prompt content is logged to measure usage.

What to look for

  1. Input, output, and cached token counts beside a model call
  2. A currency total attached to a run or task
  3. A spend header, budget meter, or cost report

Connections

Sources

  1. Anthropic, Monitoring, Span attributes`input_tokens` | Input token count from the API usage block.
  2. OpenTelemetry, Semantic Conventions for GenAI agent and framework spans, Invoke agent client span attributesThe number of tokens used in the GenAI input (prompt).
  3. OpenTelemetry, Semantic Conventions for GenAI agent and framework spans, Invoke agent client span attributesThe number of tokens used in the GenAI response (completion).
  4. LiteLLM, Spend Tracking, How to Track Spend with LiteLLMExpect to see `x-litellm-response-cost` in the response headers with calculated cost
  5. LiteLLM, Spend Tracking, How to Track Spend with LiteLLMLiteLLM automatically tracks spend for all known models.
  6. Matt Pocock, AI Coding Dictionary, TokenTokens are the unit everything else is measured in. Cost is per token — providers bill input tokens and output tokens separately.
  7. Matt Pocock, AI Coding Dictionary, Input tokensTokens the harness sends on each model provider request — the system prompt, the conversation history, tool results, everything the model reads before it writes. Billed at a lower rate than output tokens, because they are less expensive to process than output tokens.
  8. Matt Pocock, AI Coding Dictionary, Output tokensTokens the model generates back. Billed at a higher rate than input tokens — commonly around five times the rate — since they cost more compute to produce.
  9. Matt Pocock, AI Coding Dictionary, Cache tokensWhen consecutive requests share a prefix, the provider reuses the work via its prefix cache and bills the cached portion at a much lower rate.
  10. Matt Pocock, AI Coding Dictionary, Prefix cacheThe provider-side store that lets consecutive model provider requests skip re-processing a shared prefix.

Use it on your project

teardown-apply: hold "Token cost" (token-cost) from the teardown at https://teardownatlas.com/software-factory/ against my project

Paste it into a coding agent that has the teardown skills.

An AI agent wrote this map with the teardown skill. It can contain errors: check the sources before you rely on a part. About and legal