English | Español
Note
Community Revival & Extended Edition: This repository is an active, open-source continuation of the archived project by NoeFabris (and earlier work by @jenslys and CLIProxyAPI). It fixes critical upstream bugs and unlocks the newest Google Antigravity models.
Important
Project Status (October 2026) - measured, not assumed.
- Gemini 4 ("Argon") works, and the grant is per account. Measured 2026-10-31: an account that
loadCodeAssistreports asfree-tierreceived the full Argon grant (modelVersion: gemini-4-argon-trialplus its ownGemini 4 Argonweekly bucket), while two other accounts only received thegemini-4-argon-disabledplaceholder and answer404for the real ids. Do not infer access from the plan name: enablemodel_discoveryand confirm withantigravity_quota. - Argon has its own quota bucket. Two 32k-token Argon calls moved
gemini-argon-wtu-weeklyfrom 98.75% to 97.75% whilegemini-weeklyandgemini-5hdid not move at all. Argon is not billed against Gemini Flash/Pro. - Rotation is entitlement-aware. Each account's model catalog is measured and cached, and selection skips accounts that provably lack the requested model. Argon only goes to the account that has it;
gemini-3.8-flashkeeps using every account. - Claude quota is per family, not per generation. Free accounts do have Claude quota, but it covers
claude-*-4-6and GPT-OSS; Claude 5.5 answers404there.antigravity_quotareports both generations separately. - Claude 4.6 is being retired. On the entitled account
claude-sonnet-4-6already answers200with "Claude Sonnet 4.6 is no longer available. Please switch to Claude Sonnet 5.5."; Free accounts still serve it. Google's announced date is 2026-11-02, andmodel_discoverysurfaces the 5.5 successors without a plugin release. - Use Argon moderately. Measure it: ~1% of its weekly bucket per 65k input tokens, versus a Flash bucket that is effectively free at the margin. Keep Gemini 3.8 Flash as the high-volume workhorse.
- OpenCode v1 and v2 in one entrypoint. A callable v1 factory plus native v2
.setup(), with models, variants, tools and slash commands registered through the v2 registries. - Real Antigravity model catalog. The curated core is Gemini 3.8 Flash, the Claude 4.6 pair and GPT-OSS 120B; anything newer that your account is granted (Gemini 4 Argon, Claude 5.5) is registered by
model_discoveryfrom the backend catalog, one selector entry per family withlow/medium/highvariants. - Official CLI client signature. Requests present
antigravity/cli/<version> (aidev_client; ...), resolved at startup from the CLI auto-updater. Without it the backend answers404 NOT_FOUNDfor the newer Gemini lines - which is also why a stale signature used to look like "preview access not enabled". - Multi-account pool with entitlement-aware rotation. Per-account quota, health and measured model catalog; failover on
429,403, transport drops and404misses; account cooldowns and circuit breakers so a bad account cannot poison the pool. - Dual-window quota reporting.
antigravity_quotaand/antigravity-quotashow 5h and weekly windows per model family (Gemini, Claude/GPT, Gemini 4 Argon), short reset countdowns, a truthfulUSABLEflag and the measured capabilities of each account. - Thinking tiers and Claude signatures. Tiered backend ids, thinking budgets for Claude, signature caching and recovery for interrupted tool loops.
- Safety controls. Configurable
safety_level, plussafety_shieldto surface and rotate on Google safety telemetry. - Session resilience. Historical tool-response pruning, transport-drop circuit breaker and retry instrumentation.
- Request hygiene. Strips
x-api-key/x-goog-api-key/x-goog-user-project, normalizes protobuf-incompatible tool schemas, and sanitizes payloads that the Cloud Code API rejects.
Enable OpenCode to authenticate against Antigravity (Google's IDE) via OAuth so you can use Antigravity rate limits to run gemini-3.8-flash, the Claude line (4.6 today, 5.5 on accounts that have it) and gpt-oss-120b, plus whatever newer model your account is granted - Gemini 4 Argon included - with your Google credentials.
- Gemini 3.8 Flash, Claude Opus/Sonnet 4.6, GPT-OSS 120B via Google OAuth, plus Gemini 4 Argon and Claude 5.5 for the accounts that are granted them (discovered per account, not hardcoded)
- Multi-account support — add multiple Google accounts, auto-rotates when rate-limited
- Request Normalization & Clean Feedback — optimized parameters prevent false-positives on development tasks; clean one-line message on filter notices
- Slash Commands —
/antigravity-quotato inspect dual-window limits, and/antigravity-statsfor instant local metrics - Native Tools —
antigravity_quota,antigravity_stats, andgoogle_searchtools registered directly in the agent runtime - Thinking models — extended thinking for Claude and Gemini 3 with configurable budgets / thinking levels
- Google Search grounding — enable web search for Gemini models (auto or always-on)
- Auto-recovery — handles session errors and tool failures automatically
- Plugin compatible — works alongside other OpenCode plugins (oh-my-opencode, dcp, etc.)
- Dual-Version Support — native compatibility with both OpenCode v1 (
opencode-ai) and OpenCode v2 (@opencode/cli)
This plugin implements a polymorphic dual-compatibility entrypoint in index.ts:
-
OpenCode v1 (1.18.x /
opencode-ai): Loads as a callable factory function:export default async function ({ client, directory }: PluginContext): Promise<PluginResult>
Returns
{ auth, event, tool }hooks with full multi-account rotation and header interception. -
OpenCode v2 (2.0.x /
@opencode/cli): Loads as a native v2 plugin definition object:export default { id: "opencode-antigravity-auth", setup: async (context: V2Context) => cleanup }
Registers native tools (
context.tool.transform), commands (context.command.transform), models (context.model.transform) and the Google Antigravity OAuth integration (context.integration.transform), while sharing the unified account pool and config. This makesopencode auth loginofferOAuth with Google (Antigravity)and appends every newly authorized account to the multi-account rotation pool.
No configuration changes are required when transitioning between OpenCode v1 and v2.
Terms of Service Warning — Read Before Installing
[!CAUTION] Using this plugin (and any proxy for Antigravity) violates Google's Terms of Service. A number of users have reported their Google accounts being banned or shadow-banned (restricted access without explicit notification).
By using this plugin, you acknowledge:
- This is an unofficial tool not endorsed by Google
- Your account may be suspended or permanently banned
- You assume all risks associated with using this plugin
Add to plugins in ~/.config/opencode/opencode.json:
{
"plugins": ["github:JoshRob297/opencode-antigravity-auth"]
}OpenCode v2 will automatically clone, build, and update the plugin directly from the official repository.
Clone and reference locally:
git clone https://github.com/JoshRob297/opencode-antigravity-auth.git /path/to/plugin
cd /path/to/plugin && npm install && npm run buildThen in ~/.config/opencode/opencode.json:
{
"plugins": ["/path/to/plugin"]
}-
Add the plugin to
~/.config/opencode/opencode.json:{ "plugins": ["github:JoshRob297/opencode-antigravity-auth"] } -
Authenticate with Google:
opencode auth login
Select Google → OAuth with Google (Antigravity). (In SSH / Headless environments, the CLI automatically provides a direct URL to open on your browser and paste the verification code).
-
Ready to use! In OpenCode v2, all models, variants, and thinking budgets are auto-registered dynamically. You can immediately run:
opencode run "Hello" --model=google/antigravity-gemini-3.8-flash --variant=high(Optional: You can run
/antigravity-setupinside OpenCode anytime to cleanly auto-format youropencode.jsonwith recommended whitelists).
| Model | Variants | Description |
|---|---|---|
antigravity-gemini-3.8-flash |
low, medium, high |
Gemini 3.8 Flash with thinking tiers (Default) |
antigravity-claude-sonnet-4-6 |
low, medium, high, max |
Claude Sonnet 4.6 (retiring 2026-11-02) |
antigravity-claude-opus-4-6-thinking |
low, medium, high, max |
Claude Opus 4.6 with extended thinking (retiring 2026-11-02) |
antigravity-gpt-oss-120b-medium |
low, medium, high |
GPT-OSS 120B open-source model |
Newer families are not hardcoded. model_discovery registers them from the account's own catalog; measured 2026-10-31 on an entitled account: antigravity-gemini-4-argon (low/medium/high), antigravity-claude-sonnet-5-5 and antigravity-claude-opus-5-5. Limits come from the backend (Claude 5.5: 1M context / 128k output).
Manual models configuration (Optional / Advanced)
In OpenCode v2 this is not required because the plugin registers all models and variants automatically via model.transform. However, if you wish to pin custom token limits or override model names manually, you can add this to ~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugins": ["github:JoshRob297/opencode-antigravity-auth"],
"providers": {
"google": {
"models": {
"antigravity-gemini-3.8-flash": {
"name": "Gemini 3.8 Flash (Antigravity)",
"limit": { "context": 1048576, "output": 65536 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
"variants": {
"low": { "thinkingLevel": "low" },
"medium": { "thinkingLevel": "medium" },
"high": { "thinkingLevel": "high" }
}
},
"antigravity-claude-sonnet-4-6": {
"name": "Claude Sonnet 4.6 (Antigravity)",
"limit": { "context": 200000, "output": 64000 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
},
"antigravity-claude-opus-4-6-thinking": {
"name": "Claude Opus 4.6 Thinking (Antigravity)",
"limit": { "context": 200000, "output": 64000 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
"variants": {
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
"medium": { "thinkingConfig": { "thinkingBudget": 16384 } },
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
}
},
"antigravity-gpt-oss-120b-medium": {
"name": "GPT-OSS 120B (Antigravity)",
"limit": { "context": 131072, "output": 8192 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
}
}
}
}
}The Antigravity backend reports which models each account can use. With model_discovery enabled the plugin registers the ones newer than the curated catalog on top of it, so a model released to your plan becomes selectable without waiting for a plugin release:
// ~/.config/opencode/antigravity.json
{
"model_discovery": true
}- If any account in the pool has Argon or Claude 5.5, they show up. Gemini 4 Argon and the Claude Sonnet/Opus 5.5 successors are on the forward-only rule, and the catalog is taken as the union of every account: one entitled account is enough for the selector entry to appear. Access is granted per account, not by plan name - measured on 2026-10-31, an account reporting
free-tiertoloadCodeAssiststill received the full Argon grant (modelVersion: gemini-4-argon-trialplus its ownGemini 4 Argonquota bucket). Discovery never claims support: it mirrors what the backend grants. - One selector entry per family, tiers as variants. The backend exposes one id per thinking tier (
gemini-4-argon-low|medium|high,claude-sonnet-5-5-low|medium|high); the plugin registers a single model (antigravity-gemini-4-argon,antigravity-claude-sonnet-5-5) with alow|medium|highvariant picker instead of three near-identical rows. Limits come from the backend when it declares them (Claude 5.5 reports 1M context / 128k output). - Rotation is entitlement-aware. Each account's catalog is measured from
fetchAvailableModelsand cached on disk, and account selection skips any account that provably lacks the requested model - so an Argon request never lands on a Free/AI Plus account that would answer404 NOT_FOUND, while that same account keeps serving Gemini 3.8 Flash, which every plan has. A404that still happens rotates to the next account (bounded to one attempt per account) instead of surfacing a misleading "request preview access" error. - Quota notice on frontier models: Be advised that invoking Gemini 4 Argon burns through your 5-hour and weekly Antigravity quotas much faster than Flash models. Use it moderately for architectural decisions or tough problems, and keep Gemini 3.8 Flash as the high-throughput everyday engine.
- Claude 5.5 carries an account-side safety monitor. Measured 2026-10-31: a long agent prompt (17k tokens of security-oriented system instructions) is answered with
finishReason: SAFETYand an empty text part. Argon and Flash serve the same prompt normally. The plugin now turns that empty payload into an explicit "blocked by the model's filters" message instead of an opaque provider error. - Forward-only. Anything older than the curated workhorses (
gemini-3.8-flash, Claude 4.6) stays out, curated ids are never duplicated, and ids measured as dead, retired, internal or-disabledare filtered by a denylist. A200from the backend is not treated as proof of usability. - Best-effort. If the catalog lookup fails, the curated catalog is used and startup is unaffected.
Full behavior, limits and caveats: docs/CONFIGURATION.md.
models.dev publishes a google provider with the full Gemini lineup. Because the
Antigravity OAuth credential makes that provider available, every one of those models
shows up in the picker even though only the curated Antigravity models can be served.
With hide_foreign_models enabled the plugin disables every google model that is not
part of its curated catalog:
// ~/.config/opencode/antigravity.json
{
"hide_foreign_models": true
}- Opt-in on purpose. If you have your own Google API key (
GEMINI_API_KEY) the fullmodels.devlist is valid, so the default isfalse. - Re-evaluated on every load, so a catalog refresh can no longer push the full Gemini lineup back into the selector.
- Fail-open. An editor that cannot list models, or any error, leaves the list as is.
Add multiple Google accounts for a higher combined quota. The plugin automatically rotates between accounts when one is rate-limited.
opencode auth login # Run again to add more accountsAccount management options (via opencode auth login):
- Configure models — Auto-configure all plugin models in opencode.json
- Check quotas — View remaining API quota for each account
- Manage accounts — Enable/disable specific accounts for rotation
For details on load balancing, dual quota pools, and account storage, see docs/MULTI-ACCOUNT.md.
By default, the plugin mirrors Google's native moderation baseline (medium / BLOCK_MEDIUM_AND_ABOVE) to protect your accounts from telemetry anomalies.
You can configure safety_level in ~/.config/opencode/antigravity.json:
{
"safety_level": "medium"
}Available levels:
"medium"(Default) — Standard Google safety filters (BLOCK_MEDIUM_AND_ABOVE). Maximum account protection."high"— Blocks only high-probability harm (BLOCK_ONLY_HIGH). Recommended for extensive development, vulnerability analysis, and debugging."none"— Disables external safety classifiers (BLOCK_NONE) and bypasses prompt injection filters (HARM_CATEGORY_JAILBREAK).
Scope:
safety_levelis a Gemini control. It is never sent on Claude requests, because the Antigravity backend ignoressafetySettingsfor the Claude line. Claude 5.5 is filtered by the provider's own monitor on the account: it can answerfinishReason: SAFETYwith empty content even withsafety_level: "none"set, and the block is decided on the account side, not by this plugin. Measured 2026-10-31: the same request that mentionsfrida-serveror "exploit generation" in the system prompt is blocked onclaude-sonnet-5-5andclaude-opus-5-5whileclaude-sonnet-4-6and Gemini answer normally. Remove or rephrase the flagged context (usuallyAGENTS.mdor project instructions), or use another model; the plugin surfaces the block with an explicit message instead of the bare "Provider blocked the response".
DISCLAIMER: Setting
safety_levelto"none"is strictly for authorized security research and advanced workflows. Using"none"is done solely at your own discretion and risk. We accept no responsibility or liability for account reviews, suspensions, or bans enacted by Google.
When operating with safety_level: "none", Google's backend still evaluates your queries and attaches safetyRatings probabilities (NEGLIGIBLE, LOW, MEDIUM, HIGH) to responses.
The plugin provides an active defense engine configured in ~/.config/opencode/antigravity.json:
{
"safety_level": "none",
"safety_shield": {
"enabled": true,
"log_ratings": true,
"show_toast": true,
"auto_rotate_threshold": 2
}
}log_ratings: Emits detailed warnings in logs whenever Google assignsHIGHharm orMEDIUMjailbreak probability to an answer.show_toast: Displays non-blocking OPSEC warnings in OpenCode's interface ([OPSEC Shield] Google flagged response: ...).auto_rotate_threshold: Number of consecutive high-risk responses on a single account before triggering an automatic, preventive rotation to the next Google account (Account Shield). This prevents risk clustering on individual personal accounts. Set to0to disable auto-rotation.
If a query triggers a backend moderation notice, the plugin intercepts the verbose response (which contains lengthy legal disclaimers, policy links, and bug report URLs) and replaces it with a clean, actionable notice:
[Solicitud bloqueada por filtros de seguridad de Gemini. Por favor, intenta reformular tu prompt o enfoque.]
This prevents chat clutter, session lockups, and unrecoverable error cascades.
Quick Reset: Most issues can be resolved by deleting
~/.config/opencode/antigravity-accounts.jsonand runningopencode auth loginagain.
OpenCode uses ~/.config/opencode/ on all platforms including Windows.
| File | Path |
|---|---|
| Main config | ~/.config/opencode/opencode.json |
| Accounts | ~/.config/opencode/antigravity-accounts.json |
| Plugin config | ~/.config/opencode/antigravity.json |
| Debug logs | ~/.config/opencode/antigravity-logs/ |
Windows users:
~resolves to your user home directory (e.g.,C:\Users\YourName). Do NOT use%APPDATA%.
Custom path: Set
OPENCODE_CONFIG_DIRenvironment variable to use a custom location.
Windows migration: If upgrading from plugin v1.3.x or earlier, the plugin will automatically find your existing config in
%APPDATA%\opencode\and use it. New installations use~/.config/opencode/.
If you encounter authentication issues with multiple accounts:
- Delete the accounts file:
rm ~/.config/opencode/antigravity-accounts.json - Re-authenticate:
opencode auth login
Error:
Permission 'cloudaicompanion.companions.generateChat' denied on resource
'//cloudaicompanion.googleapis.com/projects/rising-fact-p41fc/locations/global'
Cause: Plugin falls back to a default project ID when no valid project is found. Fixed in v1.7.0+ by automatic discovery of the account's real managedProjectId.
Solution:
- Go to Google Cloud Console
- Create or select a project
- Enable the Gemini for Google Cloud API (
cloudaicompanion.googleapis.com) - Add
projectIdto your accounts file:{ "accounts": [ { "email": "your@email.com", "refreshToken": "...", "projectId": "your-project-id" } ] }
Note: Do this for each account in a multi-account setup.
Add this to your google provider config:
Error:
Invalid JSON payload received. Unknown name "parameters" at 'request.tools[0]'
Causes:
- Tool schema incompatibility with Gemini's strict protobuf validation
- MCP servers with malformed schemas
- Plugin version regression
Solutions:
-
Update to latest release from GitHub:
{ "plugins": ["github:JoshRob297/opencode-antigravity-auth"] } -
Disable MCP servers one-by-one to find the problematic one
-
Add npm override:
{ "providers": { "google": { "npm": "@ai-sdk/google" } } }
Some MCP servers have schemas incompatible with Antigravity's strict JSON format.
Common symptom:
Invalid function name must start with a letter or underscoreSometimes it shows up as:
GenerateContentRequest.tools[0].function_declarations[12].name: Invalid function name must start with a letter or underscoreThis usually means an MCP tool name starts with a number (for example, a 1mcp key like 1mcp_*). Rename the MCP key to start with a letter (e.g., gw) or disable that MCP entry for Antigravity models.
Diagnosis:
- Disable all MCP servers in your config
- Enable one-by-one until error reappears
- Report the specific MCP in a GitHub issue
Cause: Cascade bug in clearExpiredRateLimits() in hybrid mode (fixed in recent beta).
Solutions:
- Update to latest beta version
- If persists, delete accounts file and re-authenticate
- Try switching
account_selection_strategyto"sticky"inantigravity.json
If you encounter errors during a session:
- Type
continueto trigger the recovery mechanism - If blocked, use
/undoto revert to pre-error state - Retry the operation
Important: Disable the built-in Google auth to prevent conflicts:
// ~/.config/opencode/oh-my-opencode.json
{
"google_auth": false,
"agents": {
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3.8-flash" },
"document-writer": { "model": "google/antigravity-gemini-3.8-flash" }
}
}Cause: When account is rate-limited and plugin retries infinitely, it creates many temp files.
Workaround:
- Stop OpenCode
- Clean up:
rm ~/.config/opencode/*.tmp - Add more accounts or wait for rate limit to expire
Safari OAuth Callback Fails (macOS)
Symptoms:
- "fail to authorize" after successful Google login
- Safari shows "Safari can't open the page"
Cause: Safari's "HTTPS-Only Mode" blocks http://localhost callback.
Solutions:
-
Use Chrome or Firefox (easiest): Copy the OAuth URL and paste into a different browser.
-
Disable HTTPS-Only Mode temporarily:
- Safari > Settings (⌘,) > Privacy
- Uncheck "Enable HTTPS-Only Mode"
- Run
opencode auth login - Re-enable after authentication
Port Conflict (Address Already in Use)
macOS / Linux:
# Find process using the port
lsof -i :51121
# Kill if stale
kill -9 <PID>
# Retry
opencode auth loginWindows (PowerShell):
netstat -ano | findstr :51121
taskkill /PID <PID> /F
opencode auth loginDocker / WSL2 / Remote Development
OAuth callback requires browser to reach localhost on the machine running OpenCode.
WSL2:
- Use VS Code's port forwarding, or
- Configure Windows → WSL port forwarding
SSH / Remote:
ssh -L 51121:localhost:51121 user@remoteDocker / Containers:
- OAuth with localhost redirect doesn't work in containers
- Wait 30s for manual URL flow, or use SSH port forwarding
In OpenCode v2, use the native plural key:
{
"plugins": ["github:JoshRob297/opencode-antigravity-auth"]
}OpenCode v1 uses the legacy singular key "plugin". The updater detects both automatically and preserves whichever convention your configuration uses.
When copying antigravity-accounts.json to a new machine:
- Ensure the plugin is installed in
~/.config/opencode/opencode.json("plugins"or"plugin") - Copy
~/.config/opencode/antigravity-accounts.json - If you get "API key missing" error, the refresh token may be invalid — re-authenticate
For details on load balancing, dual quota pools, and account storage, see docs/MULTI-ACCOUNT.md.
DCP creates synthetic assistant messages that lack thinking blocks. List this plugin BEFORE DCP:
{
"plugins": [
"github:JoshRob297/opencode-antigravity-auth",
"@tarquinen/opencode-dcp@latest"
]
}Disable built-in auth and override agent models in oh-my-opencode.json:
{
"google_auth": false,
"agents": {
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3.8-flash" },
"document-writer": { "model": "google/antigravity-gemini-3.8-flash" },
"multimodal-looker": { "model": "google/antigravity-gemini-3.8-flash" }
}
}Tip: When spawning parallel subagents, enable
pid_offset_enabled: trueinantigravity.jsonto distribute sessions across accounts.
- gemini-auth plugins — Not needed. This plugin handles all Google OAuth.
Create ~/.config/opencode/antigravity.json for optional settings:
{
"$schema": "https://raw.githubusercontent.com/JoshRob297/opencode-antigravity-auth/main/assets/antigravity.schema.json"
}Most users don't need to configure anything — defaults work well.
| Option | Default | What it does |
|---|---|---|
keep_thinking |
false |
Preserve Claude's thinking across turns. Warning: enabling may degrade model stability. |
session_recovery |
true |
Auto-recover from tool errors |
| Your Setup | Recommended Config |
|---|---|
| 1 account | "account_selection_strategy": "sticky" |
| 2-5 accounts | Default ("hybrid") works great |
| 5+ accounts | "account_selection_strategy": "round-robin" |
| Parallel agents | Add "pid_offset_enabled": true |
Every strategy respects entitlements: an account whose measured catalog lacks the requested model is skipped for that model, regardless of how healthy or free it is.
| Option | Default | What it does |
|---|---|---|
soft_quota_threshold_percent |
100 |
Skip account when quota usage exceeds this percentage. Defaults to 100 (disabled) to avoid premature account exhaustion lockouts on low quotas. Set to 90 for conservative protection against Google penalties. |
quota_refresh_interval_minutes |
15 |
Background quota refresh interval. After successful API requests, refreshes quota cache if older than this interval. Set to 0 to disable. |
soft_quota_cache_ttl_minutes |
"auto" |
How long quota cache is considered fresh. "auto" = max(2 × refresh interval, 10 minutes). Set a number (1-120) for fixed TTL. |
How it works: Quota cache is refreshed automatically after API requests (when older than
quota_refresh_interval_minutes) and manually via "Check quotas" inopencode auth login. The threshold check usessoft_quota_cache_ttl_minutesto determine cache freshness - if cache is older, the account is considered "unknown" and allowed (fail-open). When ALL accounts exceed the threshold, the plugin waits for the earliest quota reset time (like rate limit behavior). If wait time exceedsmax_rate_limit_wait_seconds, it errors immediately.Transport Circuit Breaker & Tool Pruning (v2.3.0+): To prevent 60-second gateway TCP resets (
ECONNRESET) caused by massive command/tool dumps, outputs exceeding 30,000 characters in historical turns (older than the last 2) are automatically pruned with a clear summary snippet. Furthermore, a circuit breaker halts runaway retries after 3 consecutive transport dropouts on the same session, prompting context compaction.
Control how the plugin handles rate limits:
| Option | Default | What it does |
|---|---|---|
scheduling_mode |
"cache_first" |
"cache_first" = wait for same account (preserves prompt cache), "balance" = switch immediately, "performance_first" = round-robin |
max_cache_first_wait_seconds |
60 |
Max seconds to wait in cache_first mode before switching accounts |
failure_ttl_seconds |
3600 |
Reset failure count after this many seconds (prevents old failures from permanently penalizing accounts) |
When to use each mode:
- cache_first (default): Best for long conversations. Waits for the same account to recover, preserving your prompt cache.
- balance: Best for quick tasks. Switches accounts immediately when rate-limited for maximum availability.
- performance_first: Best for many short requests. Distributes load evenly across all accounts.
| Option | Default | What it does |
|---|---|---|
quiet_mode |
false |
Hide toast notifications |
debug |
false |
Enable debug file logging (~/.config/opencode/antigravity-logs/) |
debug_tui |
false |
Show debug logs in the TUI log panel (independent from debug) |
auto_update |
true |
Auto-update plugin |
For all options, see docs/CONFIGURATION.md.
Environment variables:
OPENCODE_CONFIG_DIR=/path/to/config opencode # Custom config directory
OPENCODE_ANTIGRAVITY_DEBUG=1 opencode # Enable debug file logging
OPENCODE_ANTIGRAVITY_DEBUG=2 opencode # Verbose debug file logging
OPENCODE_ANTIGRAVITY_DEBUG_TUI=1 opencode # Enable TUI log panel debug outputSee the full Troubleshooting Guide for solutions to common issues including:
- Auth problems and token refresh
- "Model not found" /
404on a model your account is not granted - Session recovery
- IAM and Google Cloud project permission errors
- Safari OAuth issues
- Plugin compatibility
- Migration guides
- Configuration — All configuration options
- Multi-Account — Load balancing, dual quota pools, account storage
- Model Variants — Thinking budgets and variant system
- Troubleshooting — Common issues and fixes
- Architecture — How the plugin works
- API Spec — Antigravity API reference
Translations:
- Español (README.es.md) — Spanish translation of this README. English is the source of truth; the translation may lag behind.
- Español (docs/CONFIGURATION.es.md) — Configuration
- Español (docs/MULTI-ACCOUNT.es.md) — Multi-Account
- Español (docs/TROUBLESHOOTING.es.md) — Troubleshooting
This project stands on the shoulders of the open-source community:
- Original Author: NoeFabris — Created the original
opencode-antigravity-authplugin. - Upstream Contributors:
- Revival Maintainer: JoshRob297 — v1.7.0+ maintenance, Gemini 3.7 Flash support & IAM 403 fixes.
MIT License. See LICENSE for details.
Legal
- Personal / internal development only
- Respect internal quotas and data handling policies
- Not for production services or bypassing intended limits
By using this plugin, you acknowledge:
- Terms of Service risk — This approach may violate ToS of AI model providers
- Account risk — Providers may suspend or ban accounts
- No guarantees — APIs may change without notice
- Assumption of risk — You assume all legal, financial, and technical risks
- Not affiliated with Google. This is an independent open-source project.
- "Antigravity", "Gemini", "Google Cloud", and "Google" are trademarks of Google LLC.
{ "providers": { "google": { "npm": "@ai-sdk/google", "models": { ... } } } }