OpenCode

OpenCode is an open-source AI coding agent with a terminal UI and desktop app. ApiGo is not a built-in OpenCode provider — register it with @ai-sdk/openai-compatible.

Install

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

Other options:

npm install -g opencode-ai
brew install anomalyco/tap/opencode

See the OpenCode install docs for Bun, pnpm, Yarn, Arch, and Windows.

Configure ApiGo

Create or edit opencode.json in your project (or the global OpenCode config location):

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "apigo": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "ApiGo",
      "options": {
        "baseURL": "https://api.apigo.ai/v1"
      },
      "models": {
        "gpt-5.6-sol": {
          "name": "GPT-5.6 Sol"
        },
        "qwen3.8-max": {
          "name": "Qwen 3.8 Max"
        },
        "deepseek-v4-flash": {
          "name": "DeepSeek V4 Flash"
        }
      }
    }
  }
}

Replace model keys with slugs from the Model Catalog.

Add your API key

Option A: /connect in the TUI

cd /path/to/your/project
opencode

Run /connect, select the ApiGo provider you defined, and paste sk-apigo-....

Option B: auth file

Write ~/.local/share/opencode/auth.json (path may vary by OS / install):

{
  "apigo": {
    "type": "api",
    "key": "sk-apigo-..."
  }
}

Select a model

Inside OpenCode:

/models

Pick an ApiGo model, then start coding. Confirm traffic in Call Logs.

Optional: Anthropic base URL override

If you prefer Claude-native traffic for Anthropic models, you can also override the built-in Anthropic provider base URL:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "anthropic": {
      "options": {
        "baseURL": "https://api.apigo.ai"
      }
    }
  }
}

Authenticate with your ApiGo key for that provider. Prefer the custom apigo provider above when you want mixed vendors under one key.

Troubleshooting

Symptom Fix
Auth errors Re-run /connect or verify auth.json
Model not listed Add the exact slug under provider.apigo.models
Requests miss ApiGo Confirm options.baseURL is https://api.apigo.ai/v1

Resources