Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

ai-usage

bởi bshandley

Coding Agents & IDEs
464Lượt tải do clawskills.sh công bố
0Lượt xem
0 lượt thíchĐăng nhập để thích kỹ năng này
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

Check AI usage across Anthropic and other providers.

Mô tả

Kỹ năng này làm gì

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.

Khi nào nên dùng

  • 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

Quy trình ví dụ

ĐẦU VÀO

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

AGENT
  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

ĐẦU RA

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

Yêu cầu

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

Cài đặt

clawhub install bshandley/ai-usage

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết