DEV Community

Cover image for How to Use Claude Opus 4.5 & Gemini 3 for Free with OpenCode
0xkoji
0xkoji

Posted on • Edited on

How to Use Claude Opus 4.5 & Gemini 3 for Free with OpenCode

🧵 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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Add the plugin:

{
  "plugin": ["opencode-antigravity-auth@beta"]
}
Enter fullscreen mode Exit fullscreen mode

šŸ” Step 3: Authenticate with Google (Antigravity)

Make sure you have a Google account that supports Antigravity.

Run:

opencode auth login
Enter fullscreen mode Exit fullscreen mode

You’ll see a provider list like this:

> Google
  OpenAI
  Anthropic
  GitHub Copilot
  ...
Enter fullscreen mode Exit fullscreen mode

Select Google, then choose:

> OAuth with Google (Antigravity)
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

🧩 Step 4: Update Your Config

Now let’s update the full config file to include model definitions. Open:

vim ~/.config/opencode/opencode.json
Enter fullscreen mode Exit fullscreen mode

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"] }
        }
      }
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

🧠 Step 5: Select Claude Opus 4.5

Launch OpenCode:

opencode
Enter fullscreen mode Exit fullscreen mode

Then press Ctrl + P and choose:

Switch model → Claude Opus 4.5 (Antigravity)
Enter fullscreen mode Exit fullscreen mode

SELECT MODEL

opus4.5

That’s it! You’re now ready to use OpenCode with Antigravity-authenticated models. Happy coding! 🌱

Top comments (2)

Collapse
 
ominiverdi profile image
ominiverdi • Edited

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

  • Google Search with source citations
  • URL content extraction
  • Dynamic model selection (auto-picks best available model)
  • Smart fallback when models hit capacity

opencode-antigravity-img (npmjs.com/package/opencode-antigra...) - Image generation

  • Gemini 3 Pro Image model
  • Multiple aspect ratios and resolutions (up to 4K)
  • Quota tracking

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.

Collapse
 
slimane_benlala_da0031c0c profile image
Slimane BENLALA

Can one use these settings for cursor.