Skip to main content
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

2

Open the web console

Navigate to http://localhost:8080 in your browser, or run:
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:

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:

Interactive Menu

Run the accounts command without arguments for an interactive menu:
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:
Important: Stop the proxy server before manually editing this file:
Changes won’t take effect until you restart the server.

Account Data Structure

Each account contains:
  • 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: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

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:
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:
Use the --no-browser flag for manual authorization:
Then copy the OAuth URL to a device with a browser.
Make sure you stopped the server before adding accounts:
Wait for the reset time to expire (shown in web console), or verify tokens:

Security Notes

OAuth Token Security
  • Refresh tokens are stored in plaintext in accounts.json
  • Protect this file with appropriate permissions:
  • 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: