🧵 TL;DR (Too Long; Didn’t Read)
Want to use powerful AI models like Claude Opus 4.5 and Gemini 3 for free? This guide walks you through setting up OpenCode with the Antigravity plugin and Google OAuth. You’ll be up and running with top-tier models in minutes—no paid API keys required.
🚀 Getting Started with OpenCode + Antigravity Auth
OpenCode is an open-source AI coding agent that lets you connect to models like Claude, GPT, Gemini, and more. It comes with free models out of the box, or you can bring your own from any provider.
In this guide, I’ll walk you through setting up OpenCode with Antigravity Auth using Google OAuth.
🛠 Step 1: Install OpenCode
You can install OpenCode using various package managers like Homebrew, npm, pnpm, yarn, scoop, choco, etc.
For this guide, I’ll use bun:
bun install -g opencode-ai
More install options: Installation Docs
⚙️ Step 2: Configure the Plugin
We’ll use opencode-antigravity-auth plugin. Follow the installation instructions in the repo. I’ll go with Option B here:
vim ~/.config/opencode/opencode.json
Add the plugin:
{
"plugin": ["opencode-antigravity-auth@beta"]
}
🔐 Step 3: Authenticate with Google (Antigravity)
Make sure you have a Google account that supports Antigravity.
Run:
opencode auth login
You’ll see a provider list like this:
> Google
OpenAI
Anthropic
GitHub Copilot
...
Select Google, then choose:
> OAuth with Google (Antigravity)
Your browser will open—sign in with your Google account. Once complete, you should see:
• Multi-account setup complete (1 account(s)).
o Login successful
— Done
🧩 Step 4: Update Your Config
Now let’s update the full config file to include model definitions. Open:
vim ~/.config/opencode/opencode.json
And paste the full configuration block from the plugin’s documentation. (You can keep the version you shared above—no changes needed unless you want to customize models.)
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-antigravity-auth@latest"],
"provider": {
"google": {
"models": {
"antigravity-gemini-3-pro": {
"name": "Gemini 3 Pro (Antigravity)",
"limit": { "context": 1048576, "output": 65535 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
"variants": {
"low": { "thinkingLevel": "low" },
"high": { "thinkingLevel": "high" }
}
},
"antigravity-gemini-3-flash": {
"name": "Gemini 3 Flash (Antigravity)",
"limit": { "context": 1048576, "output": 65536 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
"variants": {
"minimal": { "thinkingLevel": "minimal" },
"low": { "thinkingLevel": "low" },
"medium": { "thinkingLevel": "medium" },
"high": { "thinkingLevel": "high" }
}
},
"antigravity-claude-sonnet-4-5": {
"name": "Claude Sonnet 4.5 (Antigravity)",
"limit": { "context": 200000, "output": 64000 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
},
"antigravity-claude-sonnet-4-5-thinking": {
"name": "Claude Sonnet 4.5 Thinking (Antigravity)",
"limit": { "context": 200000, "output": 64000 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
"variants": {
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
}
},
"antigravity-claude-opus-4-5-thinking": {
"name": "Claude Opus 4.5 Thinking (Antigravity)",
"limit": { "context": 200000, "output": 64000 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
"variants": {
"low": { "thinkingConfig": { "thinkingBudget": 8192 } },
"max": { "thinkingConfig": { "thinkingBudget": 32768 } }
}
},
"gemini-2.5-flash": {
"name": "Gemini 2.5 Flash (Gemini CLI)",
"limit": { "context": 1048576, "output": 65536 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
},
"gemini-2.5-pro": {
"name": "Gemini 2.5 Pro (Gemini CLI)",
"limit": { "context": 1048576, "output": 65536 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
},
"gemini-3-flash-preview": {
"name": "Gemini 3 Flash Preview (Gemini CLI)",
"limit": { "context": 1048576, "output": 65536 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
},
"gemini-3-pro-preview": {
"name": "Gemini 3 Pro Preview (Gemini CLI)",
"limit": { "context": 1048576, "output": 65535 },
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
}
}
}
}
}
🧠 Step 5: Select Claude Opus 4.5
Launch OpenCode:
opencode
Then press Ctrl + P and choose:
Switch model → Claude Opus 4.5 (Antigravity)
That’s it! You’re now ready to use OpenCode with Antigravity-authenticated models. Happy coding! 🌱

Top comments (5)
Building on opencode-antigravity-auth, there are now two companion plugins that extend its capabilities:
opencode-antigravity-web (npmjs.com/package/opencode-antigra...) - Web search and URL reading
opencode-antigravity-img (npmjs.com/package/opencode-antigra...) - Image generation
Setup is simple - just add them alongside the auth plugin:
{
plugins: [
opencode-antigravity-auth,
opencode-antigravity-web,
opencode-antigravity-img
]
}
All three work together using the same Google OAuth authentication.
Is this safe? Google banned a lot of accounts
there will be a risk to be banned by Google. but so far i haven't had any issue.
i guess recent bans are that users use for openclaw or something similar.
is this still work? I am getting error :
Google Generative AI API key is missing. Pass it using the 'apiKey' parameter or the GOOGLE_GENERATIVE_AI_API_KEY environment variable.
Can one use these settings for cursor.