README_EN.md
<div align="center"> <h3>Your Personal High-Performance AI Gateway</h3> <p>Beyond account management โ the ultimate solution for breaking through API calling barriers.</p> <p> <a href="https://github.com/lbjlaq/Antigravity-Manager">Professional AI Account Management & Protocol Proxy System (v4.6.2)
</a>
Antigravity Tools is an all-in-one desktop application designed for developers and AI enthusiasts. It perfectly combines multi-account management, protocol conversion, and smart request scheduling to provide you with a stable, high-speed, and low-cost Local AI Relay Station.
By leveraging this app, you can transform common Web Sessions (Google/Anthropic) into standardized API interfaces, completely eliminating the protocol gap between different providers.
| Sponsor | Description |
|---|---|
| Thanks to PackyCode for sponsoring this project! PackyCode is a reliable and efficient API relay service provider, offering relays for various services such as Claude Code, Codex, and Gemini. PackyCode provides a special offer for users of this project: Register using this link and enter the "Ctrler" coupon code when topping up to enjoy a 10% discount. | |
| Thanks to APIKEY.FUN for sponsoring this project! APIKEY.FUN is a professional enterprise-grade AI relay station, dedicated to providing stable, efficient, and low-cost AI model API access services for enterprise and individual developers. The platform supports mainstream popular models such as Claude, OpenAI, and Gemini, with prices as low as 7% of the official original price. Register through this exclusive link for this project to enjoy an exclusive offer of up to permanent 5% off on top-ups. | |
| Thanks to Claude API for supporting this project! claudeapi.com is a Claude API relay station built on official and AWS channels, focused exclusively on Claude, delivering high stability and low latency with full support for Claude Code. Exclusive offer: register via this exclusive link to get free trial credits โ zero setup, get started instantly; enjoy an extra 5% off when you top up๏ผContact Support). | |
| Thanks to AICodeMirror for sponsoring this project! AICodeMirror provides official high-stability relay services for Claude Code / Codex / Gemini CLI, supporting enterprise-grade concurrency, fast invoicing, and 24/7 dedicated technical support. Claude Code / Codex / Gemini official channels at 38% / 2% / 9% of original price, with extra discounts on top-ups! AICodeMirror offers special benefits for Antigravity-Manager users: register via this link to enjoy 20% off your first top-up, and enterprise customers can get up to 25% off! |
If you find this project helpful, feel free to buy me a coffee!
<a href="https://www.buymeacoffee.com/Ctrler" target="_blank"></a>
| Alipay | WeChat Pay | Buy Me a Coffee |
|---|---|---|
If you like this project, you might also be interested in:
/v1/chat/completions endpoint, compatible with 99% of existing AI apps./v1/messages interface, supporting all features of Claude Code CLI (e.g., chain-of-thought, system prompts).429 (Too Many Requests) or 401 (Expired), the backend triggers millisecond-level automatic retry and silent rotation, ensuring business continuity.gemini-3-pro-high).size (e.g., 1024x1024, 16:9) parameters or model name suffixes.| Dashboard | |
| Account List | |
| About Page | |
| API Proxy | |
| Settings |
| Claude Code Web Search | |
| Cherry Studio Integration | |
| Imagen 3 Advanced Drawing | |
| Kilo Code Integration |
graph TD
Client([External Apps: Claude Code/NextChat]) -->|OpenAI/Anthropic| Gateway[Antigravity Axum Server]
Gateway --> Middleware[Middleware: Auth/Rate Limit/Logs]
Middleware --> Router[Model Router: ID Mapping]
Router --> Dispatcher[Dispatcher: Rotation/Weights]
Dispatcher --> Mapper[Request Mapper]
Mapper --> Upstream[Upstream: Google/Anthropic API]
Upstream --> ResponseMapper[Response Mapper]
ResponseMapper --> Client
Automatically detects your OS, architecture, and package manager โ one command to download and install.
Linux / macOS:
curl -fsSL https://raw.githubusercontent.com/lbjlaq/Antigravity-Manager/main/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/lbjlaq/Antigravity-Manager/main/install.ps1 | iex
Supported formats: Linux (
.deb/.rpm/.AppImage) | macOS (.dmg) | Windows (NSIS.exe)Advanced usage: Install a specific version
curl -fsSL https://raw.githubusercontent.com/lbjlaq/Antigravity-Manager/main/install.sh | bash -s -- --version 4.6.2, dry-run modecurl -fsSL https://raw.githubusercontent.com/lbjlaq/Antigravity-Manager/main/install.sh | bash -s -- --dry-run
If you have Homebrew installed, you can also install via:
# 1. Tap the repository
brew tap lbjlaq/antigravity-manager https://github.com/lbjlaq/Antigravity-Manager
# 2. Install the app
brew install --cask antigravity-tools
You can choose to install via the one-click script or Homebrew:
Option 1: One-click script (Recommended)
curl -sSL https://raw.githubusercontent.com/lbjlaq/Antigravity-Manager/main/deploy/arch/install.sh | bash
Option 2: via Homebrew (If you have Linuxbrew installed)
brew tap lbjlaq/antigravity-manager https://github.com/lbjlaq/Antigravity-Manager
brew install --cask antigravity-tools
The AppImage will be automatically symlinked to your binary path with executable permissions.
Download from GitHub Releases:
.dmg (Universal, Apple Silicon & Intel).msi or portable .zip.deb or AppImageIf you prefer running in a containerized environment, we provide a native Docker image. This image supports the v4.0.3 Native Headless architecture, automatically hosts frontend static resources, and allows for direct browser-based management.
# Option 1: Direct Run (Recommended)
# - API_KEY: Required. Used for AI request authentication.
# - WEB_PASSWORD: Optional. Used for Web UI login. Defaults to API_KEY if NOT set.
docker run -d --name antigravity-manager \
-p 8045:8045 \
-e API_KEY=sk-your-api-key \
-e WEB_PASSWORD=your-login-password \
-e ABV_MAX_BODY_SIZE=104857600 \
-v ~/.antigravity_tools:/root/.antigravity_tools \
lbjlaq/antigravity-manager:latest
# Forgot keys? Run `docker logs antigravity-manager` or `grep -E '"api_key"|"admin_password"' ~/.antigravity_tools/gui_config.json`
#### ๐ Authentication Scenarios
* **Scenario A: Only `API_KEY` is set**
- **Web Login**: Use `API_KEY` to access the dashboard.
- **API Calls**: Use `API_KEY` for AI request authentication.
* **Scenario B: Both `API_KEY` and `WEB_PASSWORD` are set (Recommended)**
- **Web Login**: **Must** use `WEB_PASSWORD`. Using API Key will be rejected (more secure).
- **API Calls**: Continue to use `API_KEY`. This allows you to share the API Key with team members while keeping the password for administrative access only.
#### ๐ Upgrade Guide for Older Versions
If you are upgrading from v4.0.1 or earlier, your installation won't have a `WEB_PASSWORD` set by default. You can add one using any of these methods:
1. **Web UI (Recommended)**: Log in using your existing `API_KEY`, go to the **API Proxy Settings** page, find the **Web UI Management Password** section below the API Key, set your new password, and save.
2. **Environment Variable (Docker)**: Stop the old container and start the new one with the added parameter `-e WEB_PASSWORD=your_new_password`. **Note: Environment variables have the highest priority and will override any changes in the UI.**
3. **Config File (Persistent)**: Directly edit `~/.antigravity_tools/gui_config.json` and add/modify `"admin_password": "your_new_password"` inside the `proxy` object.
- *Note: `WEB_PASSWORD` is the environment variable name, while `admin_password` is the JSON key in the config file.*
> [!TIP]
> **Priority Logic**:
> - **Environment Variable** (`WEB_PASSWORD`) has the highest priority. If set, the application will always use it and ignore values in the configuration file.
> - **Configuration File** (`gui_config.json`) is used for persistent storage. When you change the password via Web UI and save, it is written here.
> - **Fallback**: If neither is set, it falls back to `API_KEY`; if even `API_KEY` is missing, a random one is generated.
# Option 2: Use Docker Compose
# 1. Enter the Docker directory
cd docker
# 2. Start the service
docker compose up -d
Access URL:
http://localhost:8045(Admin Console) |http://localhost:8045/v1(API Base) System Requirements:
- RAM: 1GB recommended (minimum 256MB).
- Persistence: Mount
/root/.antigravity_toolsto persist your data.- Architecture: Supports x86_64 and ARM64. See: Docker Deployment Guide (docker)
Due to macOS security gatekeeper, non-App Store apps might show this. Run this in Terminal to fix:
sudo xattr -rd com.apple.quarantine "/Applications/Antigravity Tools.app"
Accounts โ Add Account โ OAuth.Note: the auth URL contains a one-time local callback port. Always use the latest URL shown in the dialog. If the app isnโt running or the dialog is closed during auth, the browser may show
localhost refused connection.
export ANTHROPIC_API_KEY="sk-antigravity"
export ANTHROPIC_BASE_URL="http://127.0.0.1:8045"
claude
~/.config/opencode/opencode.json:
antigravity-manager (does not overwrite google/anthropic providers)antigravity-accounts.json (plugin-compatible v3 format) for the OpenCode pluginC:\Users\<User>\.config\opencode\ (same ~/.config/opencode rule).Quick verification commands:
# Test antigravity-manager provider (supports --variant)
opencode run "test" --model antigravity-manager/claude-sonnet-4-5-thinking --variant high
# If opencode-antigravity-auth is installed, verify google provider still works independently
opencode run "test" --model google/antigravity-claude-sonnet-4-5-thinking --variant max
import openai
client = openai.OpenAI(
api_key="sk-antigravity",
base_url="http://127.0.0.1:8045/v1"
)
response = client.chat.completions.create(
model="gemini-3-flash",
messages=[{"role": "user", "content": "Hello, please introduce yourself"}]
)
print(response.choices[0].message.content)
http://127.0.0.1:8045./v1/chat/completions/responses, a non-standard path that will return 404 from Antigravity. Make sure to enter the Base URL and select Gemini mode.import openai
client = openai.OpenAI(
api_key="***",
base_url="http://127.0.0.1:8045/v1"
)
# Generate image
response = client.images.generate(
model="gemini-3-pro-image",
prompt="A futuristic cyberpunk city with neon lights",
size="1920x1080", # Supports any WIDTHxHEIGHT format, auto-calculates aspect ratio
quality="hd", # "standard" | "hd" | "medium"
n=1,
response_format="b64_json"
)
# Save image
import base64
image_data = base64.b64decode(response.data[0].b64_json)
with open("output.png", "wb") as f:
f.write(image_data)
Supported parameters๏ผ
size: Any WIDTHxHEIGHT format (e.g. 1280x720, 1024x1024, 1920x1080), auto-calculates and maps to standard aspect ratios (21:9, 16:9, 9:16, 4:3, 3:4, 1:1)quality:
"hd" โ 4K resolution (high quality)"medium" โ 2K resolution (medium quality)"standard" โ Default resolution (standard quality)n: Number of images to generate (1-10)response_format: "b64_json" or "url" (Data URI)All protocols (OpenAI, Claude) Chat APIs now support direct size and quality parameters:
# OpenAI Chat API
response = client.chat.completions.create(
model="gemini-3-pro-image",
size="1920x1080", # โ
Supports any WIDTHxHEIGHT format
quality="hd", # โ
"standard" | "hd" | "medium"
messages=[{"role": "user", "content": "A futuristic city"}]
)
# Claude Messages API
curl -X POST http://127.0.0.1:8045/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: ***" \
-d '{
"model": "gemini-3-pro-image",
"size": "1280x720",
"quality": "hd",
"messages": [{"role": "user", "content": "A cute cat"}]
}'
Parameter priority: imageSize parameter > quality parameter > model suffix
โจ New imageSize parameter support:
In addition to the quality parameter, you can now also use Gemini's native imageSize parameter:
# Using imageSize parameter (highest priority)
response = client.chat.completions.create(
model="gemini-3-pro-image",
size="16:9", # Aspect ratio
imageSize="4K", # โจ Direct resolution: "1K" | "2K" | "4K"
messages=[{"role": "user", "content": "A futuristic city"}]
)
# Claude Messages API also supports imageSize
curl -X POST http://127.0.0.1:8045/v1/messages \
-H "Content-Type: application/json" \
-H "x-api-key: ***" \
-d '{
"model": "gemini-3-pro-image",
"size": "1280x720",
"imageSize": "4K",
"messages": [{"role": "user", "content": "A cute cat"}]
}'
Parameter descriptions:
imageSize: Direct resolution specification ("1K" / "2K" / "4K")quality: Infers resolution from quality level ("standard" โ 1K, "medium" โ 2K, "hd" โ 4K)imageSize and quality are specified, the system prioritizes imageSizeresponse = client.chat.completions.create(
model="gemini-3-pro-image-16-9-4k", # Format: gemini-3-pro-image-[ratio]-[quality]
messages=[{"role": "user", "content": "A futuristic city"}]
)
Model suffix explanation๏ผ
-16-9, -9-16, -4-3, -3-4, -21-9, -1-1-4k (4K), -2k (2K), no suffix (standard)gemini-3-pro-image-16-9-4k โ 16:9 ratio + 4K resolutionIn clients that support OpenAI protocol (e.g., Cherry Studio), you can configure image generation parameters via the Model Settings page:
gemini-3-pro-image modelWIDTHxHEIGHT format (e.g. 1920x1080, 1024x1024)standard / hd / mediumParameter mapping rules๏ผ
size: "1920x1080" โ Auto-calculated as 16:9 aspect ratioquality: "hd" โ Mapped to 4K resolutionquality: "medium" โ Mapped to 2K resolutionLatest version v4.6.2 (2026-08-28): proxy startup diagnostics, model catalog update (gemini-3.7-flash / claude-opus-4-6), Windows console flashing fix, Gemini thought-signature fix on compression, pt-BR localization complete, and install script version-parse fix.
๐ View Full Changelog โ CHANGELOG.md
<a href="https://github.com/lbjlaq"></a> <a href="https://github.com/XinXin622"></a> <a href="https://github.com/llsenyue"></a> <a href="https://github.com/salacoste"></a> <a href="https://github.com/84hero"></a> <a href="https://github.com/karasungur"></a> <a href="https://github.com/marovole"></a> <a href="https://github.com/wanglei8888"></a> <a href="https://github.com/yinjianhong22-design"></a> <a href="https://github.com/Mag1cFall"></a> <a href="https://github.com/AmbitionsXXXV"></a> <a href="https://github.com/fishheadwithchili"></a> <a href="https://github.com/ThanhNguyxn"></a> <a href="https://github.com/Stranmor"></a> <a href="https://github.com/Jint8888"></a> <a href="https://github.com/0-don"></a> <a href="https://github.com/dlukt"></a> <a href="https://github.com/Silviovespoli"></a> <a href="https://github.com/i-smile"></a> <a href="https://github.com/jalen0x"></a> <a href="https://linux.do/u/wendavid"></a> <a href="https://github.com/byte-sunlight"></a> <a href="https://github.com/jlcodes99"></a> <a href="https://github.com/Vucius"></a> <a href="https://github.com/Koshikai"></a> <a href="https://github.com/hakanyalitekin"></a> <a href="https://github.com/Gok-tug"></a>
Special thanks to all developers who have contributed to this project.
This project has referenced or learned from the ideas or code of the following excellent open-source projects during its development (in no particular order):
License: CC BY-NC-SA 4.0. Strictly for non-commercial use.
Security: All account data is encrypted and stored locally in a SQLite database. Data never leaves your device unless sync is enabled.