Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

toktop

> AI 编程
Open source

llm usage monitor in terminal

170 stars0 likes3 views
WebsiteGitHub

About

llm usage monitor in terminal

toktop is a terminal-based dashboard for OpenAI and Anthropic token usage and costs. It allows user (admin of their openai and anthropic accounts) to monitor their usage inside terminal without constantly jumping into different websites.

Installation

bash
cargo install toktop --locked

Usage

bash
# 1. Set Environment Variables
export OPENAI_ADMIN_KEY="your-openai-key"
export ANTHROPIC_ADMIN_KEY="your-anthropic-key"
toktop

# 2. Use env file
toktop -e .env

# 3. Don't set env var, toktop will prompt for api key
toktop

Hotkeys

  • ←/→ - Switch between options columns (Provider, Metrics, Date Range, Group By)
  • ↑/↓ - Choosing options
  • h/l - Scrolling charts if scroll bar is present
  • r - Refresh data
  • q - Quit the application

API Keys

OPENAI

It requires $OPENAI_ADMIN_KEY from https://platform.openai.com/settings/organization/admin-keys with READ permission to Management API Scope and Usage API Scope.

It tracks two data:

  1. Cost: GET /v1/organization/costs
  2. Usage:
    • GET v1/organization/usage/completions
    • GET v1/organization/usage/embeddings
    • GET v1/organization/usage/images

To group by API Keys, it also needs read access to the following endpoint:

  1. Get project ids: GET v1/organization/projects
  2. Get api key names from projects: GET v1/organization/projects/{project_id}/api_keys

ANTHROPIC

It requires $ANTHROPIC_ADMIN_KEY from https://console.anthropic.com/settings/admin-keys.

It tracks two data:

  1. Cost: GET /v1/organizations/cost_report
  2. Usage: GET /v1/organizations/usage_report/messages

Others

I would love to track my other LLM spends from Gemini and Cursor as well. Unfortunately, Cursor Admin API requires enterprise plan, which I don't have at the moment. Gemini does not seem to expose usage/cost in API in the same manner.

Issues· 5 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustanthropicllmopenairust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.