← Back to Skills Marketplace
therealmrb123

xAI Prepaid Monitor

by Barry · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
59
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install xai-prepaid-monitor
Description
Monitor xAI prepaid credit balance with a reusable Python script and alert workflow. Use when setting up or troubleshooting low-credit checks for xAI/Grok us...
README (SKILL.md)

Use this skill to add a reusable xAI prepaid balance check to an OpenClaw setup.

What this skill provides

  • scripts/check_xai_balance.py, a small script that queries the xAI Management API and returns normalized JSON
  • a reference file with cron prompt patterns for:
    • alert-only monitoring
    • alert + follow-up task creation

Environment required

Set these env vars in OpenClaw config or the runtime environment before using the script:

  • XAI_TEAM_ID
  • XAI_MANAGEMENT_KEY

Optional thresholds:

  • XAI_BALANCE_WARN_BELOW_CENTS (default 300)
  • XAI_BALANCE_CRITICAL_BELOW_CENTS (default 200)

Run the script

Use:

/usr/bin/python3 /path/to/skills/xai-prepaid-monitor/scripts/check_xai_balance.py

The script prints JSON like:

{
  "ok": true,
  "status": "warn",
  "total_cents": 700,
  "used_cents": 450,
  "remaining_cents": 250,
  "total": "$7.00",
  "used": "$4.50",
  "remaining": "$2.50",
  "warn_below": "$3.00",
  "critical_below": "$2.00",
  "billing_cycle": "..."
}

Output contract

Interpret the result this way:

  • ok=false: the check failed, surface the error briefly
  • status=ok: no action needed
  • status=warn: remaining balance is below warning threshold
  • status=critical: remaining balance is below critical threshold

Recommended workflow

  1. Run the script with exec
  2. Parse the JSON output
  3. If ok=false, send a short failure alert
  4. If status=ok, stay quiet or log success
  5. If status=warn or critical, send a concise alert
  6. Optionally create a follow-up task in the user’s task system

Cron setup

For prompt patterns, read:

  • references/cron-examples.md

Guardrails

  • Keep delivery logic separate from the script. The script should only fetch and normalize balance data.
  • Do not hard-code Discord channel IDs, Todoist paths, or user-specific routing into the script.
  • Prefer environment variables for thresholds so the same script works across setups.
  • If the xAI API contract changes, update the script and the examples together.
Usage Guidance
This appears safe for its stated purpose if you are comfortable giving it an xAI management key and running it on a schedule. Store the key securely, verify the cron prompt and alert/task destinations, and remove the cron job and environment variables when you no longer need monitoring.
Capability Analysis
Type: OpenClaw Skill Name: xai-prepaid-monitor Version: 1.0.0 The skill is a straightforward utility for monitoring xAI prepaid balances. The Python script (scripts/check_xai_balance.py) uses the standard library to query the official xAI Management API and requires standard environment variables for authentication. There is no evidence of data exfiltration to unauthorized endpoints, malicious execution, or prompt-injection attacks designed to subvert the agent's behavior.
Capability Assessment
Purpose & Capability
The stated purpose matches the included Python script: it queries xAI billing data and prints normalized balance JSON. The main thing to notice is that it requires an xAI management credential.
Instruction Scope
The workflow asks the agent to run the included script, parse its JSON, alert on failures or low balance, and optionally create a follow-up task. The scope is narrow and the examples say not to do other work.
Install Mechanism
There is no install spec, no package installation, and no automatic execution. The script uses Python standard-library modules only.
Credentials
SKILL.md and README.md require XAI_TEAM_ID and XAI_MANAGEMENT_KEY, while the registry metadata declares no required env vars or primary credential. This is under-declared metadata, but the requirement is clearly disclosed in the skill documents.
Persistence & Privilege
The cron examples support recurring scheduled checks and optional task creation, but they are templates only and are not installed automatically.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install xai-prepaid-monitor
  3. After installation, invoke the skill by name or use /xai-prepaid-monitor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
xai-prepaid-monitor 1.0.0 – Initial release - Adds a Python script to check xAI prepaid credit balance via the xAI Management API, outputting normalized JSON for automation use. - Includes reference cron prompt patterns for alert-only monitoring and alert + follow-up task creation. - Supports environment-configurable thresholds for warning and critical balance levels. - Provides a recommended workflow for integrating alerts and follow-up actions based on balance status. - Offers guidance for setup, usage, and separation of delivery logic to ensure reusability and robust automation.
Metadata
Slug xai-prepaid-monitor
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is xAI Prepaid Monitor?

Monitor xAI prepaid credit balance with a reusable Python script and alert workflow. Use when setting up or troubleshooting low-credit checks for xAI/Grok us... It is an AI Agent Skill for Claude Code / OpenClaw, with 59 downloads so far.

How do I install xAI Prepaid Monitor?

Run "/install xai-prepaid-monitor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is xAI Prepaid Monitor free?

Yes, xAI Prepaid Monitor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does xAI Prepaid Monitor support?

xAI Prepaid Monitor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created xAI Prepaid Monitor?

It is built and maintained by Barry (@therealmrb123); the current version is v1.0.0.

💬 Comments