SuperAPI AI Directory

tokscale

tokscale is a high-performance command-line tool and visualization dashboard for tracking token usage and costs across multiple AI coding agents. It supports collecting usage from numerous platforms such as OpenCode, Claude Code, Codex CLI, Copilot CLI, Cursor IDE, Gemini CLI, and more, and provides an interactive TUI in the terminal (with overview, usage, models, daily, hourly, and other views), as well as JSON output for external visualization. Pricing is calculated in real time based on LiteLLM data, with support for tiered pricing and cached token discounts. It also offers features such as web visualization, task attribution reports, social leaderboards, and public profiles.

Open website

About this tool

tokscale is a high-performance command-line tool and visualization dashboard for AI coding agent scenarios, whose core purpose is to help users track and analyze token usage and costs from multiple AI coding agents. Its design is inspired by the Kardashev scale, treating tokens as the "energy" of the AI-assisted development era, used to measure an individual's scale of usage in AI-augmented development.

Main capabilities

  • Multi-platform support: can track OpenCode, Claude Code, Codex CLI, Prime Agent, Copilot CLI, Cursor IDE, Gemini CLI, Amp, Codebuff, Droid, OpenClaw, Hermes Agent, Pi, Kimchi Coding, Reasonix, Kimi CLI, Kimi Work, Qwen CLI, Roo Code, Kilo, Mux, Kilo CLI, Crush, Goose, Antigravity series, Zed, Kiro, Trae, Warp/Oz, Cline, Gajae-Code, Grok Build, Jcode, MiMo Code, Command Code, Junie, ZCode, OpenCodeReview, CodeBuddy, WorkBuddy, Devin series, Augment Code, Synthetic, Cherry Studio, LM Studio, Unsloth Studio, Hindsight, fx, Oh My Pi, Muse Code, and many other agents (the original lists a long inventory; code or installation commands are not changed one by one here).
  • Real-time pricing: fetches current pricing data from LiteLLM, with a 1-hour disk cache; supports OpenRouter fallback and Cursor model pricing to cover newly released models.
  • Detailed breakdown: tracks input, output, cache read/write, and reasoning tokens.
  • Native Rust core: all parsing and aggregation are done in Rust, with processing speed increased by about 10x.
  • Web visualization: interactive contribution graph, with 2D and 3D views.
  • Flexible filtering: can filter by platform, date range, or year.
  • Task attribution reports: LLM-based session summaries andtask grouping, supporting multiple backends (Apple FM, Claude, Codex, Gemini, Kiro, MiniMax).
  • JSON export: generates data for use by external visualization tools.
  • Social platform: share usage, participate in leaderboards, view public profiles.

How to use

  • Installation and running (installation commands remain as in the original): can be done via bunx tokscale@latest submit Submit usage data to the leaderboard and create a public profile.
  • Package structure: tokscale is an alias package (similar to swc) that installs @tokscale/cli; both install the same CLI and include the native Rust core (@tokscale/core).
  • Interactive TUI mode (default mode): provides 10 interactive views (Overview, Usage, Models, Daily, Hourly, Monthly, Sessions, Projects, Stats, Agents, plus an optional Minutely view enabled via minutelyTabEnabled). Supports keyboard and mouse navigation, GitHub-style contribution graph (configurable color theme), real-time filtering and sorting, flicker-free rendering.
  • Shortcut examples: ←/→/Tab/BackTab switch views; ↑/↓ or Home/End navigate lists; Enter opens details; Esc/Backspace closes a dialog or exits details; c/d/t sort by cost/date/token; j jumps to today; s opens the source selection dialog; g opens the grouping selection dialog (model, client+model, client+provider+model, workspace+model, session+model, client+session+model); h toggles Daily/Hourly chart granularity; v toggles Table/Profile view; b toggles subagent session rollup; y copies the selected row; p cycles color themes; L toggles light mode; r refreshes data, Shift+R toggles auto-refresh, +/- adjusts the interval; e exports JSON; q or Ctrl+C exits.
  • Grouping strategies: can be set in the TUI by pressing g or using --group-by。--group-by model(most merged),--group-by client,model(CLI default),--group-by client,provider,model(finest granularity),--group-by session,model(attribute cost by session),--group-by client,session,model、--group-by workspace,model(attribute by working directory). In the TUI, press g → Workspace + Model, then press w to toggle worktree rollup.
  • Client filtering: use --client(short -c) to limit the report to one or more clients; it can be repeated, accepts comma-separated values, and applies to all report commands. Possible values include opencode, claude, codex, copilot, gemini, cursor, amp, codebuff, droid, openclaw, hermes, pi, prime-agent, kimchi, kimi, qwen, roocode, kilocode, kilo, mux, crush, goose, antigravity, antigravity-cli, antigravity-extension, zed, kiro, trae, warp, cline, gjc, grok, jcode, micode, micode-desktop, commandcode, junie, zcode, opencodereview, codebuddy, augment, synthetic, cherrystudio, lmstudio, unsloth, hindsight, muse.
  • Breaking changes (v4.0.0): per-client boolean flags (such as --opencode、--claude、--codex) have been removed and will error; use the normalized --client/-cinstead, for example tokscale --client opencode,claude.
  • Date filtering: applies to all commands that generate reports (tokscale、tokscale models、tokscale monthly、tokscale graph). Uses the local time zone;--since and --until are both inclusive.
  • Pricing lookup: can look up real-time pricing for any model. The resolution strategy is multi-step: custom pricing override (from ~/.config/tokscale/custom-pricing.json), exact match, alias resolution (e.g. big-pickle → glm-4.7), tier suffix stripping (gpt-5.2-xhigh → gpt-5.2), version normalization, provider prefix matching, Cursor model pricing, fuzzy matching.
  • Custom pricing: create custom-pricing.json in the Tokscale configuration directory (macOS/Linux default ~/.config/tokscale/custom-pricing.json; when TOKSCALE_CONFIG_DIR is set, that directory takes precedence) to override model IDs that the upstream pricing database does not yet correctly cover. Override prices are entered in US dollars per million tokens, and Tokscale internally converts them to a per-token rate; at least one of input_cost_per_million_tokens or output_cost_per_million_tokens must be provided, while cache read/creation fields are optional; an explicit 0 is allowed, used to declare a free model (unlike omitting the field, which means the rate is unknown and usage is not priced). LiteLLM-style per-token field names are also supported, such as input_cost_per_token, output_cost_per_token, and cache_read_input_token_cost.

Use cases

Suitable for developers, teams, or individuals who need unified monitoring and comparison of token consumption across multiple AI coding agents; who want to understand cost attribution across different models/clients/projects; who need to attribute costs by session or workspace; or who want to participate in usage leaderboards and generate annual reports.

Limitations

  • Some clients do not record the workspace, and their usage is grouped into a single Unknown workspace row, making attribution by directory impossible (the original text states this is true for about half of the supported clients, including gemini, cursor, amp, droid, roocode, kilocode, goose, and Copilot's OTEL path).
  • Different clients record workspaces in inconsistent formats (for example, Claude Code uses a dash-escaped directory slug, while Codex and OpenCode store the real path), and tokscale attempts to resolve them back to real paths; however, the same repository reached through two different path spellings (a symlink and its target) will still appear as two rows, because workspace identity is compared as a string; the totals are unaffected.
  • No pricing/fee information is provided (apart from the pricing data and custom pricing mechanism, no fee description for the product itself is currently provided).