Run Claude Code on 20+ models.
A local proxy at localhost:8080 that speaks the Anthropic Messages API, so Claude Code can use Gemini, GPT, Grok, Claude, Kimi and Perplexity search models, with managed sessions, automatic failover, a live dashboard and a status bar in your IDE.
How it works
Claude Code sends Anthropic Messages requests to the proxy. The proxy validates them, picks a model and a signed-in account, translates the request for the upstream and streams the reply back as Anthropic server-sent events. Transient upstream failures are retried with backoff before the first event reaches the client; after that, the stream is never replayed.
Step through the same path, with links to the code behind each step, in the interactive streaming-request diagram.
Features
Gemini, GPT, Grok, Claude, Kimi and more through one Anthropic-compatible endpoint.
Keeps requests on a stable signed-in session and moves to another when one is unavailable.
Accounts, usage and one-click model switching at localhost:8080/dashboard.
Current model and quotas with reset times, right in VS Code or Antigravity.
Chat-only models switch to an agentic model automatically when tools are needed.
Node.js 22.13+ or a non-root Docker image with a healthcheck, probes and Prometheus metrics.
What v2.11.0 verifies
Every claim below is checked in CI on Node 22 and 24 against a scripted mock upstream with synthetic fixtures. No provider accounts, keys or network access are involved, so these checks show protocol behaviour, not live model access.
| Area | What is checked | Evidence |
|---|---|---|
| Anthropic conformance | Request and response mapping, SSE event order, tool_use and tool_result round-trips, system prompts, stop reasons, usage fields, thinking models | 37 JSON fixtures |
| Error mapping | 400, 401, 403, 404, 413, 429, 502, 504 and 529 as Anthropic error types, with retry-after when the reset is known, including on streaming requests | error-mapper.js |
| Resilience | Exponential backoff with jitter, Retry-After, bounded timeouts, no replay of a started stream, cancellation on client disconnect, account cooldown and rotation, graceful shutdown that drains streams | unit and integration tests |
| Hardening | Request validation, body size limit, routing-header allow-list, credentials never forwarded upstream, secrets redacted from logs, security headers, rate limiting, linear-time parsing of prompt text | hardening tests |
| Quality gates | 222 offline tests, coverage gate of 80% for lines, statements, functions and branches, tsc --noEmit, ESLint, Prettier, CodeQL with zero open alerts, gitleaks, npm audit | CI runs |
Showcase



Quick start
With Node.js 22.13+
git clone https://github.com/muhib-karim/Antigravity-Claude-Code-Proxy.git
cd Antigravity-Claude-Code-Proxy/Antigravity-Claude-Code-Proxy
npm install
export GOOGLE_OAUTH_CLIENT_SECRET="<your OAuth client secret>"
npm run accounts:add # Google sign-in in your browser
npm start # proxy on http://localhost:8080
With Docker
docker build -t antigravity-claude-code-proxy \
Antigravity-Claude-Code-Proxy
docker run --rm -p 127.0.0.1:8080:8080 \
-v agp-data:/data antigravity-claude-code-proxy
# accounts live in the volume at /data/accounts.json
Point Claude Code at it
export ANTHROPIC_BASE_URL="http://localhost:8080"
export ANTHROPIC_API_KEY="antigravity-proxy"
claude # Claude Code now goes through the proxy
Operations
GET /livezThe process is up. Stays 200 while a shutdown drains.
GET /readyzAt least one account can serve requests; 503 otherwise or while draining.
GET /metricsPrometheus text: requests, latency, upstream retries and account states.
Docs
The shortest path to a working setup.
Every step, with checks along the way.
Add more Google AI accounts for failover.
How credentials are stored and what never leaves your machine.
What changed in each release.
Endpoints the proxy exposes.
