Skip to content

OpenCode install guide (Windows) ​

Prefer one command?

The OpenCode one-line setup installs OpenCode and configures Claude and GPT for you.

0. Prerequisite: install Node.js ​

Install Node.js first: Node.js on Windows

1. Install OpenCode ​

powershell
npm i -g opencode-ai@latest
opencode --version

2. Install the SDKs (required) ​

2.1 What's an SDK? ​

An SDK is the package that lets OpenCode talk to a given AI service. OpenCode supports many services, so you install the SDK for each one you use.

Step 1: Create the config directory

powershell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.config\opencode"

Step 2: Go into it

powershell
cd "$env:USERPROFILE\.config\opencode"

Step 3: Install the Anthropic SDK (for Claude models)

powershell
npm install @ai-sdk/anthropic

Wait for it to finish (it can take a few minutes).

2.3 Optional: install the OpenAI SDK ​

Want GPT models too? Install the OpenAI SDK as well:

powershell
npm install @ai-sdk/openai

Tip: Flash API serves both Claude and GPT, so installing both SDKs saves you a trip later.

3. Configure OpenCode (connect to Flash API) ​

3.1 Where's the config file? ​

Config path: %USERPROFILE%\.config\opencode\opencode.json

What that means:

  • The full path is C:\Users\<your-username>\.config\opencode\opencode.json

3.2 Get your Flash API key ​

Step 1: Grab your API key from Flash API

  • No account yet? Sign up first
  • After logging in, find your API key in the dashboard and copy it

3.3 Write the config file ​

Here's a config for Claude models (replace the API key):

powershell
@'
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "flashapi-claude": {
      "npm": "@ai-sdk/anthropic",
      "options": {
        "apiKey": "YOUR_FLASH_API_KEY",
        "baseURL": "https://ai.flashapi.top/v1"
      },
      "models": {
        "claude-opus-5-5": {
          "name": "Claude Opus 5.5",
          "attachment": true
        }
      }
    }
  },
  "model": "flashapi-claude/claude-opus-5-5"
}
'@ | Set-Content -Path "$env:USERPROFILE\.config\opencode\opencode.json" -Encoding UTF8

Must replace: swap YOUR_FLASH_API_KEY for the real key you copied from Flash API.

3.4 Adding GPT models too ​

If you installed @ai-sdk/openai earlier, use this config instead (Claude and GPT side by side):

powershell
@'
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "flashapi-claude": {
      "npm": "@ai-sdk/anthropic",
      "options": {
        "apiKey": "YOUR_FLASH_API_KEY",
        "baseURL": "https://ai.flashapi.top/v1"
      },
      "models": {
        "claude-opus-5-5": {
          "name": "Claude Opus 5.5",
          "attachment": true
        }
      }
    },
    "flashapi-openai": {
      "npm": "@ai-sdk/openai",
      "options": {
        "apiKey": "YOUR_FLASH_API_KEY",
        "baseURL": "https://ai.flashapi.top/v1"
      },
      "models": {
        "gpt-6.1-sol": {
          "name": "GPT-6.1 Sol",
          "attachment": true
        }
      }
    }
  },
  "model": "flashapi-claude/claude-opus-5-5"
}
'@ | Set-Content -Path "$env:USERPROFILE\.config\opencode\opencode.json" -Encoding UTF8

What the config does:

  • "model" sets the default model
  • To default to GPT, change it to "model": "flashapi-openai/gpt-6.1-sol"
  • "attachment": true enables file uploads (images, code files, etc.)

4. Start and verify ​

powershell
cd C:\path\to\your\project
opencode

Replace C:\path\to\your\project with your actual project path. If everything is configured correctly, OpenCode starts up connected to Flash API.

One base URL for GPT, Claude and Gemini