Guide

How to Track AI Token Spend

A practical measurement plan for LLM token usage by model, workflow, user, agent, cost, and accepted output.

Updated 2026-05-12ai-spend / finops / cost-control
Desk note

Spend tracking fails when it starts at the invoice. The useful unit is the traced model call with enough metadata to explain who triggered it, why it ran, what it cost, and whether the result survived review.

Start with attribution

Every request should carry metadata that identifies the product surface, workflow, model, user or agent, prompt version, and environment. Without attribution, the only thing a cost dashboard can say is that money was spent somewhere.

  • Minimum tags: workflow, owner, model, prompt version, environment.
  • Useful extras: customer tier, feature flag, route, and task category.

ReceiptsRamp Economics Lab

On this siteAI FinOps topic hub

Record the cost inputs

Track input tokens, output tokens, cached tokens where available, retries, tool calls, latency, and model price at the time of the request. Preserve the pricing source or snapshot date so future readers understand the calculation.

  • Separate input and output tokens because pricing usually differs.
  • Keep retry count and tool-call count visible.

Attach outcome state

Token data becomes operational when paired with whether the output was accepted, edited, rejected, or escalated. That one field separates cost accounting from productivity theater.

  • Accepted output makes cost-per-task possible.
  • Edited or rejected output exposes prompts and routes that need repair.

Build outlier views

The first useful dashboards are not elaborate executive scoreboards. They are outlier views: highest-cost workflows, sudden jumps, high retry rates, expensive agents, and low-acceptance prompts.

  • Sort by total spend and by cost per accepted result.
  • Review the trace before changing the model or prompt.
Weekly briefing

The term is moving faster than the definition.

Tokenmaxxing keeps shifting as new receipts land. The weekly briefing tracks who's burning what, and why it matters.

Written by the desk's AI, human-reviewed before send, real numbers only.

Source trail

Current feed records connected to this guide

bestagent.dev source artwork
newsB
news

Claude Code's Code Mode, tested: about 22% cheaper on two of three tasks

bestagent.dev ran three tasks three times each on Claude Code 2.1.325 with Opus 5.5, Code Mode on and off. A feature-with-tests job fell from $0.45 to $0.35 a run; a broken-link check from $0.20 to $0.16. A 20-file edit barely moved.

tokenmaxxingcoding-agentsagents
Read note
Anthropic source artwork
newsA
news

Introducing Claude Fable 5.2 and Claude Mythos 5.2

Anthropic released Claude Fable 5.2 and Mythos 5.2 on Nov. 9, priced at $8 per million tokens in and $40 per million out, which it calls a lower price. An optional fast mode generates up to 2.5 times quicker at exactly double both rates.

tokenmaxxingpricingmodel-routing
Read note
CNBC source artwork
newsC
news

Amazon's anti-tokenmaxxing memo says engineers should be pickier about using AI

CNBC reports on an Amazon memo, shared internally in September and made public Oct. 27, that labels token usage, AI tool adoption rates and code-change counts 'deeply flawed' gauges of a team's AI use.

tokenmaxxingworkplace-aimetrics
Read note
Project layer

Tools that make the guide operational

#1Direct
Routing

LiteLLM

BerriAI/litellm

An OpenAI-compatible gateway and SDK for calling many model providers with budgets, logging, load balancing, guardrails, and cost tracking.

63.6K13.4KSource-available
gatewaycost-trackingrouting
#2Direct
Observability

Langfuse

langfuse/langfuse

Open-source LLM engineering platform for observability, traces, metrics, evals, prompt management, datasets, and playground workflows.

37.7K4.3KSource-available
tracesevalscosts
#5Direct
Evaluation

promptfoo

promptfoo/promptfoo

A CLI and CI workflow for testing prompts, agents, and RAG systems across models, with evals and red-team style checks.

27.5K2.8KMIT
prompt-evalscirag
Briefing

Fresh source notes each week.

New tokenmaxxing links, model-router signals, agent usage research, and AI cost notes.