Important
Source code has moved to a private repository for long-term sustainability. Binaries, Docker images, and releases will continue to be published here.
Want access to the source?
- Open a Discussion on this repo
- Join our Telegram and DM me
Read-only access is granted on request.
OpenAI, Anthropic, and Gemini-compatible proxy for Google's Antigravity.
Early stage. Ran this on OpenCode with an Ultra account for 3 days straight, stress testing the whole time. No issues so far.
This software is developed on Linux. I aim to support every OS as best as possible, so if there is any issue please open an issue and I will be happy to assist.
Star the repo so more people can find it while it still works. Issues and PRs are welcome.
| Name | Label | Notes |
|---|---|---|
opus-4.6 |
Claude Opus 4.6 (Thinking) | Default model |
sonnet-4.6 |
Claude Sonnet 4.6 (Thinking) | — |
opus-4.5 |
Claude Opus 4.5 (Thinking) | — |
gemini-3-pro |
Gemini 3 Pro (High) | Default Pro tier |
gemini-3-pro-high |
Gemini 3 Pro (High) | Alias |
gemini-3-pro-low |
Gemini 3 Pro (Low) | — |
gemini-3-flash |
Gemini 3 Flash | Recommended for dev |
# Headless mode (no running Antigravity app needed)
RUST_LOG=info ./zerogravity --headless
# Or use the daemon manager
zg startThe proxy needs an OAuth token:
- Env var:
ZEROGRAVITY_TOKEN=ya29.xxx - Token file:
~/.config/zerogravity/token - Runtime:
curl -X POST http://localhost:8741/v1/token -d '{ "token": "ya29.xxx" }'
Protect the proxy from unauthorized access by setting an API key:
# Single key
export ZEROGRAVITY_API_KEY="your-secret-key"
# Multiple keys (comma-separated)
export ZEROGRAVITY_API_KEY="key1,key2,key3"Clients must then include the key in requests using either header format:
# OpenAI-style (Authorization: Bearer)
curl http://localhost:8741/v1/chat/completions \
-H "Authorization: Bearer your-secret-key" \
-H "Content-Type: application/json" \
-d '{"model": "gemini-3-flash", "messages": [{"role": "user", "content": "hi"}]}'
# Anthropic-style (x-api-key)
curl http://localhost:8741/v1/messages \
-H "x-api-key: your-secret-key" \
-H "Content-Type: application/json" \
-d '{"model": "opus-4.6", "max_tokens": 1024, "messages": [{"role": "user", "content": "hi"}]}'Note: If
ZEROGRAVITY_API_KEYis not set, no API key authentication is enforced (backward-compatible). The/healthand/endpoints are always public.
How to get the token
- Open Antigravity → Help > Toggle Developer Tools
- Go to the Network tab
- Send any prompt
- Find a request to
generativelanguage.googleapis.com - Look for the
Authorization: Bearer ya29.xxxheader - Copy the token (starts with
ya29.)
Note: OAuth tokens expire after ~1 hour. If Antigravity is installed on the same machine, auto-refresh works automatically.
Auto-refresh with state.vscdb (recommended for Docker / remote servers)
If you don't have Antigravity installed on the machine running ZeroGravity (e.g. a remote server or Docker container), you can copy the state.vscdb file from any computer where Antigravity is logged in. This database contains a long-lived refresh token that lets the proxy auto-refresh access tokens indefinitely — no manual token rotation needed.
| OS | Path |
|---|---|
| Linux | ~/.config/Antigravity/User/globalStorage/state.vscdb |
| macOS | ~/Library/Application Support/Antigravity/User/globalStorage/state.vscdb |
| Windows | %APPDATA%\Antigravity\User\globalStorage\state.vscdb |
Just the single state.vscdb file — no other files needed.
Docker run:
docker run -d --name zerogravity \
-p 8741:8741 -p 8742:8742 \
-v /path/to/state.vscdb:/authfile/state.vscdb:ro \
-e ZEROGRAVITY_STATE_DB=/authfile/state.vscdb \
ghcr.io/nikketryhard/zerogravity:latestDocker Compose (place state.vscdb in an ./authfile/ directory next to docker-compose.yml):
services:
zerogravity:
image: ghcr.io/nikketryhard/zerogravity:latest
ports:
- "8741:8741"
- "8742:8742"
volumes:
- ./authfile:/authfile:ro
environment:
- ZEROGRAVITY_STATE_DB=/authfile/state.vscdb
- RUST_LOG=infoNative (no Docker):
ZEROGRAVITY_STATE_DB=/path/to/state.vscdb ./zerogravity --headlessNote: This is a one-time copy. The refresh token inside
state.vscdbis long-lived — the proxy automatically uses it to obtain fresh access tokens. You only need to re-copy if you log out of Antigravity on the source machine or if Google revokes the refresh token.
# x86_64
curl -fsSL https://github.com/NikkeTryHard/zerogravity/releases/latest/download/zerogravity-linux-x86_64 -o zerogravity
chmod +x zerogravity
# ARM64
curl -fsSL https://github.com/NikkeTryHard/zerogravity/releases/latest/download/zerogravity-linux-arm64 -o zerogravity
chmod +x zerogravity./scripts/setup-linux.sh
zg start./scripts/setup-macos.sh
zg start# Run as Administrator
powershell -ExecutionPolicy Bypass -File scripts\setup-windows.ps1
.\zerogravity.exedocker run -d --name zerogravity \
-p 8741:8741 -p 8742:8742 \
-e ZEROGRAVITY_TOKEN=ya29.xxx \
-e ZEROGRAVITY_API_KEY=your-secret-key \
ghcr.io/nikketryhard/zerogravity:latestOr with docker-compose:
# Set token and optional API key in .env file
echo "ZEROGRAVITY_TOKEN=ya29.xxx" > .env
echo "ZEROGRAVITY_API_KEY=your-secret-key" >> .env
docker compose up -dNote: The Docker image bundles the LS binary so no Antigravity installation is needed. If Antigravity is installed on the host, mount its config dir for auto token refresh:
-v $HOME/.config/Antigravity:/root/.config/Antigravity:ro
| Method | Path | Description |
|---|---|---|
POST |
/v1/responses |
Responses API (sync + streaming) |
POST |
/v1/chat/completions |
Chat Completions API (OpenAI compat) |
POST |
/v1/messages |
Messages API (Anthropic compat) |
POST |
/v1beta/models/{model}:{action} |
Official Gemini v1beta routes |
GET |
/v1/models |
List available models |
GET |
/v1/sessions |
List active sessions |
DELETE |
/v1/sessions/{id} |
Delete a session |
POST |
/v1/token |
Set OAuth token at runtime |
GET |
/v1/usage |
Token usage stats |
GET |
/v1/quota |
Quota and rate limits |
GET |
/health |
Health check |
| Command | Description |
|---|---|
zg start |
Start the proxy daemon |
zg stop |
Stop the proxy daemon |
zg restart |
Stop + start |
zg update |
Download latest binary from GitHub Releases |
zg status |
Service status + quota + usage |
zg logs [N] |
Show last N lines (default 30) |
zg logs-follow [N] |
Tail last N lines + follow |
zg logs-all |
Full log dump |
zg test [msg] |
Quick test request (gemini-3-flash) |
zg health |
Health check |
