home / skills / openclaw / skills / antigravity-balance

antigravity-balance skill

/skills/finderstrategy-cyber/antigravity-balance

This skill checks your Antigravity AI quota and token balance by querying the local language server, returning status and remaining quota.

npx playbooks add skill openclaw/skills --skill antigravity-balance

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
2.2 KB
---
name: antigravity-balance
description: Check Google Antigravity AI model quota/token balance. Use when a user asks about their Antigravity usage, remaining tokens, model limits, quota status, or rate limits. Works by detecting the local Antigravity language server process and querying its API.
---

# Antigravity Balance

Check your Antigravity AI model quota and token balance.

## Quick Start

```bash
# Check quota (auto-detects local Antigravity process)
node scripts/agquota.js

# JSON output for parsing
node scripts/agquota.js --json

# Verbose output (debugging)
node scripts/agquota.js -v
```

## How It Works

1. **Process Detection**: Finds the running `language_server_macos_arm` (or platform equivalent) process
2. **Extracts Connection Info**: Parses `--extension_server_port` and `--csrf_token` from process args
3. **Port Discovery**: Scans nearby ports to find the HTTPS API endpoint (typically extensionPort + 1)
4. **Queries Local API**: Hits `https://127.0.0.1:{port}/exa.language_server_pb.LanguageServerService/GetUserStatus`
5. **Displays Quota**: Shows remaining percentage, reset time, and model info

## Output Format

Default output shows:
- User name, email, and tier
- Model name and remaining quota percentage
- Visual progress bar (color-coded: green >50%, yellow >20%, red ≤20%)
- Reset countdown (e.g., "4h 32m")

JSON output (`--json`) returns structured data:
```json
{
  "user": { "name": "...", "email": "...", "tier": "..." },
  "models": [
    { "label": "Claude Sonnet 4.5", "remainingPercent": 80, "resetTime": "..." }
  ],
  "timestamp": "2026-01-28T01:00:00.000Z"
}
```

## Requirements

- Node.js (uses built-in `https` module)
- Antigravity (or Windsurf) must be running

## Troubleshooting

If the script fails:
1. Ensure Antigravity/Windsurf is running
2. Check if the language server process exists: `ps aux | grep language_server`
3. The process must have `--app_data_dir antigravity` in its args (distinguishes from other Codeium forks)

## Platform-Specific Process Names

| Platform | Process Name |
|----------|--------------|
| macOS (ARM) | `language_server_macos_arm` |
| macOS (Intel) | `language_server_macos` |
| Linux | `language_server_linux` |
| Windows | `language_server_windows_x64.exe` |

Overview

This skill checks your Antigravity AI model quota and token balance by detecting a local Antigravity language server and querying its local API. It reports user info, per-model remaining quota, and reset times, with optional JSON output for automation. Use it to quickly verify usage, limits, and potential rate limiting before making API calls.

How this skill works

The skill locates the running Antigravity language server process and parses its command-line arguments to extract the extension server port and CSRF token. It probes the nearby HTTPS port to reach the local language server API and calls the GetUserStatus endpoint. The response is displayed as a human-readable summary with a color-coded progress indicator or returned as structured JSON when requested.

When to use it

  • Before heavy API usage to confirm remaining tokens and avoid unexpected rate limits
  • When troubleshooting quota-related errors in applications that rely on Antigravity
  • To automate monitoring of team or personal model usage via JSON output
  • When you suspect the local Antigravity/Windsurf instance is misreporting limits
  • During development to validate model tier and reset schedules

Best practices

  • Run the check locally on the machine where Antigravity/Windsurf is running
  • Use the JSON flag for integration with monitoring scripts or dashboards
  • Ensure the language server process contains --app_data_dir antigravity to avoid false positives
  • If detection fails, confirm the platform-specific process name and that the server is active
  • Respect privacy: run only on systems you control since the script reads local process args

Example use cases

  • Quickly verify remaining quota before initiating a large batch of model requests
  • Integrate into CI or deployment pipelines to block jobs when quota is low
  • Automate alerts when a model’s remaining percentage falls below a threshold
  • Debug discrepancies between reported usage in the cloud console and the local agent
  • Provide operators with a one-command status check including reset countdown

FAQ

What platforms does this support?

It detects platform-specific language server binaries for macOS (ARM/Intel), Linux, and Windows and adjusts detection accordingly.

What do I do if the script cannot find the language server?

Confirm Antigravity/Windsurf is running, check process list for the language_server* binary, and verify the process has --app_data_dir antigravity in its args.