Antigravity Model Bridge
A lightweight VS Code Language Model Provider for the Google Antigravity backend.

Pick Gemini 3.8 Flash, Gemini 3.1 Pro, Claude Sonnet 5.5, Claude Opus 5.5 or
GPT-OSS 120B from the standard model picker and keep using native chat and Agent mode.
Requests run on your Antigravity account rather than Copilot premium requests.
Unofficial. Not affiliated with, endorsed by, or supported by Google. This talks to
undocumented v1internal endpoints, so it can break when Antigravity updates. Use a
Google account you are willing to risk.
Highlights
- Native integration — the models appear in the standard model picker, in Chat and Agent mode.
- Automatic model discovery with a curated default, so the picker shows what Antigravity offers rather than every internal alias — new generations appear on their own.
- Full tool calling — built-in, extension and MCP tools are forwarded to the backend, with schemas rewritten to survive its strict validator, including recursive stripping of MCP
x-* vendor metadata and unique ids across multi-step Agent turns.
- Antigravity Web Search — optionally attach
#antigravityWebSearch in Agent mode to run the installed agy CLI's native search_web tool and return grounded source URLs.
- Antigravity Image Generation — attach
#antigravityGenerateImage in Agent mode to run the installed agy CLI's native generate_image tool and return the raster image inline, with optional aspect-ratio control.
- Native reasoning display — the model's thinking appears in Copilot Chat's own collapsible block.
- Context usage reporting — completed gateway token usage feeds VS Code's Context Window
widget, including its prompt breakdown when the installed VS Code build supports it.
- Multi-turn reasoning continuity — thought signatures are replayed so tool-using conversations survive past the first turn.
- Quota groups in the status bar: all Gemini models (including Pro and Flash) share one displayed group; Claude/GPT remains separate, matching the native Antigravity usage display. The percentage is the lowest reported remaining fraction within each group.
- Thinking Effort control in the picker, next to the model, offering only the tiers the backend can serve.
- Multiple accounts, switched manually.
Tool execution, confirmation, workspace trust and permissions remain handled by VS Code.
The Antigravity Web Search and Image Generation tools are the exceptions in
transport: their registered runners start the local agy CLI, while Copilot
still owns tool approval and the conversation loop.
The extension does not silently expose Gaussian/Codex's codexForCopilot_searchWeb
marker to Antigravity models. That marker belongs to the Codex Responses backend.
Use #antigravityWebSearch when you want the Antigravity-native search bridge.
Get started
- Install the extension.
- Run
Antigravity: Sign in with Google from the Command Palette. A browser opens and the
callback returns to http://localhost:51121/oauth-callback.
- The port is not configurable — it is the redirect URI registered with the OAuth client,
and Google rejects any other. If it is busy, close whatever holds it and retry.
- Open Chat and pick an Antigravity model from the model picker.
Credentials live in VS Code SecretStorage and refresh automatically, including refresh-token
rotation. Signing out removes only this extension's copy.
Model selection
Discovery returns every model the backend can route to, including inline-autocomplete models
(Tab_*), internal numeric aliases (Chat_20706), server-side routing aliases (*tiered*),
image models, duplicate display names, and past generations — dozens of entries in practice.
The default latest narrows that to Antigravity own published list: the three newest
Gemini generations of each line, plus Claude and GPT-OSS. That list is a rolling window
rather than a fixed set — it showed 3.5/3.6/3.7 Flash, then 3.6/3.7/3.8 once 3.8
shipped — so the window is encoded instead of the members, and a new generation appears
while an obsolete one leaves on its own. Older Gemini and Flash Lite are excluded.
Set antigravity.modelSelection to all to see everything the backend can route to, or
list ids in antigravity.hiddenModels to remove specific entries.
Effort tiers
Antigravity addresses each effort tier as its own model id, so discovery reports
"Gemini 3.8 Flash (High)", "(Medium)" and "(Low)" as three separate models.
By default they are folded into one entry with a Thinking Effort control beside the
model in the picker, the way Copilot's own models work. Only the tiers the backend
actually routes are offered — Gemini 3.1 Pro shows High and Low but no Medium, because
no such model id exists.
antigravity.reasoningEffort sets the starting value; whatever is chosen in the picker
wins for that request. Set antigravity.effortSelection to tiers to go back to one
picker row per tier.
Requirements
- VS Code 1.108.0 or later
- A Google account with Antigravity access (the free tier is enough)
Runs in the local UI extension host so it can reach the loopback OAuth port. With Remote-SSH,
keep the extension installed locally rather than installing a second copy on the remote host.
Common commands
Antigravity: Manage — accounts, quota, logs and settings in one place
Antigravity: Sign in with Google
Antigravity: Show Auth Status
Antigravity: Refresh Models and Quota
Antigravity: Open Logs
Diagnostics and privacy
Structured logging follows VS Code's log level, adjustable through Developer: Set Log Level….
Every request, auth flow and discovery call carries an operationId so retries and endpoint
fallbacks can be traced.
Logs exclude prompts, reasoning, tool arguments and results, credentials and tokens — keeping
only counts, sizes, transport decisions and redacted error text.
Context window
After a completed response, the extension passes the gateway's prompt, completion, cached,
and reasoning token counts to VS Code through its internal usage response part. This changes
the context indicator from 0 to the actual reported usage. VS Code 1.120 and newer can then
render the same prompt breakdown used by native providers (system instructions, tool
definitions, messages, and tool results); older builds may continue to show only the response
stream.
Configuration
Under Settings → Extensions → Antigravity:
antigravity.modelSelection — latest (default) or all
antigravity.effortSelection — setting (default) or tiers, see above
antigravity.hiddenModels — model ids to omit from the picker
antigravity.reasoningEffort — starting value for the picker's Thinking Effort control
antigravity.showThinking — show the model's reasoning (on by default)
antigravity.toolCallIds — forward tool-call ids on the wire: claude (default), all, or off
antigravity.projectId — override project discovery, if you see 403s naming a project
antigravity.endpoint — pin generation traffic to one gateway host
antigravity.showStatusBar — show remaining quota
antigravity.cliPath — optional path to the agy executable used by Antigravity Web Search and Image Generation
Proxies come from http.proxy or HTTPS_PROXY/HTTP_PROXY, with NO_PROXY respected.
Reasoning
Reasoning is shown by default, rendered as Copilot Chat's own collapsible Thinking…
block. The bridge sends the same completion marker used by Copilot's Agent host when
thinking ends, so the answer stays a normal message instead of being attached to an
unfinished reasoning card. LanguageModelThinkingPart is present in the VS Code runtime
but absent from @types/vscode, so it is feature-detected: builds that lack it fall back
to a markdown blockquote above the answer. Turn it off with antigravity.showThinking.
Not every model returns its reasoning. Gemini Pro and Claude send thought text and get a
block; Gemini Flash reports thought tokens in usage but sends no thought parts, so
nothing renders even though it is thinking. The log distinguishes the two —
thoughtTokens>0 with thoughtParts=0 means the gateway withheld the text, which is a
backend behaviour rather than a fault in this extension.
Web search
Antigravity Web Search is a VS Code tool backed by the locally installed agy
CLI. Select it in the Agent tool picker or reference it as #antigravityWebSearch.
The bridge starts a bounded headless agy run, instructs it to execute exactly
one native search_web call, and returns the resulting markdown answer and
source URLs. It does not reuse the Gaussian/Codex hosted search marker.
The CLI must already be authenticated. Set antigravity.cliPath if agy is
not on PATH; on Windows the standard %LOCALAPPDATA%\agy\bin\agy.EXE
installation is detected automatically. Search runs consume the CLI's own
Antigravity quota and remain subject to its permissions and network policy.
Image generation
Antigravity Image Generation is a VS Code tool backed by the locally installed
agy CLI. Select it in the Agent tool picker or reference it as
#antigravityGenerateImage. The bridge starts a bounded headless run,
instructs it to execute exactly one native generate_image call, and attaches
the validated PNG, JPEG, GIF, or WebP result to the tool response. An optional
aspectRatio hint (1:1, 16:9, 9:16, 4:3, or 3:4) can guide the native
generator; final dimensions remain controlled by Agy's image backend.
The bridge accepts generated artifacts only from the matching Antigravity
conversation's local brain directory and never reads arbitrary paths returned by
the model. Newer Agy CLI builds may omit output_path from the headless event;
the bridge then discovers only recent raster files in that same conversation
directory. It does not expose the CLI's base64 payload or credentials to chat.
Image generation uses the CLI's Antigravity quota, asks for VS Code confirmation
before starting, and may take longer than a normal text response.
If the tool reports “generated no readable raster image artifact”, the Agy
model call may still have succeeded but the artifact was not available or was
written in an unsupported format/location. Retry once after the CLI finishes;
the bridge rejects stale, non-raster, oversized, or outside-session files.
Develop locally
npm install
cp src/api/credentials.example.ts src/api/credentials.ts # then fill in the values
npm run check # typecheck + tests + bundle
npm run package:vsix
Press F5 for an Extension Development Host.
The OAuth client credentials are deliberately not in this repository — see
src/api/credentials.example.ts for what to put there and
where it comes from. The build refuses to run without it rather than producing an extension
that cannot authenticate.
How it works
The gateway speaks a Gemini dialect for every model family, Claude included; Anthropic-style
messages arrays are rejected outright. Most of the work lives in src/translate/:
schema.ts — the backend validates tool schemas with protobuf JSON, which hard-fails on any
unrecognised key. Since VS Code and MCP servers emit their own annotations
(enumDescriptions, markdownDescription, …), schemas pass through an allowlist of the
fields the Schema proto defines rather than a denylist of known-bad ones.
toGemini.ts — a functionResponse is paired to its call by name, not by id, so the
message walk records callId → toolName on the way past the call.
thinking.ts — Gemini selects effort from the tier baked into the model id; only Claude
takes a numeric budget, capped strictly below maxOutputTokens.
api/agent-metadata.ts — requests carry the agent envelope: requestType, a five-segment
requestId, telemetry labels and an FNV-1a session id, in the field order the real client uses.
License
MIT. Antigravity, Gemini and Google Cloud are trademarks of Google LLC.