How to Use Claude Opus 4.5 & Gemini 3 for Free with OpenCode
Source: Dev.to
TL;DR
OpenCode is an open‑source AI coding agent that can connect to models such as Claude, GPT, Gemini, and more. It includes free models out of the box, or you can bring your own from any provider. This guide shows how to set up OpenCode with Antigravity Auth using Google OAuth.
Installation
You can install OpenCode with many package managers (Homebrew, npm, pnpm, yarn, scoop, choco, etc.). The example below uses bun:
bun install -g opencode-ai
For additional install options, see the Installation Docs.
Authentication (Antigravity Auth)
-
Install the
opencode-antigravity-authplugin. The repository is available at . Follow the install instructions in the repo and choose Option B (manual config). -
Edit the OpenCode configuration file to add the plugin:
vim ~/.config/opencode/opencode.json{ "plugin": ["opencode-antigravity-auth@beta"] } -
Ensure you have a Google account that supports Antigravity.
-
Run the authentication command:
opencode auth login -
You’ll see a provider list. Select Google, then choose OAuth with Google (Antigravity). Your browser will open; sign in with your Google account. After a successful login you should see messages similar to:
• Multi-account setup complete (1 account(s)). o Login successful — Done
Configuration
Open the full configuration file to add model definitions:
vim ~/.config/opencode/opencode.json
Paste the configuration block from the plugin’s documentation (you can keep the version you added earlier unless you want to customize models). Save and exit.
Using OpenCode
Start OpenCode:
opencode
In the UI, press Ctrl + P, then select:
Switch model → Claude Opus 4.5 (Antigravity)
You’re now ready to code with OpenCode using Antigravity‑authenticated models. Happy coding! 🌱