ai-tools

mytokens & mysubs: AI coding usage, costs and subscription limits in the terminal

/_next/static/media/mytokens.0.otyh2d5y978.png
Rust
TypeScript
CLI
AI

Two command-line tools for keeping track of AI coding tools: mytokens shows how many tokens you used and what they would cost, and mysubs shows how much of each AI subscription you have left.

mytokens

mytokens reads the local history that AI coding tools keep on your machine and turns it into usage and cost reports in the terminal. It is written in Rust and builds on the open-source tokscale engine by Junho Yeo.

  • Reads local history from dozens of AI coding tools, including Claude Code, Codex CLI, OpenCode, Cursor, Gemini CLI and GitHub Copilot.
  • Estimates cost per model with pricing from OpenRouter, LiteLLM and models.dev.
  • Breaks usage down by tool, model, provider, project and device, measured in tokens, requests or cost.
  • Groups results by day, week, month or year, and draws them as charts in the terminal.
npm install -g mytokens
mytokens

mysubs

mysubs checks how much of your AI subscriptions you have used, across accounts and providers, in one place. It is written in TypeScript.

  • Supports Claude, Codex, GitHub Copilot, OpenRouter, OpenCode and Antigravity.
  • Detects accounts that are already signed in on your machine, so it often needs no setup.
  • Shows several accounts per provider, with aliases such as mysubs work to check one.
  • Keeps API keys out of the config file by reading them from environment variables or the system keyring.
  • Prints results as JSON with -j.
npm install -g mysubs
mysubs