How to Use Claude Opus 4.5 & Gemini 3 for Free with OpenCode
TL;DR
This guide shows how to set up OpenCode with the Antigravity plugin and Google OAuth to use powerful AI models like Claude Opus 4.5 and Gemini 3 for free. Follow the installation and configuration steps to access top-tier models without paid API keys.
Key Takeaways
- •Install OpenCode using package managers like bun, then configure it with the opencode-antigravity-auth plugin.
- •Authenticate with Google using Antigravity via OAuth to enable access to free AI models.
- •Update the OpenCode configuration file to include model definitions for Claude Opus 4.5, Gemini 3, and other models.
- •Launch OpenCode and select Claude Opus 4.5 or other models to start using them for coding tasks.
Tags
🧵 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! 🌱
