Antigravity Setup Guide
June 15, 2026 ยท View on GitHub
Track your Antigravity AI model quota usage with onWatch.
What is Antigravity?
Antigravity is an AI coding assistant that provides access to multiple AI models including Claude, Gemini, and GPT variants. onWatch can monitor your model quotas by connecting to the locally running Antigravity language server process.
Prerequisites
- Antigravity installed and running
- onWatch installed (Quick Start)
How It Works
onWatch automatically detects the Antigravity language server running on your machine by:
- Scanning for the
antigravityprocess - Extracting the CSRF token and port from command-line arguments
- Connecting via the Connect RPC protocol
- Polling the
/exa.language_server_pb.LanguageServerService/GetUserStatusendpoint
No manual configuration is required for local development.
Data Sources: IDE vs CLI (agy)
Antigravity ships in more than one form, and all variants share a single Google-account quota, so onWatch shows one Antigravity card and lets you choose where the data comes from:
| Source | What it does | Data richness |
|---|---|---|
ide | Probes the running Antigravity desktop/IDE language server. | Per-model session quotas. |
cli | Launches and manages the agy CLI in a pseudo-terminal and reads its RetrieveUserQuotaSummary endpoint. | Richer: weekly and 5-hour limits for the Gemini and Claude+GPT groups. |
both (default) | Prefers the agy CLI for its richer data and falls back to the IDE probe when agy is unavailable. | Best available. |
The dashboard card shows a "Source: agy CLI / IDE" badge indicating which probe produced the data you're seeing.
Choosing a source
- During setup:
onwatch setupasks which source to use when you enable Antigravity. - Anytime in the dashboard: open Settings -> Providers -> Antigravity and pick a Data Source. The change takes effect on the next poll - no restart needed.
- Via environment: set
ANTIGRAVITY_SOURCE=both|cli|idein your.env.
About the agy CLI source
The agy CLI only exposes its quota server while an interactive process is
alive, and it exits immediately without a terminal. To read it, onWatch launches
a managed agy process inside a pseudo-terminal, keeps it warm between polls,
relaunches it if it becomes unhealthy, tears it down when idle or on shutdown,
and only ever stops the process it started - your own interactive agy
sessions are never touched.
onWatch locates agy via ANTIGRAVITY_CLI_PATH, then your PATH, then common
install locations (~/.local/bin/agy, /opt/homebrew/bin/agy,
/usr/local/bin/agy). The CLI source is supported on macOS, Linux, and Windows
(via ConPTY); the Unix path is the most thoroughly validated.
Quick Start (Auto-Detection)
Step 1: Enable Antigravity in onWatch
Add to your .env file:
cd ~/.onwatch
Edit .env and add:
ANTIGRAVITY_ENABLED=true
Or set it as an environment variable:
export ANTIGRAVITY_ENABLED=true
Step 2: Restart onWatch
onwatch stop
onwatch
Or in debug mode to verify:
onwatch --debug
You should see:
Antigravity auto-detection enabled (process scanning mode)
Starting Antigravity agent (interval: 60s)
connected to Antigravity language server port=63516 protocol=https
Step 3: View Dashboard
Open http://localhost:9211 and click the antigravity tab.
You'll see quota cards for each model, including:
- Claude Sonnet
- Gemini Pro
- GPT-4 variants
- And other available models
Docker/Container Configuration
In containerized environments where process scanning doesn't work, you can manually configure the connection:
Environment Variables
| Variable | Description | Example |
|---|---|---|
ANTIGRAVITY_ENABLED | Enable Antigravity provider | true |
ANTIGRAVITY_BASE_URL | Base URL of the language server | https://127.0.0.1:42100 |
ANTIGRAVITY_CSRF_TOKEN | CSRF token from the process | your_csrf_token_here |
Example Docker Compose
services:
onwatch:
image: ghcr.io/onllm-dev/onwatch:latest
environment:
- ANTIGRAVITY_ENABLED=true
- ANTIGRAVITY_BASE_URL=https://host.docker.internal:42100
- ANTIGRAVITY_CSRF_TOKEN=your_csrf_token
ports:
- "9211:9211"
Finding the Port and Token
On the host machine, find the running Antigravity process:
# macOS/Linux
ps aux | grep antigravity | grep -E "csrf_token|extension_server_port"
# Example output:
# /path/to/antigravity --csrf_token=abc123 --extension_server_port=42100
Extract the values:
--extension_server_port=42100- Use as the port inANTIGRAVITY_BASE_URL--csrf_token=abc123- Use asANTIGRAVITY_CSRF_TOKEN
What Gets Tracked
| Metric | Description |
|---|---|
| Model Quotas | Per-model remaining fraction (0.0 to 1.0) |
| Reset Times | When each model's quota resets |
| Prompt Credits | Available credits for your plan |
| Plan Info | Your subscription tier (Free, Pro, etc.) |
The dashboard shows:
- Usage percentage for each AI model
- Remaining quota with color indicators
- Reset countdown timers
- Usage history and projections
Supported Models
onWatch tracks all models available in your Antigravity subscription:
| Model ID | Display Name |
|---|---|
claude-4-5-sonnet | Claude 4.5 Sonnet |
claude-4-5-sonnet-thinking | Claude 4.5 Sonnet (Thinking) |
gemini-3-pro | Gemini 3 Pro |
gemini-3-flash | Gemini 3 Flash |
| (others) | Automatically detected |
Troubleshooting
"Antigravity agent not starting"
-
Verify Antigravity is running:
ps aux | grep antigravity -
Check if the process has the required arguments:
ps aux | grep antigravity | grep csrf_token -
Ensure
ANTIGRAVITY_ENABLED=trueis set
"No models showing"
- Make sure you're logged into Antigravity
- Check that your subscription is active
- Run onWatch in debug mode:
onwatch --debug
"Connection refused"
The language server might be using a self-signed certificate. onWatch handles this automatically, but if you're using manual configuration:
- Ensure the port is correct
- Try both
https://andhttp://protocols - Check firewall settings
"CSRF token invalid"
The token changes when Antigravity restarts. For auto-detection mode, restart onWatch after restarting Antigravity:
onwatch stop && onwatch
For manual configuration, update ANTIGRAVITY_CSRF_TOKEN with the new value.
API Details
onWatch uses the Connect RPC protocol to communicate with the Antigravity language server:
Endpoint:
POST /exa.language_server_pb.LanguageServerService/GetUserStatus
Headers:
Content-Type: application/json
Connect-Protocol-Version: 1
X-Codeium-Csrf-Token: <token>
Response structure:
{
"userStatus": {
"email": "user@example.com",
"planStatus": {
"availablePromptCredits": 500,
"planInfo": {
"planName": "Pro",
"monthlyPromptCredits": 1000
}
},
"cascadeModelConfigData": {
"clientModelConfigs": [
{
"label": "Claude Sonnet",
"modelOrAlias": {"model": "claude-4-5-sonnet"},
"quotaInfo": {
"remainingFraction": 0.75,
"resetTime": "2026-02-24T12:00:00Z"
}
}
]
}
}
}
Security Notes
- onWatch connects only to localhost (or your configured URL)
- The CSRF token is never sent to external servers
- All data stays on your machine (SQLite database)
- Auto-detection only reads process arguments, not memory
See Also
- Development Guide - Build from source
- Copilot Setup - Track GitHub Copilot quotas
- Codex Setup - Track OpenAI Codex quotas
- README - Quick start and configuration