GitHub - QuesmaOrg/awesome-ai-tokenomics: A curated list on AI token economics: what tokens cost, where they get wasted, and how to cut the bill. Tools, benchmarks, papers, and copy-paste configs for the token economy of LLMs and coding agents.

GitHub

30 min read Original article ↗

Pricing, measurement, optimization, and governance of tokens used by AI models.

Every entry is a link with a one-line summary: what it does, and the number behind it. On top of the list sit a few short pages written here: practices (what to do), concepts (how the economics work), claims (what we currently believe, with the evidence), and setups (configs you can paste straight into Claude Code or Codex). It's a reference to browse, grep, or hand to your agent - not a product.

Topics: Caching · Compression · Context engineering · Memory · Routing · Multi-agent systems · Gateways · Observability · Benchmarks · Cache accounting · Budgets · Pricing models · Energy

Contents

Where to start

Just want the numbers: the five area sections below hold every entry. Want the method: read the practices first, then the concepts behind them. Building something: setups and skills holds runnable configurations.

Legend

Each entry ends with a kind badge: tool: MIT (blue, with the license when known), or a gray badge for paper, bench, data, co for companies, and report. Plain entries are articles. GitHub-hosted tools also carry a live last-commit badge.

Monitor

Dashboards

  • ccusage - An open-source CLI that reads local agent logs to report token usage and cost across 15 coding-agent sources, with caching-aware pricing. tool: MIT last commit
  • Claude Code Usage Monitor - A live terminal dashboard for Claude Code usage, with burn-rate analytics, P90 limit detection, and session-expiry forecasts. tool: MIT last commit
  • claude-usage - A local dashboard for Claude Code token usage, costs, and session history; Pro and Max subscribers get a quota progress bar. tool: MIT last commit
  • ClaudeBar - A macOS menu-bar app that monitors AI coding quotas across 11 providers; the README declares MIT but ships no license file, so the OSS grant is unconfirmed. tool: MIT declared in README last commit
  • CodeBurn - An open-source tracker for 36 coding tools whose optimize command flags named harness-waste patterns with dollar estimates it later checks against actuals. tool: MIT
  • Codex Usage Tracker - A local-first dashboard, CLI, and MCP tools indexing Codex CLI logs into SQLite to show where tokens, credits, and cost go, including cache ratios. tool: MIT last commit
  • CodexBar - A free, open-source macOS menu-bar app that shows limits and reset timers at a glance across dozens of AI providers, plus credit balances and spending. tool: MIT last commit
  • CodeZeno Usage Monitor - A Windows taskbar widget showing real-time Claude Code quota and usage at a glance, without opening a terminal. tool: MIT last commit
  • Datadog LLM Observability - Cost - Datadog's LLM Observability estimates per-request cost across 800+ models from token counts and public pricing; invoice reconciliation is a separate product. co
  • gh-aw (GitHub Agentic Workflows) - GitHub's agentic-workflows runtime with first-party per-run token and cost metering, plus budget caps that stop a workflow mid-run. tool: MIT last commit
  • Grafana Cloud GenAI Observability - Grafana Cloud's GenAI Observability ships a prebuilt dashboard for LLM cost, token usage, and latency, built on top of the OpenLIT SDK. co
  • OpenLIT - An open-source (Apache-2.0), OpenTelemetry-native platform with a self-hosted dashboard for LLM cost, token, and latency observability. tool: Apache-2.0 last commit
  • OpenUsage - A native Swift macOS menu-bar meter for 10 AI coding subscriptions, showing session and weekly limits, credits, and estimated spend from local credentials. tool: MIT last commit
  • TokenTracker - A local-first token and cost dashboard for 27 coding tools, with a desktop pet, native widgets, and achievements as a distinct gamified take on usage metering. tool: MIT last commit

eBPF Kernel Capture

Observability

  • Langfuse - An open-source platform for tracing, evaluating, and analyzing LLM and agent transcripts, with a prompt-management layer on top. tool: MIT

OTel for LLMs

Tracing

Optimize

Caching

Cheap Local Models

Compression

  • Context Mode - This MCP server sandboxes tool calls and returns only the distilled result, claiming a 98% cut: 315 KB of output down to 5.4 KB. tool: Elastic-2.0 last commit
  • headroom - An Apache-2.0 context-compression tool for LLM/agent pipelines at 69,078 GitHub stars (2026-09-06), confirmed organic by star-forensics; its TOST non-inferiority framework was removed from the public repo on 2026-07-10 and never merged to main. tool: Apache-2.0 last commit
  • lean-ctx - MCP context layer with a self-measured savings ledger - Rust MCP server that mediates what a coding agent reads, with a self-measured 60-90% token-reduction headline, a reported quality column, and an accounting of its own context overhead. tool: Apache-2.0 last commit
  • LLMLingua - Microsoft's prompt-compression library that uses a small model to drop low-information tokens before a prompt reaches the target LLM. tool: MIT last commit
  • llmtrim - A local proxy that compresses a coding agent's prompt, tool schemas, and history before forwarding and can reroute Claude calls to Grok. tool: MPL-2.0 last commit
  • Minification of state-in-context agents - the clean waste-vs-capability datapoint - This ICPC 2026 study found that minifying code in a coding agent's context cuts input tokens by 42% but costs 12 percentage points of accuracy. paper
  • rtk - A single-binary Rust CLI proxy that intercepts and compresses the output of common dev commands before it reaches an LLM coding agent's context window. Its headline figures are token reduction, not measured cost reduction. tool: Apache-2.0 last commit
  • TOON (Token-Oriented Object Notation) - TOON is a compact, human-readable, lossless serialization of the JSON data model, designed for LLM input. tool: MIT last commit

Context Engineering

Cost Controls

Gateways and Proxies

  • Bifrost (Maxim AI) - Bifrost is a Go-based AI gateway fronting 1,000+ models that measured just 11 microseconds of added latency per request at 5,000 requests per second. tool: Apache-2.0 last commit
  • Cloudflare AI Gateway (Spend Limits) - Cloudflare AI Gateway is an edge-native LLM proxy that added dollar-denominated spend limits in June 2026, blocking or rerouting requests once a budget is hit. co
  • Helicone - An open-source (Apache-2.0) LLM proxy that logs every request's cost, latency, and tokens in one line of code; Mintlify acquired it in March 2026. tool: Apache-2.0
  • Kong AI Gateway - The AI layer of Kong's API-gateway platform: a proxy that meters LLM/agent/MCP traffic for billing, showback, and chargeback. co
  • LiteLLM - An open-source gateway fronting 100+ LLM APIs that computes real per-request dollar cost from a live pricing map, with spend limits. tool: MIT last commit
  • OpenRouter - A unified API gateway fronting 400+ models across 70+ providers that auto-routes each request by price, with fallback on outages. co
  • Portkey AI Gateway - Routes LLM traffic across providers and enforces hard USD budget limits on virtual keys, auto-expiring a key once its cap is hit. co

Harness Efficiency

  • WOZCODE - Claude Code plugin claiming lower token usage and higher task completion, listed sixth on the Terminal-Bench 2.0 leaderboard at 80.2% as an unverified submission. tool: none declared

Memory

Multi-Agent Systems

Prompt Agent Loop

Retrieval Memory

Retry and Reliability

Routing Model Selection

  • Antigravity CLI - per-subagent model-tier routing + /effort (v1.1.5) - Antigravity CLI v1.1.5 shipped first-party per-subagent model-tier routing (a model: flash|pro field in custom-agent frontmatter) plus an /effort control. tool last commit
  • Claude Code Router - A local gateway that puts Claude Code, Codex, and other coding CLIs behind one endpoint and routes each request by ordered condition rules, Node.js script rules, or a prompt tag that lets the agent pick a model per subagent. The project publishes no savings figure, and routing scripts run as fully trusted code next to your credentials - only use scripts you wrote yourself. tool: MIT last commit
  • Claude Code via a LiteLLM gateway (cheap-tier-in-front setup) - Pointing Claude Code's ANTHROPIC_BASE_URL at a local LiteLLM proxy lets cheaper or non-Anthropic models absorb work the frontier model would otherwise bill for.
  • Cluster, Route, Escalate - cost-aware cascaded serving - This paper proposes a two-stage cost-aware cascade for LLM serving that combines routing and escalation into one framework. paper
  • Cursor Router - Cursor's Auto mode classifies each request and routes it to a model under three modes (Intelligence, Balance, Cost), with reported savings measured cache-miss-inclusive. All percentages are Cursor's own, against a constructed all-Opus baseline, with no third-party replication yet. co
  • Distilling agent behavior into small task-specific models - Distilling a large agent's behavior into a small 0.5-3B model lets most of its work run at a fraction of the frontier model's per-token cost.
  • GitHub Copilot auto model selection - Copilot's Auto setting routes by real-time model health and task complexity, and only along cache boundaries: GitHub states mid-session model switching "has shown increased cost without ample improvements in quality." The 10% discount for paid plans in Auto is a pricing multiplier, not a measured routing saving. co
  • Harness-native heuristic pre-routers - two mechanism-only per-turn routers - Two mechanism-only heuristic per-turn routers - one for the pi coding agent, one an OpenCode plugin - route each turn to a model tier by keyword and word-count heuristics. Neither ships a measured savings number, and the OpenCode entry's headline percentage is an assumed-inputs arithmetic simulation, not telemetry. (also: opencode-model-router) tool: MIT last commit
  • MTRouter - per-turn cost-aware routing with history-model joint embeddings - MTRouter picks a different model for each turn of a multi-turn conversation, rather than one model per query, to hit a cost budget without losing quality. paper
  • NadirClaw - a pre-router proxy, with its benchmark attached to the paid tier - An OpenAI-compatible pre-router proxy for coding harnesses: a ~10ms embedding classifier picks the cheapest model predicted to answer, verifies the answer against quality heuristics, and escalates on failure. Its committed RouterBench numbers belong to the paid Nadir Pro classifier, not the free OSS one. tool: PolyForm Noncommercial 1.0.0 last commit
  • Not Diamond - Not Diamond's meta-model predicts, per input, which LLM will give the best answer at the lowest cost, then routes the request there. co
  • OpenCode - explicit cost-tier routing - OpenCode is an open-source (MIT) coding-agent CLI with its own explicit cost- and model-routing configuration, set directly in config. tool: MIT
  • opencode-fusion - An OpenCode config layer that denies the main agent's edit and search tools so they are removed from its tool schema entirely, forcing every file change through a cheaper sidekick agent. Model assignments are fixed per role at startup, and the project publishes no savings measurement of its own. tool: MIT last commit
  • OrcaRouter - production LinUCB bandit router (hybrid offline-online) - OrcaRouter is a production LLM router built on a LinUCB bandit, with its cost/quality tradeoff independently confirmed on the RouterArena leaderboard. paper
  • Plano (formerly archgw) - An Envoy-based proxy whose router matches queries to user-defined domains and actions via a small routing model, rather than picking by benchmark rank. Since July 2026 it also prices the warm cache a model switch would discard, and vetoes switches once their cumulative cost passes a configured overhead cap. tool: Apache-2.0 last commit
  • ruflo (formerly Claude-Flow) - cost-adjusted model routing - ruflo is an open-source agent meta-harness for Claude Code and Codex, providing swarm orchestration and persistent memory. Ships on npm as claude-flow (v3.17.0). tool: MIT last commit
  • vLLM Semantic Router - Sends routine queries to cheap or local models and hard ones to stronger backends, as an open-source, self-hostable router. tool: Apache-2.0 last commit
  • Weave Router - A drop-in proxy that picks a model for every request with an on-box embedding cluster scorer derived from Avengers-Pro, speaking all three provider APIs (BYOK, OTLP traces, one-command setup for Claude Code, Codex, and opencode). Source-available under Elastic License 2.0, which bars offering it as a hosted service; its cost-reduction figures are vendor-reported, not independently measured. tool: ELv2 last commit

Search and Retrieval Boundary

Serving Inference

Test-Time Compute

Tool Protocol Overhead

Govern

Allocation Chargeback

Anomaly Detection

Billing Audit FinOps

Budgets Caps

Policy Enforcement

Spend Management

  • ChatGPT Enterprise - usage analytics & spend controls - OpenAI's first-party spend layer for ChatGPT Enterprise/Business: a Global Admin Console with credit caps, request workflows, and a Cost API. tool: proprietary
  • Claude Enterprise - admin analytics & cost controls - Anthropic's first-party spend surface for Claude Enterprise/Team admins: org-level spend caps, model defaults, and per-user cost analytics via the Admin API. tool: proprietary
  • nable (finopsmcp) - An MCP server that reports cloud and AI spend in one answer: LLM cost by model across Anthropic, OpenAI and Bedrock next to the AWS, Azure and GCP bill. Runs locally, so credentials and cost data stay on the machine, and it proposes changes rather than making them. Apache-2.0 free local package; some features sit behind a paid tier. tool: Apache-2.0 last commit
  • PointFive (AI Efficiency OS / TokenShift) - PointFive's TokenShift governs coding-agent token spend across Claude Code, Cursor, Codex, and more, claiming a 10-20% cut across 11 partners. co
  • Revenium - Tracks AI agent spend at runtime to the cent, attributing every model call and tool cost to its workflow, with auto-shutoff on runaway budgets. co
  • Vantage - A FinOps platform ingesting native token-level cost data from Anthropic and OpenAI's own usage APIs, plus Cursor and cloud spend. co
  • Vercel AI Gateway - per-API-key budgets - Vercel AI Gateway lets you cap spend per API key in dollars (min $1) with a daily/weekly/monthly refresh, rejecting further requests once the cap is hit. tool: proprietary

Unit Economics

  • Paid (paid.ai) - A monetization platform for AI agents that sets pricing, tracks delivery cost per action and reports margin per customer; distinct from the similarly named Pay-i. co

Understand

Buyer Incentives

Compression Efficacy

Consolidation

Market Competitors

Market Sizing

Model Economics

Pricing Models

Reliability SLAs

Unit Economics

Measure

Benchmarks Evals

Cache Accounting

Cost Anatomy

Energy Carbon

  • Alumet - A Rust measurement framework (EUPL-1.2 or later) that reads hardware energy counters through RAPL, NVML, AMD SMI and Jetson INA plugins, and attributes the energy to processes, cgroups and Kubernetes pods. tool: EUPL-1.2-or-later last commit
  • CodeCarbon - An open-source (MIT) library for estimating a workload's energy use and CO2e emissions, and ML's widely-cited carbon baseline. tool: MIT last commit
  • EcoLogits - Estimates the energy and carbon footprint of calling generative-AI APIs: the hosted counterpart to CodeCarbon, which measures your own hardware. tool: MPL-2.0 last commit
  • Epoch AI - how much energy a query uses (the per-token energy anchor) - Epoch AI built a transparent, first-principles estimate of how much energy one LLM query costs.
  • Google - measuring the environmental impact of AI inference (provider disclosure) - Google published a first-party disclosure of the energy, carbon, and water cost of a median Gemini Apps text prompt, authored by Amin Vahdat and Jeff Dean. report
  • ML.ENERGY Leaderboard - Version 3.0 of this leaderboard measures real GPU inference energy across 46 models x 7 tasks, finding reasoning models use roughly 25x the energy of others. bench

Harness Overhead

Metering

Transcript Analysis

Whole Bill Accounting

Practices

Tool-agnostic, evidence-grounded standards for token-efficient agentic coding. Each is one page: TL;DR, claim, evidence, links. Browse the practices.

Concepts

Short reference notes explaining the ideas behind the practices: cache economics, the harness-waste taxonomy, orchestration economics. Browse the concepts.

Claims

Confidence-scored beliefs, clearly labeled as beliefs rather than facts, each with its strongest evidence linked. Read the claims.

Setups and skills

Runnable, validated Claude Code and Codex configurations and skills for token-efficient agentic coding, each labeled with how it was validated. Browse the setups.

Related lists

Footnotes

"I feel nervous when I have subscription left over. That just means I haven't maximized my token throughput."
Andrej Karpathy, No Priors (2026)

Maintained by the team at Quesma.