← Back to Skills Marketplace
t-atlas

Ag Model Usage

by Lian Junhong · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
499
Downloads
0
Stars
2
Active Installs
1
Versions
Install in OpenClaw
/install ag-model-usage
Description
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...
README (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 方式登录的账户。

Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ag-model-usage
  3. After installation, invoke the skill by name or use /ag-model-usage
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug ag-model-usage
Version 1.0.0
License
All-time Installs 2
Active Installs 2
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 499 downloads so far.

How do I install Ag Model Usage?

Run "/install ag-model-usage" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Ag Model Usage free?

Yes, Ag Model Usage is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Ag Model Usage support?

Ag Model Usage is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Ag Model Usage?

It is built and maintained by Lian Junhong (@t-atlas); the current version is v1.0.0.

💬 Comments