claude-usage-cli
Query Claude API usage and cost reports from the command line. Secure macOS Keychain storage for Admin API key. Table/JSON output.
Why use this skill?
Track your Anthropic Admin API token usage and spending with the claude-usage-cli. Secure, macOS Keychain-integrated reporting for developers.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/cyberash-dev/claude-usage-cliWhat This Skill Does
The claude-usage-cli provides a comprehensive command-line interface for monitoring and managing your Anthropic Admin API utilization. It allows developers and administrators to track token consumption and monetary spend directly from their macOS terminal. By integrating with the system-level macOS Keychain, the tool ensures that sensitive Admin API keys (sk-ant-admin...) are stored securely rather than in plaintext configuration files. Users can output data in readable tables or parseable JSON, making it ideal for integration into custom dashboards or reporting scripts. Please note: This tool is currently deprecated in favor of the more robust claude-cost-cli.
Installation
Installation requires Node.js version 18 or higher and an active macOS environment. You can install the tool globally via npm using the command npm install -g claude-usage-cli. For users who prefer to review the source code before execution, you may clone the repository directly from the cyberash-dev GitHub profile, run npm install, execute npm run build, and use npm link to register the binary locally. After installation, verify the setup by typing claude-usage --help in your terminal.
Use Cases
This skill is primarily used by technical teams to monitor API costs across various projects. It is useful for:
- Cost Attribution: Tracking token usage per workspace or specific API key to chargeback costs to individual projects.
- Budget Forecasting: Identifying usage spikes over 7-day or 30-day windows to prevent unexpected overages.
- Automated Reporting: Piping JSON output into cron jobs or alerting scripts that notify stakeholders when specific cost thresholds are approached.
- Granular Analysis: Breaking down usage by model or specific time buckets (hourly/daily) to optimize LLM performance and efficiency.
Example Prompts
- "OpenClaw, pull a cost report for the last 30 days and group it by workspace ID to help me figure out which team is using the most tokens."
- "Show me the total spend for the current billing cycle and generate a JSON report that I can export to my spreadsheet application."
- "List out the daily usage breakdown for claude-sonnet-4 over the last week so I can see if our recent deployment caused a jump in input tokens."
Tips & Limitations
- Security: Always use the
config set-keycommand to ensure your credentials are encrypted in your Keychain; avoid hardcoding keys in environment variables. - Compatibility: This tool is strictly for macOS; it will not function on Linux or Windows environments.
- Deprecation: Because this project is deprecated, ensure you review the
claude-cost-climigration guide for long-term support and potential new features.
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-cyberash-dev-claude-usage-cli": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: external-api, file-read
Related Skills
claude-cost-cli
Query Claude API usage and cost reports from the command line. Secure macOS Keychain storage for Admin API key. Table/JSON output.
caldav-cli
Manage CalDAV calendars (iCloud, Google, Yandex) from the command line. Supports OAuth2 and Basic auth, multi-account, table/JSON output.
grok-image-cli
Generate and edit images via Grok API from the command line. Cross-platform secure credential storage for xAI API key. Supports batch generation, aspect ratios, and style transfer.
tg-cli
Read-only Telegram CLI via MTProto. Lists chats, fetches messages, downloads media, manages local accounts/sessions. Does not send messages or modify Telegram data. Use when the user asks to read Telegram chats, fetch messages, download media, or automate Telegram data extraction.