xAI (x.ai). Use this skill for ANY xAI request — reading, creating, and updating data. Whenever a task involves xAI, use this skill instead of calling the AP...
Coding
xAI OAuth Usage Checker
Try itRead-only Hermes Agent skill for checking xAI OAuth usage, remaining quota, and reset time with Japanese/English output.
What it does
Use when a Hermes Agent user asks to check xAI OAuth usage, remaining quota, or reset time without refreshing or modifying credentials.
The skill document
Hermes xAI Usage Checker
Hermesのcanonical OAuth credentialを使い、xAIの週間利用率とリセット時刻を読み取り専用で確認する。 credentialの変更、再認証、課金操作は行わず、モデル固有の上限だとも断定しない。
When to Use
- xAI OAuth / Grokの利用率、残量、リセット日時を聞かれたとき
xai-oauth/grok-4.6がbillingまたはquota exhaustedになったとき- quota回復後にHermesのfallbackや
x_searchを再検証できるか判断するとき
Prerequisites
- Hermesのcanonical auth storeに有効な
xai-oauthcredentialがあること python3と、https://cli-chat-proxy.grok.comへのHTTPS接続が使えること- ユーザーがxAI Billing endpointへのOAuth読み取り照会を承認済みであること。未承認なら先に確認する
How to Run
Hermesのterminalで、sanitized JSON出力を指定して実行する。
terminal(command='python3 "${HERMES_SKILL_DIR}/scripts/check_xai_usage.py" --json', timeout=30)
人間向け表示だけが必要な場合もterminalを使い、--jsonを外す。
通常表示とstderrはHERMES_LANGUAGE、次にHermesのdisplay.languageへ従う。日本語設定なら日本語、それ以外や設定取得失敗時は英語になる。JSONのキーとエラー文は英語固定。
実行ファイル: scripts/check_xai_usage.py
Quick Reference
| 出力 | 意味 |
|---|---|
used_percent | 現在の週間利用率 |
remaining_percent | 100 - used_percent(0未満にはしない) |
period_end_jst | Billing APIが返した期間終了をJSTへ変換した時刻 |
remaining_seconds | 実行時点から期間終了までの秒数 |
product_usage | Billing APIが返した製品別利用率 |
source_host | 成功時はcli-chat-proxy.grok.com |
Procedure
- 依頼が利用枠の読み取り照会であり、認証変更や課金操作を含まないことを確認する。
How to Runのterminal呼び出しを一度実行する。redirect、login、logout、refresh、reset、top-upは行わない。status: okなら、利用率、残量、period_end_jst、残り時間、product_usageだけをHermesの表示言語で簡潔に報告する。remaining_percentが0でremaining_secondsが正なら、quota回復前として扱う。status: errorなら、errorとhttp_statusだけを報告し、401/403でも自動再認証しない。- access token、refresh token、ID token、
auth.jsonの内容、生のAPIレスポンスを表示・保存・回答へ含めない。
報告例:
xAI OAuthの週間枠は100%使用済みです。
リセットは2026-08-29 23:04 JST、残り約29時間3分です。
内訳: GrokBuild 100%。
Pitfalls
billingの期間は統合された週間枠の場合がある。Grok 4.6固有のlimitとは断定しない。- 残り時間は実行中に減る。回答では
period_end_jstを正本にし、残り時間は概算と明記する。 - リセット時刻を過ぎてもHermesが
billingのままなら、blind resetせず一度だけ再照会する。 - usage画面の表示がなくてもAPI照会結果を優先するが、失敗時は未確認として扱う。
- scriptはredirectを拒否する。別hostへAuthorization headerを送る代替実装に変更しない。
Verification
source checkoutでは、skill directory内でネットワークを使わない回帰テストを実行する。
python3 -m unittest discover -s tests -v
Hermesからインストールしたskillでは、ネットワークを使わないsmoke testを実行できる。
terminal(command='python3 "${HERMES_SKILL_DIR}/scripts/check_xai_usage.py" --help', timeout=30)
承認済みの場合だけHow to Runのlive照会も行い、status: ok、正しいsource_host、token fieldがないことを確認する。
Related skills
Xero (xero.com). Use this skill for ANY Xero request — reading, creating, and updating data. Whenever a task involves Xero, use this skill instead of calling the API directly.
Xata (xata.io). Use this skill for ANY Xata request — searching and reading data. Whenever a task involves Xata, use this skill instead of calling the API directly.
Check OATDA account balance, remaining credits, and total usage via the unified AI gateway. Triggers when the user asks "how much OATDA credit do I have left...
Humaans (humaans.io). Use this skill for ANY Humaans request — searching and reading data. Whenever a task involves Humaans, use this skill instead of calling the API directly.
Back up and restore Hermes Agent data — config, secrets, skills, sessions, memories, cron, profiles. Creates portable tar.gz archives with SQLite consistent snapshots, JSON manifest, and integrity verification. Use when: "back up hermes", "restore hermes", "migrate hermes to new machine", "hermes backup", "hermes restore", "hermes 数据备份", "hermes 数据恢复".