| Crates.io | toktop |
| lib.rs | toktop |
| version | 0.1.5 |
| created_at | 2025-11-08 20:48:00.929089+00 |
| updated_at | 2025-12-07 22:15:27.006614+00 |
| description | A terminal-based LLM cost and usage monitor |
| homepage | |
| repository | https://github.com/htin1/toktop |
| max_upload_size | |
| id | 1923260 |
| size | 197,299 |
__ __ __
| \ | \ | \
_| $$_ ______ | $$ __ _| $$_ ______ ______
| $$ \ / \ | $$ / \| $$ \ / \ / \
\$$$$$$ | $$$$$$\| $$_/ $$ \$$$$$$ | $$$$$$\| $$$$$$\
| $$ __ | $$ | $$| $$ $$ | $$ __ | $$ | $$| $$ | $$
| $$| \| $$__/ $$| $$$$$$\ | $$| \| $$__/ $$| $$__/ $$
\$$ $$ \$$ $$| $$ \$$\ \$$ $$ \$$ $$| $$ $$
\$$$$ \$$$$$$ \$$ \$$ \$$$$ \$$$$$$ | $$$$$$$
| $$
| $$
\$$
htop but for llm tokens
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.
cargo install toktop --locked
# 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
←/→ - Switch between options columns (Provider, Metrics, Date Range, Group By)↑/↓ - Choosing optionsh/l - Scrolling charts if scroll bar is presentr - Refresh dataq - Quit the applicationIt 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:
GET /v1/organization/costsGET v1/organization/usage/completionsGET v1/organization/usage/embeddingsGET v1/organization/usage/imagesTo group by API Keys, it also needs read access to the following endpoint:
GET v1/organization/projectsGET v1/organization/projects/{project_id}/api_keysIt requires $ANTHROPIC_ADMIN_KEY from https://console.anthropic.com/settings/admin-keys.
It tracks two data:
GET /v1/organizations/cost_reportGET /v1/organizations/usage_report/messagesI 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.