FIM Gate Docs
Integrations

OpenCode

Configure FIM Gate's OpenAI, Anthropic, and third-party model sources for OpenCode.

OpenCode is an open-source terminal AI coding assistant. When connecting to FIM Gate, we recommend configuring three providers at once: the built-in openai and anthropic providers, plus a custom provider for all remaining third-party models. For installation details, see the OpenCode official docs.

Installation

Pick any one of these:

# Official install script
curl -fsSL https://opencode.ai/install | bash

# npm
npm install -g opencode-ai

# Yarn
yarn global add opencode-ai

# Bun
bun install -g opencode-ai

# Homebrew
brew install anomalyco/tap/opencode

Writing the Configuration File

  1. Open (or create) the configuration file:

    • macOS / Linux: ~/.config/opencode/opencode.json
    • Windows: Users\<username>\.config\opencode\opencode.json
  2. Add the following content (JSON does not support comments — don't leave any in after copying):

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "anthropic": {
          "name": "Anthropic",
          "options": {
            "baseURL": "https://api.gate.fim.ai"
          }
        },
        "openai": {
          "options": {
            "baseURL": "https://api.gate.fim.ai/v1"
          },
          "models": {
            "gpt-5.2": {
              "options": {
                "include": ["reasoning.encrypted_content"],
                "store": false,
                "reasoningEffort": "high",
                "textVerbosity": "high",
                "reasoningSummary": "auto"
              }
            },
            "gpt-5.2-codex": {
              "options": {
                "include": ["reasoning.encrypted_content"],
                "store": false
              }
            }
          }
        },
        "fimgate": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "FIM Gate",
          "options": {
            "baseURL": "https://api.gate.fim.ai/v1"
          },
          "models": {
            "deepseek-v3.2": {
              "name": "DeepSeek V3.2"
            }
          }
        }
      }
    }

A few notes:

  • Why split into three providers? OpenCode has special optimizations for the built-in OpenAI and Anthropic providers; if you cram all models into a single generic provider, some capabilities may be unavailable or degraded. Route OpenAI / Claude models through the built-in providers, and put everything else into the custom fimgate provider.
  • For GPT-series models, keep include: ["reasoning.encrypted_content"] and store: false exactly as shown, or calls may fail.
  • anthropic uses Claude's native protocol, so set its baseURL to https://api.gate.fim.ai (without /v1); openai and the custom provider use the OpenAI-compatible protocol, so set their baseURL to https://api.gate.fim.ai/v1.
  • The keys under fimgate.models are model IDs — add or remove them as needed. See the pricing page for available models.

Entering Your API Key

Enter the same FIM Gate key (created in the Console) for each of the three providers:

  1. Run opencode auth login in the terminal, choose OpenAI → Manually enter API Key, and paste your key.
  2. Run opencode auth login again, choose Anthropic → Manually enter API Key, and paste the same key.
  3. Run opencode auth login a third time, choose Other at the bottom of the list, enter fimgate as the Provider ID (it must match the provider key in your configuration file), and paste the key.

Getting Started

opencode
  • The first time you use it in a project, run /init in the session to initialize.
  • Use the /models command to switch models.
  • Press TAB to toggle between plan and build modes: we recommend generating a plan first, then switching to build to write code once you've confirmed it.

Optional Enhancement: Oh My OpenCode

Oh My OpenCode provides preset agents and plugins for OpenCode.

Installation

After starting opencode, paste and send the following in the session:

Install and configure oh-my-opencode by following the instructions here:
https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/refs/heads/master/docs/guide/installation.md

During installation you'll be asked three questions:

  1. Whether you have a Claude Pro / Max subscription — connecting a subscription carries a risk of account suspension, so it's generally not recommended;
  2. Whether you have a ChatGPT Plus / Pro subscription — answer based on your situation;
  3. Whether to integrate Google Gemini — choose Yes if you have a Gemini subscription, otherwise No.

Based on your answers, it automatically installs the corresponding plugins and connects your subscriptions to OpenCode.

Post-Install Configuration

After installation, opencode.json will contain a new plugin field (e.g. ["oh-my-opencode", "opencode-antigravity-auth@1.3.0"]). If you chose the Gemini integration, a google provider will also appear, with model entries like antigravity-gemini-3-pro-high, antigravity-gemini-3-pro-low, and antigravity-gemini-3-flash. See the opencode-antigravity-auth docs for the full model mapping.

It also generates ~/.config/opencode/oh-my-opencode.json. Common settings:

  • google_auth: must be set to false when using the antigravity plugin;

  • mcp / commands / skills / agents / hooks under claude_code: set to false to stop OpenCode from automatically reading Claude Code's local configuration;

  • agents: assigns a model to each built-in agent, for example:

    {
      "agents": {
        "Sisyphus": { "model": "openai/gpt-5.2" },
        "oracle": { "model": "openai/gpt-5.2" },
        "librarian": { "model": "anthropic/claude-sonnet-4-5-20250929" },
        "explore": { "model": "anthropic/claude-sonnet-4-5-20250929" },
        "frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro-high" },
        "document-writer": { "model": "google/antigravity-gemini-3-flash" },
        "multimodal-looker": { "model": "google/antigravity-gemini-3-flash" }
      }
    }

    What each agent does: Sisyphus handles coordination and simple tasks, oracle tackles hard problems and debugging, librarian looks up library documentation, explore explores the code repository, and the rest cover frontend design, documentation writing, and multimodal recognition respectively.

Note: if you integrated Google Gemini, you must first run opencode auth login and choose Google to complete authorization before the related models become available.