跳到正文
TakoAPI
返回技能列表

ai-usage

由 bshandley 提供

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

简介

Check AI usage across Anthropic and other providers.

描述

该技能的功能

Checks AI token usage and quota across Anthropic and other providers. Reads live quota data from Anthropic's OAuth API using Claude Code's credentials, and parses OpenClaw session logs for per-model token and cost stats from any routed provider.

It pulls real quota percentages directly from Anthropic's OAuth API rather than estimating from logs, so weekly and rolling-window numbers reflect actual limits.

何时使用

  • Checking remaining Anthropic quota before starting a long task
  • Reviewing end-of-month spending across AI providers
  • Running a daily background heartbeat on token consumption
  • Identifying which models have been called most this week
  • Feeding usage data into a cron job or dashboard via JSON output

示例工作流

输入

User asks: what's my Anthropic quota usage this week?

智能体
  1. 1

    Reads OAuth token from ~/.claude/.credentials.json

  2. 2

    Refreshes the token if expired by invoking Claude Code once

  3. 3

    Calls GET https://api.anthropic.com/api/oauth/usage for live quota data

  4. 4

    Parses OpenClaw session logs for per-model token and cost counts

  5. 5

    Prints a formatted report with utilization gauges and a reset countdown

输出

Console report showing weekly utilization %, 5-hour rolling window %, model-specific breakdowns for Sonnet and Opus, and token/cost stats from any other detected providers

前置要求

  • Claude Code installed and authenticated (claude CLI in PATH with valid credentials)

安装

clawhub install bshandley/ai-usage

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

链接