Sandbox
@QuesmaOrg/awesome-ai-tokenomics

Awesome list for AI token economics

This repo collects links and short notes on how tokens are priced, measured, wasted, and controlled in AI workflows. It is split into practical pages, conceptual explanations, claims with evidence, and setup snippets for agents and coding tools.

172 stars21 forksPythonUpdated 8d ago
Who it's for

Builders who want to browse or copy token-cost guidance for Claude Code, Codex, and other agent workflows.

What it delivers

You can cut token waste, track spend, and choose cheaper agent workflows with better context hygiene.

What it does

Curated tool list

Groups tools by monitoring, compression, caching, gateways, and observability, with one-line explanations for each entry.

Practical guidance pages

Includes `practices/` pages on prompt cache hygiene, compaction discipline, routing, and whole-bill measurement.

Concept notes

Explains token economics topics such as cache accounting, orchestration economics, and waste taxonomy in `concepts/`.

Research track

Provides a reading path in `research/` for understanding, measuring, monitoring, optimizing, and governing token use.

Paste-ready setups

Offers `setups/` for Claude Code, Codex, and related skills so builders can reuse token-aware configurations.

Staleness and lint checks

Uses scripts in `scripts/` to lint the README and check whether list entries are stale.

README

Awesome AI Tokenomics Awesome

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

  • AgentSight - Uses eBPF to watch an AI agent from the kernel boundary, correlating what it said it would do with what it did, with under 3% overhead. tool: MIT last commit
  • OpenTelemetry eBPF Instrumentation (OBI) - GenAI / MCP - OBI is OpenTelemetry's zero-code eBPF instrumentation (formerly Grafana Beyla) that captures GenAI and MCP traces at the kernel layer with no SDK. tool: Apache-2.0

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

  • OpenLLMetry - An open-source set of OpenTelemetry-based SDKs and instrumentations, built by Traceloop, for LLM apps. tool: Apache-2.0 last commit
  • OpenTelemetry GenAI Semantic Conventions - OpenTelemetry's GenAI Semantic Conventions define the vendor-neutral token, cost, and cache attribute names that OpenLLMetry and Phoenix both converge on.

Tracing

  • Arize Phoenix - A source-available (Elastic License 2.0) LLM tracing platform recording per-span token counts and USD cost via OpenTelemetry. tool: Elastic-2.0 last commit
  • claude-tap - A local trace viewer intercepting API traffic from 14+ coding agents, showing per-request token breakdowns: input, output, cache read, cache creation. tool: MIT last commit
  • LangSmith - Cost Tracking - LangSmith is LangChain's commercial LLM/agent observability SaaS. co
  • Opik - Comet's open-source (Apache-2.0) LLM observability platform, with per-span USD cost estimated from token usage. tool: Apache-2.0 last commit

Optimize

Caching

  • khazad - A transport-layer semantic cache for LLM APIs on Redis 8 Vector Sets: it intercepts HTTP traffic with zero application code changes and replays cached responses. tool: MIT last commit
  • LMCache - A self-hosted KV-cache layer beneath vLLM, giving token-level cache-hit observability for teams who own their GPUs, not a hosted bill. tool: Apache-2.0 last commit
  • prompt-cache - A Go LLM proxy that adds a three-tier semantic cache: high similarity hits directly, low skips, and a gray zone runs a cheap verification model. tool: MIT last commit
  • Redis LangCache - Redis's fully managed semantic cache: a REST API that returns a stored response when a new query is similar to a past one. tool: proprietary

Cheap Local Models

  • llama.cpp - The foundational open-source (MIT) local LLM inference engine most of the local ecosystem runs on, with an OpenAI-compatible server built in. tool: MIT last commit
  • Ollama - A runtime for running open-weight models like Qwen, DeepSeek, and GLM-5.1 locally, shifting inference onto hardware you already own. tool: MIT last commit

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

Files in the repo

Repository payload13 top-level entries
  • .github
  • concepts
  • practices
  • research
  • scripts
  • setups
  • .gitignore
  • CITATION.cff
  • claims.md
  • CONTRIBUTING.md
  • LICENSE
  • LICENSE-CODE
  • README.md

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More collections

The awesome collection of OpenClaw skills. 5,400+ skills filtered and categorized from the official OpenClaw Skills Registry.🦞

52k
phuryn/
pm-skills
phuryn/pm-skillsCollections

PM Skills Marketplace: 100+ agentic skills, commands, and plugins — from discovery to strategy, execution, launch, and growth.

26k

Extracted system prompts from Anthropic - Claude Fable 5.1, Opus 5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro, Antigravity. xAI - Grok, Grok Bot, Cursor, Kimi and more! Updated regularly.

65k
1 add