🤖 AI Summary
Toktop is a new htop‑style, terminal-based dashboard for monitoring LLM token usage and costs across OpenAI and Anthropic accounts. Targeted at devs and admins who prefer CLI workflows, it surfaces cost and usage metrics without hopping between web consoles, supports grouping by API key, and offers interactive controls (switch columns, choose date ranges, refresh, scroll). Installable via cargo (cargo install toktop --locked), it can read keys from environment variables, an env file, or prompt you at runtime.
Technically, Toktop uses organization-level admin endpoints: for OpenAI it queries cost (GET /v1/organization/costs) and usage (completions, embeddings, images) plus project/api_key endpoints if you want grouping by API key — so the OPENAI_ADMIN_KEY must have READ permission for Management API and Usage API scopes. For Anthropic it uses /v1/organizations/cost_report and /v1/organizations/usage_report/messages and requires an ANTHROPIC_ADMIN_KEY. The author notes limitations: Cursor’s admin API is enterprise-only and Gemini doesn’t expose similar usage/cost APIs, so those providers aren’t supported yet. For teams wanting quick, terminal-native visibility into LLM spend, Toktop provides a compact, actionable view tied to official billing and usage endpoints.
Loading comments...
login to comment
loading comments...
no comments yet