Description: Patched opencode-antigravity-auth plugin (fork of NoeFabris/opencode-antigravity-auth) with verified Antigravity 2.0.10 traffic compatibility OAuth+CodeAssist token refresh, dummy apiKey, and x-goog-api-key header stripping for opencode v1.17.13 on Linux.
Find a file
2026-07-08 23:17:52 +02:00
src feat: add gemini 2.5 flash/pro, gpt-oss-120b-medium models 2026-07-08 23:17:52 +02:00
.gitignore fix: strip x-goog-api-key header and provide dummy apiKey for opencode 1.17.13 compat 2026-07-04 00:35:03 +02:00
index.ts fix: strip x-goog-api-key header and provide dummy apiKey for opencode 1.17.13 compat 2026-07-04 00:35:03 +02:00
install.sh fix: strip x-goog-api-key header and provide dummy apiKey for opencode 1.17.13 compat 2026-07-04 00:35:03 +02:00
LICENSE fix: strip x-goog-api-key header and provide dummy apiKey for opencode 1.17.13 compat 2026-07-04 00:35:03 +02:00
package-lock.json fix: strip x-goog-api-key header and provide dummy apiKey for opencode 1.17.13 compat 2026-07-04 00:35:03 +02:00
package.json fix: strip x-goog-api-key header and provide dummy apiKey for opencode 1.17.13 compat 2026-07-04 00:35:03 +02:00
README.md feat: add gemini 2.5 flash/pro, gpt-oss-120b-medium models 2026-07-08 23:17:52 +02:00
tsconfig.build.json fix: strip x-goog-api-key header and provide dummy apiKey for opencode 1.17.13 compat 2026-07-04 00:35:03 +02:00
tsconfig.json fix: strip x-goog-api-key header and provide dummy apiKey for opencode 1.17.13 compat 2026-07-04 00:35:03 +02:00

opencode-antigravity-auth — Antigravity 2.0.10 verified patches

Fork of NoeFabris/opencode-antigravity-auth with the upstream plugin patched to match real Antigravity 2.0.10 client traffic, so the OAuth+CodeAssist flow keeps working after upstream stops resolving the project or starts handing back 401/403/404.

Heads up — using this (or any Antigravity proxy) violates Google's ToS. Accounts have been banned and shadow-banned. Don't run it on anything you can't lose.

What's patched

Verified against captured Antigravity 2.0.10 traffic — see scripts/agy_poc.py in the web2cli repo for the reference implementation these patches mirror.

Patch File Change
Endpoint src/constants.ts Primary endpoint → https://daily-cloudcode-pa.googleapis.com (was prod/sandbox).
User-Agent src/constants.ts antigravity/hub/2.0.10 darwin/arm64 (native client format, not vscode-google-cloud-code).
Version src/constants.ts ANTIGRAVITY_VERSION_FALLBACK = "2.0.10" (upstream: 1.18.3).
loadCodeAssist metadata src/antigravity/oauth.ts Body trimmed to { metadata: { ideType: "ANTIGRAVITY" } }platform and pluginType stripped (real client doesn't send them).
model-resolver src/plugin/transform/model-resolver.ts Added minimal thinking tier, gemini-3.5-flash-* aliases (extra-low, low), and 4 new model IDs from API probing: gemini-2.5-flash, gemini-2.5-flash-lite, gemini-2.5-flash-thinking, gemini-2.5-pro.
Quota endpoint src/plugin/quota.ts Uses ANTIGRAVITY_ENDPOINT instead of hardcoded prod.
ESM compat index.ts Explicit .js extensions on imports.
Plugin SDK package.json Pinned to @opencode-ai/plugin@1.15.10.
Provider id src/constants.ts Renamed googleantigravity so opencode treats it as a custom provider and stops pulling the full @ai-sdk/google catalog from models.dev. install.sh still declares "npm": "@ai-sdk/google" on the provider so the Google SDK is used to build request URLs (which the plugin's fetch override intercepts) — catalog auto-merge keys off the provider id, not the npm field.
Model catalog src/plugin/config/models.ts Trimmed to 11 models: Gemini 3.1 Pro, 3.5 Flash, 3 Flash, 3.1 Flash Lite, 2.5 Flash, 2.5 Flash Lite, 2.5 Flash Thinking, 2.5 Pro, Claude Sonnet 4.6, Claude Opus 4.6 Thinking, GPT-OSS 120B Medium.

Everything else (multi-account, rotation, recovery, dual quota, Claude/Gemini transforms, search grounding) is upstream and unchanged.

Install

This isn't published to npm — install it as a local plugin from a checkout.

git clone https://github.com/MoguchiyDuh/opencode-antigravity-auth.git
cd opencode-antigravity-auth
./install.sh
opencode auth login   # pick "OAuth with Google (Antigravity)"

install.sh runs npm install (which builds via the prepare hook), symlinks the repo into ~/.cache/opencode/packages/opencode-antigravity-auth-agy2 (so companion plugins that probe for opencode-antigravity-auth* by package-name prefix — e.g. @slkiser/opencode-quota — can find it), and appends "file:<this-dir>" to the plugin array in ~/.config/opencode/opencode.json. If the config doesn't exist, it tells you what to paste.

Manual alternative — add to ~/.config/opencode/opencode.json:

{
  "plugin": ["file:/absolute/path/to/opencode-antigravity-auth"]
}

Models

install.sh writes the model roster directly into provider.antigravity.models. The auth menu's "Configure models in opencode.json" option will refresh it if you ever need to.

Model id Variants
antigravity-gemini-3.1-pro low, high
antigravity-gemini-3.5-flash low, medium, high
antigravity-gemini-3-flash minimal, low, medium, high
antigravity-gemini-3.1-flash-lite
antigravity-gemini-2.5-flash low, medium, high
antigravity-gemini-2.5-flash-lite
antigravity-gemini-2.5-flash-thinking
antigravity-gemini-2.5-pro low, medium, high
antigravity-gpt-oss-120b-medium
antigravity-claude-sonnet-4-6
antigravity-claude-opus-4-6-thinking low, max
opencode run "hi" --model=antigravity/antigravity-claude-opus-4-6-thinking --variant=max

Config

Optional ~/.config/opencode/antigravity.json — see upstream NoeFabris/opencode-antigravity-auth for the full options list (cli_first, account_selection_strategy, soft_quota_threshold_percent, scheduling_mode, etc.). Defaults are fine for most users.

Troubleshooting

  • "All accounts rate-limited" / stale authrm ~/.config/opencode/antigravity-accounts.json && opencode auth login.
  • 403 cloudaicompanion.companions.generateChat denied on rising-fact-p41fc → add a real projectId to each entry in antigravity-accounts.json (the fallback project ID doesn't have the Gemini CLI API enabled).
  • Safari OAuth fails → use Chrome/Firefox, or disable HTTPS-Only Mode for localhost.
  • OAuth port 51121 in uselsof -i :51121 and kill the stale process.

For deeper issues see upstream's troubleshooting docs.

License

MIT — see LICENSE. Not affiliated with Google. "Antigravity", "Gemini", and "Google" are trademarks of Google LLC.