跳到正文
TakoAPI
返回技能列表

claude-usage-cli

由 cyberash-dev 提供

Browser & Automation
855下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Query Claude API usage and cost reports from the command line.

描述

该技能的功能

CLI tool for querying Anthropic Admin API usage and cost reports from the terminal. Stores the Admin API key in macOS Keychain. Outputs data as formatted tables or JSON. Note: this package is deprecated; claude-cost-cli is the maintained replacement.

Storing credentials in macOS Keychain avoids plaintext API key files that other CLI tools often require.

何时使用

  • Check daily token spend across Claude models
  • Pull last 30 days of cost data into a script
  • Filter usage by specific API key IDs
  • Get hourly granularity on a busy billing period
  • Verify total monthly spend before invoice arrives

示例工作流

输入

User asks: how much did I spend on Claude last month?

智能体
  1. 1

    Run claude-usage config set-key to store Admin API key in Keychain

  2. 2

    Run claude-usage cost --period 30d to fetch last 30 days of cost data

  3. 3

    Review table output showing Date, Description, Model, Amount (USD), Token Type, and Tier

  4. 4

    Run claude-usage cost --period 30d --sum to get a single total figure

输出

Table of daily cost breakdown by model plus a total USD figure for the past 30 days

前置要求

  • Anthropic Admin API key (sk-ant-admin...) from Claude Console → Settings → Admin Keys
  • macOS (Keychain storage is macOS-only)

安装

clawhub install cyberash-dev/claude-usage-cli

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接