Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/badrisnarayanan/antigravity-claude-proxy/llms.txt

Use this file to discover all available pages before exploring further.

The proxy supports multiple Google accounts for load balancing and failover. You can add accounts through the web dashboard, CLI, or automatic detection.

Adding Accounts

There are three methods to add Google accounts to the proxy:

Web Dashboard

Visual interface with OAuth popup (Recommended)

CLI

Terminal-based account management

Automatic

Auto-detect from Antigravity app

Web Dashboard

The easiest way to add accounts is through the web interface:
1

Start the proxy server

acc start
# or: antigravity-claude-proxy start
2

Open the web console

Navigate to http://localhost:8080 in your browser, or run:
acc ui
3

Add account via OAuth

  1. Click the Accounts tab
  2. Click Add Account
  3. Complete Google OAuth authorization in the popup window
  4. Your account will appear in the accounts list with subscription tier and quota information
Headless/Remote Servers: The WebUI supports “Manual Authorization” mode. After clicking “Add Account”, copy the OAuth URL, complete authorization on your local machine, and paste the authorization code back into the form.

CLI Method

For terminal users or headless servers:
Opens browser automatically for OAuth flow:
antigravity-claude-proxy accounts add

Automatic Detection

If you have the Antigravity desktop app installed and logged in, the proxy automatically detects your local session. No additional setup required.
The proxy will use the OAuth token from Antigravity’s local database at ~/.config/Antigravity/Local Storage/leveldb.

Managing Accounts

CLI Commands

The proxy provides a full suite of account management commands:
antigravity-claude-proxy accounts list

Interactive Menu

Run the accounts command without arguments for an interactive menu:
antigravity-claude-proxy accounts
Options:
  • (a)dd new - Add another account
  • (r)emove existing - Remove specific accounts
  • (f)resh start - Clear all and start over
  • (e)xit - Cancel and exit

Account Configuration File

Accounts are stored in:
~/.config/antigravity-proxy/accounts.json
Important: Stop the proxy server before manually editing this file:
acc stop
Changes won’t take effect until you restart the server.

Account Data Structure

Each account contains:
{
  "email": "user@gmail.com",
  "source": "oauth",
  "refreshToken": "encrypted_token",
  "projectId": "auto-detected-project",
  "enabled": true,
  "addedAt": "2026-03-02T10:30:00.000Z",
  "lastUsed": 1709377800000,
  "subscription": {
    "tier": "pro",
    "projectId": "project-123",
    "detectedAt": "2026-03-02T10:30:00.000Z"
  },
  "quota": {
    "models": {
      "claude-sonnet-4-5-thinking": {
        "remainingFraction": 0.85,
        "resetTime": 1709467800000
      }
    },
    "lastChecked": 1709377800000
  },
  "quotaThreshold": 0.10,
  "modelQuotaThresholds": {
    "claude-opus-4-6-thinking": 0.20
  },
  "modelRateLimits": {}
}
  • email: Account identifier
  • source: oauth, manual, or database
  • refreshToken: OAuth refresh token (auto-renewed)
  • projectId: Google Cloud project (auto-detected)
  • enabled: Enable/disable account without removing
  • subscription.tier: free, pro, or ultra
  • quota.models: Per-model quota cache (0-1 fraction)
  • quotaThreshold: Account-level minimum quota before switching (0-0.99)
  • modelQuotaThresholds: Per-model threshold overrides
  • modelRateLimits: Temporary rate limit state (runtime only)
Automatically detected from the Cloud Code API:
TierBadge ColorFeatures
UltraPurpleHighest quota limits, priority access
ProBlueStandard quota limits
FreeGrayBasic quota limits
Tier detection happens on first API request or when checking account limits.

Account Status

Web Console

The Accounts tab shows:
  • Subscription tier badge (Ultra/Pro/Free)
  • Quota progress bars per model
  • Rate limit status (with reset countdown)
  • Enable/disable toggle
  • Last used timestamp
  • Health inspector (when Developer Mode enabled)

Check Limits via API

# JSON format
curl http://localhost:8080/account-limits

# Table format (human-readable)
curl "http://localhost:8080/account-limits?format=table"

# Include 30-day usage history
curl "http://localhost:8080/account-limits?includeHistory=true"

Quota Protection

Set minimum quota thresholds to switch accounts before quota runs out:
Server-wide default for all accounts:Web Console: Settings → Quota Protection → Global ThresholdConfig File:
{
  "globalQuotaThreshold": 0.10  // Switch at 10% remaining
}
Priority Order: Per-model threshold > Per-account threshold > Global threshold > Default (0)Thresholds are stored as fractions (0-0.99) and displayed as percentages (0-99%) in the UI.

Troubleshooting

The refresh token may have expired. Re-authenticate:
  1. In the web console, click Fix Account on the invalid account
  2. Or remove and re-add via CLI:
    antigravity-claude-proxy accounts remove
    antigravity-claude-proxy accounts add
    
Use the --no-browser flag for manual authorization:
antigravity-claude-proxy accounts add --no-browser
Then copy the OAuth URL to a device with a browser.
Make sure you stopped the server before adding accounts:
acc stop
antigravity-claude-proxy accounts add
acc start
Wait for the reset time to expire (shown in web console), or verify tokens:
antigravity-claude-proxy accounts verify

Security Notes

OAuth Token Security
  • Refresh tokens are stored in plaintext in accounts.json
  • Protect this file with appropriate permissions:
    chmod 600 ~/.config/antigravity-proxy/accounts.json
    
  • Never commit accounts.json to version control
  • Tokens are automatically renewed when they expire
Optional Web Console PasswordSet a password to protect the web interface:
WEBUI_PASSWORD=your-secure-password acc start