Check AI token usage, quotas, and costs across Anthropic and other providers using Anthropic OAuth API and OpenClaw session logs.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install ai-usage或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install ai-usage⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/ai-usage/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: ai-usage description: | Check AI usage across Anthropic and other providers. Use when: 1. User asks about AI usage, token usage, or quota 2. User says "what's my AI usage" or "how much have I used" 3. User asks about Anthropic/Claude usage or limits 4. User asks about costs or spending on AI 5. Monitoring usage during heartbeats (daily check) ---
python3 scripts/usage_check.py # Pretty report with gauges
python3 scripts/usage_check.py --json # JSON output for scripting
claude CLI in PATH) — for Anthropic quotaAnthropic (real quota from OAuth API):
Other Providers (from OpenClaw session logs):
OpenClaw Anthropic breakdown:
GET https://api.anthropic.com/api/oauth/usage using Claude Code's OAuth token from ~/.claude/.credentials.json (requires user:profile scope)claude --print -p "ok" (Claude Code refreshes its own OAuth token on any invocation), then re-reads the updated credentials file. If Claude Code isn't installed, Anthropic quota is skipped gracefully.~/.openclaw/agents/main/sessions/*.jsonl for per-provider/model token and cost data| Variable | Default | Description | |----------|---------|-------------| | OPENCLAW_SESSIONS_DIR | ~/.openclaw/agents/main/sessions | OpenClaw session log directory | | CLAUDE_CREDENTIALS_PATH | ~/.claude/.credentials.json | Claude Code credentials file |
--json for programmatic consumption (cron jobs, dashboards, alerts)安装 AI Usage 后,可以对 AI 说这些话来触发它
Help me get started with AI Usage
Explains what AI Usage does, walks through the setup, and runs a quick demo based on your current project
Use AI Usage to check AI token usage, quotas, and costs across Anthropic and other ...
Invokes AI Usage with the right parameters and returns the result directly in the conversation
What can I do with AI Usage in my developer & devops workflow?
Lists the top use cases for AI Usage, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/ai-usage/ 目录(个人级,所有项目可用),或 .claude/skills/ai-usage/(项目级)。重启 AI 客户端后,用 /ai-usage 主动调用,或让 AI 根据上下文自动发现并使用。
AI Usage 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
AI Usage 可免费安装使用。请查阅仓库了解许可证信息。
Check AI token usage, quotas, and costs across Anthropic and other providers using Anthropic OAuth API and OpenClaw session logs.
AI Usage 属于「Developer & DevOps」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my developer & devops tasks using AI Usage
Identifies repetitive steps in your workflow and sets up AI Usage to handle them automatically