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

TechNode source artwork
newsT
news

DeepSeek V4 Flash tops OpenRouter weekly ranking with 7.22 trillion tokens · TechNode

DeepSeek V4 Flash led OpenRouter's July 27 to Aug. 2 usage ranking with 7.22 trillion tokens. Chinese models held all four leading slots, and V4 Flash 0731 plus V4 Pro landed inside the top six.

tokenmaxxingmodel-routerpricing
Read note
404 Media source artwork
news4M
news

Microsoft Tells Engineers ‘Tokenmaxxing Is Not What We Are Optimizing For’

Microsoft EVP Jay Parikh told staff that tokenmaxxing is not the goal, giving divisions AI token budget targets as of July 2026 and making OpenAI's cheaper GPT-5.6 the default model for internal use.

tokenmaxxingexplainerworkplace-ai
Read note
HackerNoon source artwork
newsH
newsmedium review

Auto-Mode Routing: What Stop Us From Sending "How to Center a Div" to Claude 3.5 Opus | HackerNoon

The vCodeX team audited about 100,000 internal prompt logs, found roughly 65% were definitional questions or minor refactors hitting frontier endpoints by default, and built a sub-40ms complexity router across three model tiers.

tokenmaxxingcost-governanceai-spend
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.

55.8K10.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.

32.7K3.5KSource-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.

24K2.2KMIT
prompt-evalscirag
Briefing

Fresh source notes each week.

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