← 返回 Skills 市场
Ag Model Usage
作者
Lian Junhong
· GitHub ↗
· v1.0.0
499
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install ag-model-usage
功能描述
Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trig...
使用说明 (SKILL.md)
model-usage Skill
查询并显示 AI 模型的使用配额、剩余百分比及下一次额度刷新时间。
功能
- 实时同步:直接从 Google 内部 API 获取最真实的账户配额数据。
- 状态监控:支持 Gemini、Claude 等核心模型的剩余额度展示。
- 时间预估:精准显示每个模型下次刷新的具体时间点(已转换为本地时区)。
使用方法
直接对 AI 说:
- "查看模型用量"
- "我还有多少额度"
- "model-usage"
内部原理
该技能通过读取 auth-profiles.json 中的 OAuth 令牌,模拟官方 IDE 客户端的行为向 Google 发起配额查询请求。
适用范围
仅适用于使用 Google Antigravity (Cloud Code Assist) OAuth 方式登录的账户。
安全使用建议
This script will read your agent's auth-profiles.json (~/ .openclaw/agents/main/agent/auth-profiles.json) to extract an OAuth access token and then call an internal Google quota API using that token. Before installing: (1) Review the auth-profiles.json contents and confirm you are comfortable a skill can read those OAuth tokens. (2) Prefer the skill explicitly declare the config path or ask for an explicit, limited (read-only) token rather than reading your full agent auth file. (3) Confirm you trust the endpoint (daily-cloudcode-pa.sandbox.googleapis.com) and the skill author; the code does not exfiltrate tokens but having local tokens read by third-party code is sensitive. (4) Consider running it manually yourself or in an isolated environment, or ask the author to add the config-path requirement and to document dependencies (requests). If you need help crafting a safer variant (e.g., accept a token via prompt or env var, or only accept a short-lived read-only token), ask the author to provide one.
功能分析
Type: OpenClaw Skill
Name: ag-model-usage
Version: 1.0.0
The skill accesses sensitive OAuth tokens by reading the `auth-profiles.json` file and uses them to query an internal Google API (`daily-cloudcode-pa.sandbox.googleapis.com`) while spoofing a specific User-Agent (`antigravity/1.16.5`). While the script's logic in `scripts/model_usage.py` aligns with its stated purpose of monitoring AI model quotas, the direct handling of authentication credentials and the use of undocumented/sandbox endpoints pose a significant security risk if the skill is not explicitly trusted.
能力评估
Purpose & Capability
Name/description target: per-model usage from Codex/Claude/CodexBar. Implementation: Python script that directly queries a Google 'antigravity' internal API (daily-cloudcode-pa.sandbox.googleapis.com) using an OAuth token found in a local auth-profiles.json. This is plausible for model-usage reporting, but the SKILL.md mentions CodexBar CLI/local cost JSON while code calls Google internal endpoints directly — a partial mismatch in how the data is obtained.
Instruction Scope
The script reads ~/.openclaw/agents/main/agent/auth-profiles.json to extract OAuth access tokens and projectId and then issues network requests to an internal Google endpoint. The SKILL metadata did not declare this config-path access; reading that file gives the skill access to sensitive credentials. While the script uses the token only to call the quota endpoint (it does not itself transmit tokens elsewhere), the instruction surface includes reading local agent auth data which is beyond a typical 'read-only' usage declaration.
Install Mechanism
No install spec (instruction-only plus a small Python script) — lowest install risk. One practical inconsistency: the script imports 'requests' but the manifest only declared python3 as a required binary and did not declare Python package dependencies. No downloads or arbitrary code installs are present.
Credentials
Registry metadata declares no required env vars or config paths, yet the code accesses a local config file that contains OAuth access tokens. This is effectively requesting credential access without declaring it in requires.env or requires.config — a proportionality / transparency issue. The number of external credentials requested is small (a single OAuth token), which fits the task, but it should be declared explicitly.
Persistence & Privilege
No 'always: true' or other elevated persistence. The skill is user-invocable and can be invoked autonomously (platform default), which is normal. The skill does not modify other skills or system-wide settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ag-model-usage - 安装完成后,直接呼叫该 Skill 的名称或使用
/ag-model-usage触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of the model-usage skill for CodexBar.
- Summarizes AI model usage and cost per model (Codex, Claude) using local CLI data.
- Provides real-time usage quota, remaining percentage, and next refresh time for each model.
- Supports queries for both current model and full model breakdowns.
- Only available to accounts using Google Antigravity OAuth login.
元数据
常见问题
Ag Model Usage 是什么?
Use CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trig... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 499 次。
如何安装 Ag Model Usage?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ag-model-usage」即可一键安装,无需额外配置。
Ag Model Usage 是免费的吗?
是的,Ag Model Usage 完全免费(开源免费),可自由下载、安装和使用。
Ag Model Usage 支持哪些平台?
Ag Model Usage 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Ag Model Usage?
由 Lian Junhong(@t-atlas)开发并维护,当前版本 v1.0.0。
推荐 Skills