verstige/munroe/claude-cost-cli
- community
Checking that the SKILL.md file is still in the repository.
Query Claude API usage and cost reports from the command line. Secure macOS Keychain storage for Admin API key. Table/JSON output.
Install
npx vskill@latest install verstige/munroe/claude-cost-cliSKILL.md
claude-cost-cli
A CLI for querying Anthropic Admin API usage and cost data. Requires an Admin API key (sk-ant-admin...) from Claude Console → Settings → Admin Keys. Credentials are stored in macOS Keychain.
Installation
Requires Node.js >= 18 and macOS. The package is fully open source under the MIT license: https://github.com/cyberash-dev/claude-cost-cli
The npm package is published with provenance attestation, linking each release to its source commit via GitHub Actions. You can verify the published contents before installing:
Install from source (if you prefer to audit the code before running):
After installation the claude-cost command is available globally.
Quick Start
API Key Management
Store API key (interactive masked prompt, validates sk-ant-admin prefix):
Show stored key (masked):
Remove key from Keychain:
Usage Reports
JSON output (for scripting):
Output columns: Date, Model, Input Tokens, Cached Tokens, Output Tokens, Web Searches.
Cost Reports
JSON output (for scripting):
Output columns: Date, Description, Model, Amount (USD), Token Type, Tier.
Flag Reference
usage
| Flag | Description | Default | |
|---|---|---|---|
--from <date> | Start date (YYYY-MM-DD or ISO) | 7 days ago | |
--to <date> | End date (YYYY-MM-DD or ISO) | now | |
--period <days> | Shorthand period (7d, 30d, 90d) | 7d | |
--model <models> | Filter by model(s), comma-separated | all | |
--api-keys <ids> | Filter by API key ID(s), comma-separated | all | |
--group-by <fields> | Group by model, api_key_id, workspace_id, service_tier | model | |
--bucket <width> | Bucket width: 1d, 1h, 1m | 1d | |
--json | Output as JSON | false |
cost
| Flag | Description | Default | |
|---|---|---|---|
--from <date> | Start date (YYYY-MM-DD or ISO) | 7 days ago | |
--to <date> | End date (YYYY-MM-DD or ISO) | now | |
--period <days> | Shorthand period (7d, 30d, 90d) | 7d | |
--group-by <fields> | Group by workspace_id, description | description | |
--sum | Output total cost only | false | |
--json | Output as JSON | false |
Security and Data Storage
The following properties are by design and can be verified in the source code:
- Admin API key: stored exclusively in macOS Keychain (service:
claude-cost-cli). By design, never written to disk in plaintext. See `src/infrastructure/keychain-credential-store.ts` for the implementation. - No config files: all settings are passed via CLI flags. Nothing is stored on disk besides the Keychain entry.
- Network: by design, the API key is only sent to
api.anthropic.comover HTTPS. No other outbound connections are made. See `src/infrastructure/anthropic-usage-repository.ts` and `src/infrastructure/anthropic-cost-repository.ts`. - Scope: the Admin API key grants read-only access to organization usage and cost data. It cannot modify billing, create API keys, or access conversation content. This is a property of the Anthropic Admin API, not just this CLI.
- No caching: query results are not cached or persisted to disk. The CLI writes output to stdout only.
API Reference
This CLI wraps the Anthropic Admin API:
- Usage:
GET /v1/organizations/usage_report/messages - Cost:
GET /v1/organizations/cost_report
Documentation: https://platform.claude.com/docs/en/build-with-claude/usage-cost-api
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingscripts/template/skills/claude-cost-cli/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/verstige/munroe/claude-cost-cli)