claude-cost-cli
由 cyberash-dev 提供
Browser & Automation简介
Query Claude API usage and cost reports from the command line.
描述
该技能的功能
CLI tool for querying Anthropic Admin API usage and cost data. Stores the Admin API key in macOS Keychain. Outputs tables or JSON for scripting.
Avoids logging into the Claude Console just to check usage, and outputs JSON for piping into scripts or dashboards.
何时使用
- Check daily Claude API spend before end of billing cycle
- Filter token usage by model to compare costs across deployments
- Export monthly cost report as JSON for expense tracking
- Monitor hourly usage spikes during high-traffic periods
- Audit which API keys are consuming the most tokens
示例工作流
User asks: show me my Claude API costs for January 2026 grouped by workspace
- 1
Run
claude-cost config set-keyto store the Admin API key in macOS Keychain - 2
Run
claude-cost cost --from 2026-01-01 --to 2026-01-31 --group-by workspace_id - 3
Review table output showing Date, Description, Model, Amount (USD), Token Type, Tier per workspace
- 4
Optionally rerun with
--jsonflag to pipe results into another tool
Cost breakdown table for January 2026, one row per workspace entry
前置要求
- Anthropic Admin API key (sk-ant-admin...) from Claude Console under Settings > Admin Keys
- macOS (Keychain storage is required)
安装
clawhub install cyberash-dev/claude-cost-cli运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。