ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 4/5

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.

Why use this skill?

Efficiently monitor your Anthropic Claude API spending and token usage with this secure macOS CLI tool. Features Keychain storage and JSON output for easy reporting.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/cyberash-dev/claude-cost-cli
Or

What This Skill Does

claude-cost-cli is a powerful command-line interface designed for monitoring, auditing, and managing Anthropic Admin API usage and expenses. By interacting directly with the Anthropic Admin API, this tool allows developers and system administrators to retrieve detailed breakdowns of token consumption and monetary spend. It prioritizes security by utilizing macOS Keychain for the persistent storage of sensitive Admin API keys, ensuring credentials are never stored in plaintext files. Whether you need to track daily model usage, analyze costs by workspace, or export raw data for automated reporting, this tool provides a robust, scriptable interface.

Installation

This skill requires Node.js (version 18 or higher) and a macOS environment. The package is available via npm and can be installed globally using: npm install -g claude-cost-cli. For transparency, you may audit the source code by cloning the GitHub repository: git clone https://github.com/cyberash-dev/claude-cost-cli.git, then running npm install && npm run build && npm link. After installation, execute claude-cost config set-key to securely save your API credentials to your Keychain.

Use Cases

This skill is perfect for:

  1. Cloud Cost Optimization: Identifying which projects, workspaces, or specific API keys are driving the highest expenditure.
  2. Usage Auditing: Performing granular analysis on token usage patterns, such as verifying the ratio of cached tokens versus standard input tokens.
  3. Automated Reporting: Piping JSON output from the CLI into custom dashboards, spreadsheet automation tools, or logging systems to track monthly spend across multiple enterprise projects.
  4. Security Hardening: Ensuring that sensitive API keys are not hard-coded in scripts by leveraging native OS credential management.

Example Prompts

  1. "Check the total cost for all my Claude API usage over the last 30 days and output it as a summary."
  2. "Show me a detailed usage report grouped by model for the previous month, outputting the result in JSON format for my dashboard."
  3. "List all costs associated with my primary workspace for the current week to help me stay within my budget."

Tips & Limitations

  • Security: Always use the built-in configuration commands to manage your API keys; do not store your sk-ant-admin keys in environment variables or configuration files.
  • Scope: This tool currently requires the Anthropic Admin API and is limited to macOS systems due to its reliance on Keychain services.
  • Precision: When performing analysis, utilize the --bucket flag for time-series granularity or the --group-by flag to drill down into specific cost drivers like workspace IDs.

Metadata

Stars3409
Views0
Updated2026-03-25
View Author Profile
AI Skill Finder

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 skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-cyberash-dev-claude-cost-cli": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#claude#api-monitoring#cli#cost-tracking#developer-tools
Safety Score: 4/5

Flags: external-api