Skip to content

Repository files navigation

Antigravity Proxy Banner

Proxy v2.10.0 CI Extension v4.3.0 Claude Code Compatible Antigravity Powered MIT License Support Me ZAI Community

VS Code Antigravity Cursor

Install Extension

πŸš€ Antigravity Claude Code Proxy

Based on antigravity-claude-proxy by Badri Narayanan S (MIT License).

Use Claude Code CLI with Gemini, GPT-5, Grok, and 20+ AI models

A production-ready multi-provider AI gateway with session management and failover,
real-time status bar integration, and beautiful monitoring dashboard

What is this? β€’ Features β€’ Quick Start β€’ Models β€’ Dashboard β€’ Status Bar β€’ Development


πŸ“– What is this?

Antigravity Claude Proxy is a local proxy server that enables Claude Code CLI to use multiple AI providers:

Without Proxy With Proxy
Only Claude models 20+ AI models (Gemini, GPT-5, Grok, Claude, etc.)
Manual session handling Managed sessions with automatic failover
No monitoring Real-time dashboard
No status Status bar integration

How it Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                 β”‚      β”‚                      β”‚      β”‚                     β”‚
β”‚  Claude Code    │─────▢│  Antigravity Proxy   │─────▢│  Google AI (Gemini) β”‚
β”‚  CLI/Extension  β”‚      β”‚  localhost:8080      β”‚      β”‚  + Perplexity       β”‚
β”‚                 β”‚      β”‚                      β”‚      β”‚  + More providers   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ–ΌοΈ Showcase

Dashboard
Real-time dashboard with session health and usage stats

Quota Popup
Click status bar to see Claude & Gemini quotas with reset times

Model Switcher
One-click model switching between Flash, Pro, Opus, Sonnet, and more

Status Bar
Live model indicator in your IDE status bar (⚑ Flash, πŸ’Ž Pro, 🎭 Opus)


✨ Features

🎯 Core Capabilities

Feature Description
Multi-Provider Access Use Gemini, GPT-5, Grok, Claude, Kimi, and more through one API
Session Management Tracks signed-in sessions, keeps requests on a stable session and fails over when one is unavailable
Status Bar Integration See current model with emoji icons (βš‘πŸ’ŽπŸŽ­πŸŽ΅)
Beautiful Dashboard Monitor accounts, usage, and switch models at localhost:8080
Auto-Start Proxy starts when extension is enabled (opt-in)
Model Persistence Your selected model survives restarts

🧠 Smart Features

  • πŸ”„ Smart Routing: Extension dropdown Opus/Haiku/Default pass-through, Custom uses dashboard
  • ⚑ Agentic Fallback: Chat-only models auto-switch to agentic models for file operations
  • πŸ“Š Usage Tracking: Per-model and per-account statistics
  • πŸ›‘οΈ Reliability: Retries with backoff and routes around unavailable sessions

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ (CI runs the tests on Node 20 and 22)
  • PM2 (optional process manager) - npm install -g pm2
  • Antigravity desktop app (Download) or VS Code
  • Claude Code CLI (npm install -g @anthropic-ai/claude-code)

Installation

# Clone the repository
git clone https://github.com/muhib-karim/Antigravity-Claude-Code-Proxy.git
cd Antigravity-Claude-Code-Proxy/Antigravity-Claude-Code-Proxy

# Install dependencies
npm install

# Start the proxy in the foreground...
npm start

# ...or as a persistent background service with PM2
pm2 start src/index.js --name antigravity-proxy
pm2 save

Add an Account

Google sign-in needs an OAuth client secret, which is not stored in this repository. Set it first, in your shell or in a .env file next to package.json (copy .env.example, which lists every setting):

export GOOGLE_OAUTH_CLIENT_SECRET="<your OAuth client secret>"
# optional, if you use your own OAuth app:
export GOOGLE_OAUTH_CLIENT_ID="<your OAuth client id>"
npm run accounts:add     # opens a Google sign-in in your browser (needs a desktop browser)
npm run accounts:list    # show configured accounts

If no account is configured, the proxy still starts and /health answers, but /v1/messages returns a clear "No accounts available" error.

Configure Environment

Windows (PowerShell, not verified on Linux CI):

[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "http://localhost:8080", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "antigravity-proxy", "User")

macOS/Linux:

echo 'export ANTHROPIC_BASE_URL="http://localhost:8080"' >> ~/.bashrc
echo 'export ANTHROPIC_API_KEY="antigravity-proxy"' >> ~/.bashrc
source ~/.bashrc

Auto-Start on Windows Login (Optional)

Note: By default, the proxy only starts when you open Antigravity with the extension enabled. For system-wide startup on Windows login, run (Windows-only batch scripts; not verified on Linux):

cd scripts\setup
SETUP_STARTUP.bat

This will:

  • Register the proxy with PM2
  • Create a Windows startup script
  • Proxy starts automatically on Windows login

Start Using!

claude

Note: The proxy runs in the background via PM2. You can close any terminal or IDE window without affecting it. To check status: pm2 list. To stop: pm2 stop antigravity-proxy.


πŸ€– Models

⚑ Agentic Models (Full Capabilities)

Model Alias Best For
gemini-3-flash flash Fast tasks, simple commands
gemini-3-pro-high pro Complex coding, deep analysis
claude-opus-4-5-thinking claude-opus Complex reasoning
claude-sonnet-4-5-thinking claude-sonnet Balanced performance

The short aliases opus and sonnet map to the Perplexity models pplx-claude-opus / pplx-claude-sonnet, which are chat-only (no tool use).

πŸ” Search Models (Chat + Web Search)

Model Provider Description
pplx-grok Perplexity Grok 4.1 with web search
pplx-gpt51 Perplexity GPT-5.1 chat
pplx-kimi Perplexity Kimi (Moonshot)
sonar Perplexity Web search focused

Model Switching

# In Claude Code chat:
/model flash        # Switch to Gemini 3 Flash
/model pro          # Switch to Gemini 3 Pro
/model grok         # Switch to Grok (Perplexity)

# Or use dashboard:
# Open http://localhost:8080/dashboard

πŸ“Š Dashboard

Access the dashboard at http://localhost:8080/dashboard

Features:

  • Account Monitor: See all accounts, their status, and remaining quota
  • Model Switcher: Quick dropdown to change active model
  • Usage Statistics: Track requests per model
  • Health Status: See which sessions are healthy or need attention

πŸ“Š Status Bar Extension (v3.9+)

The status bar extension shows your current model and quota information in real-time:

Status Bar Icons

Icon Model
⚑ Gemini Flash
πŸ’Ž Gemini Pro
🎭 Claude Opus
🎡 Claude Sonnet
🌐 Grok
πŸ” Perplexity/Sonar

Quota Popup (Click Account Icon)

  • Model Quotas: Overall Claude & Gemini percentages with visual bars
  • Per-Account Breakdown: All connected accounts with individual quotas
  • Smart Sorting: Accounts with highest Claude quota shown first
  • Reset Times: Know exactly when your quota resets

Features

  • One-Click Model Switching: Click model name to switch instantly
  • Real-Time Updates: 5-second polling for accurate quota display
  • Offline Detection: Shows "Offline" in red when proxy is down
  • Open Dashboard: Quick link to full web dashboard

πŸ”Œ API Reference

Endpoint Method Description
/v1/messages POST Anthropic Messages API
/v1/models GET List available models
/active-model GET/POST/DELETE Model override control
/session-model POST Per-session model
/dashboard GET Web dashboard
/health GET Health check
/account-limits GET Account quotas

πŸ“ Project Structure

Antigravity-Claude-Code-Proxy/
β”œβ”€β”€ Antigravity-Claude-Code-Proxy/   # The proxy package (run npm commands here)
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ index.js           # Entry point (starts the HTTP server)
β”‚   β”‚   β”œβ”€β”€ server.js          # Express app and routes
β”‚   β”‚   β”œβ”€β”€ cloudcode-client.js# Upstream Cloud Code client with retries/failover
β”‚   β”‚   β”œβ”€β”€ account-manager.js # Multi-account handling
β”‚   β”‚   β”œβ”€β”€ format/            # Anthropic <-> Google format converters
β”‚   β”‚   β”œβ”€β”€ constants.js       # Model aliases & config
β”‚   β”‚   └── public/
β”‚   β”‚       └── dashboard.html # Web dashboard
β”‚   β”œβ”€β”€ tests/
β”‚   β”‚   β”œβ”€β”€ smoke/             # Offline tests run by `npm test`
β”‚   β”‚   └── *.cjs              # Live tests run by `npm run test:live`
β”‚   └── package.json           # v4.1.0
β”œβ”€β”€ scripts/                   # Windows setup/startup helpers (.bat/.ps1)
β”œβ”€β”€ docs/
β”‚   └── images/                # Showcase images
β”œβ”€β”€ SECURITY.md                # Security policy
└── CHANGELOG.md               # Version history

πŸ§ͺ Development & Testing

Run these from the package folder. They are the same steps CI runs (.github/workflows/ci.yml).

cd Antigravity-Claude-Code-Proxy/Antigravity-Claude-Code-Proxy

# Install exact dependencies from the lockfile.
# PUPPETEER_SKIP_DOWNLOAD=true skips the Chromium download, which is only needed for Perplexity browser login.
PUPPETEER_SKIP_DOWNLOAD=true npm ci

# Lint (errors fail the build; warnings are reported)
npm run lint

# Offline test suite (no accounts, keys or network needed)
npm test

# Run the proxy in the foreground, then check it from another terminal
npm start
curl http://localhost:8080/health

npm test uses Node's built-in test runner. It starts the real proxy on a free port with a temporary home folder and points it at a mock Cloud Code server. It covers /health, /v1/models, streaming and non-streaming /v1/messages, tool calls, per-session models, the no-account error path, the model-switch endpoints, cross-origin blocking, account-file persistence, and the request/response format converters.

The older end-to-end scripts talk to real models, so they need a running proxy with at least one configured account and are not part of npm test:

npm start            # terminal 1
npm run test:live    # terminal 2

Configuration

Variable Default Purpose
PORT 8080 HTTP port
HOST 127.0.0.1 Bind address. Only use 0.0.0.0 if you really want other machines to reach the proxy; it has no authentication
ACCOUNT_CONFIG_PATH ~/.config/antigravity-proxy/accounts.json Google account store
PROXY_STATE_DIR package folder Where logs/, model-override.json and session-models.json are written
CORS_ALLOWED_ORIGINS (empty) Extra comma-separated browser origins allowed to call the proxy (localhost and editor webviews are always allowed). If you set HOST=0.0.0.0 and open the dashboard via another address, add that address here, e.g. http://192.168.1.10:8080
GOOGLE_OAUTH_CLIENT_SECRET (none; required for Google sign-in and token refresh) OAuth client secret. Not stored in the repository
GOOGLE_OAUTH_CLIENT_ID built-in client id OAuth client id, for your own OAuth app
CLOUDCODE_ENDPOINTS Google Cloud Code endpoints Comma-separated upstream override (the tests point this at a mock server)

Perplexity browser login needs the optional browser packages: npm install puppeteer puppeteer-extra puppeteer-extra-plugin-stealth. Without them the proxy runs normally and only that feature reports an install hint.

Perplexity models are served through a separate Python server on localhost:8000 that is not part of this repository, so they are not covered by the tests.


πŸ”’ Security

  • No credentials in code: the OAuth client secret comes from GOOGLE_OAUTH_CLIENT_SECRET (older revisions embedded it; it is no longer in the source). All sensitive data stored locally; account files are written with owner-only permissions (0600)
  • Comprehensive .gitignore: Accounts, tokens, logs excluded
  • Local-only: Binds to 127.0.0.1 by default. Requests from other websites (foreign Origin headers) and, while bound to loopback, requests with a non-local Host header (DNS rebinding) are refused
  • npm audit clean: the headless-browser stack (Puppeteer) is an optional peer dependency used only by Perplexity browser login, so the default install has no known advisories. CI runs npm audit and a full-history gitleaks scan on every push
  • Secrets: .env.example lists every setting; .env is git-ignored. A Google OAuth client secret that the upstream project publishes appeared in early history and is allow-listed in .gitleaksignore; it is no longer in the source

See SECURITY.md for full security policy.


πŸ“‹ Version History

Version Type Features
v2.10 Extension v4.3.0 Offline tests + CI, security hardening, optional browser stack, npm audit clean
v2.9 Extension v4.3.0 Opt-in auto-start, proxy disabled by default
v2.7 Extension v4.1.1 Per-window model selection, workspace persistence
v2.6 Extension Per-session isolation, sessions dashboard
v2.5 Extension IDE account switcher, simplified layout
v2.4 Extension Direct OAuth, multi-state auth server
v2.3 Extension Per-window models, dark theme dashboard
v2.2 Extension PM2 process manager, Material Design
v2.1 Extension Robust model routing, faster polling
v2.0 Extension Status bar extension, model mapping
v1.2 CLI Smart routing, model persistence
v1.1 CLI Multi-account, Perplexity, dashboard
v1.0 CLI Initial release

See CHANGELOG.md for detailed history.


πŸ“œ License

MIT License - See LICENSE for details.

This project is built on antigravity-claude-proxy by Badri Narayanan S, used under the MIT License. The original copyright notice is kept in LICENSE.


Made with ❀️ for the Claude Code community
Report Bug β€’ Request Feature


❀️ Support This Project

If you find this project helpful, please consider buying me a coffee! Your support helps keep the updates coming.

Buy Me A Coffee

About

Local multi-provider gateway for using Claude Code with Gemini, GPT, Grok, and other models, with account rotation and monitoring.

Topics

Resources

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages