OpenCode

Install and configure OpenCode CLI, Desktop, and Web.

Follow the separate Desktop, CLI, or local Web guide below.

OpenCode Desktop

Windows · macOS

Windows

1. Install

Download the Windows installer from OpenCode, run it, follow the installation prompts, and open OpenCode.

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

Open OpenCode Desktop and go to Settings → Providers → Add provider → Custom provider, then enter:

  • Provider ID: getrun
  • Display name: GetRun
  • Base URL: https://api.get-apikey.com/v1
  • API key: your actual Key
  • Models: enter the actual model ID on the left and its display name on the right; both values may be the same

Scroll down and save. Add more model rows when you need more than one model.

The OpenCode custom-provider page on Windows with lowercase getrun as the Provider ID, GetRun as the display name, api.get-apikey.com/v1 as the Base URL.

3. Use

Save and reopen OpenCode. Select a project folder, start a session, choose your model under GetRun, and send Reply only OK. After receiving a reply, enter your task.

macOS

1. Install

Download the package for your Mac from OpenCode, follow its installation steps to add it to Applications, and open OpenCode.

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

Open OpenCode Desktop and go to Settings → Providers → Add provider → Custom provider, then enter:

  • Provider ID: getrun
  • Display name: GetRun
  • Base URL: https://api.get-apikey.com/v1
  • API key: your actual Key
  • Models: enter the actual model ID on the left and its display name on the right; both values may be the same

Scroll down and save. Add more model rows when you need more than one model.

The OpenCode custom-provider page on macOS with lowercase getrun as the Provider ID, api.get-apikey.com/v1 as the Base URL.

3. Use

Save and reopen OpenCode. Select a project folder, start a session, choose your model under GetRun, and send Reply only OK. After receiving a reply, enter your task.

OpenCode CLI

Windows · macOS

Windows

1. Install

Open PowerShell from the Start menu.

Check Node.js and npm:

node --version
npm --version

If either command is missing, install the LTS release from Node.js and reopen the terminal. Once both version numbers appear, run:

npm install --global opencode-ai
opencode --version

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

The configuration file is %USERPROFILE%\.config\opencode\opencode.json.

  1. Press Win + E to open File Explorer.
  2. Enter %USERPROFILE%\.config\opencode in the address bar and press Enter.
  3. Right-click opencode.json and choose Open with → Notepad.
  4. If the directory is missing, create the .config → opencode folders inside %USERPROFILE%. If the file is missing, create it in Notepad.
opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "getrun": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "GetRun",
      "options": {
        "baseURL": "https://api.get-apikey.com/v1",
        "apiKey": "your-api-key"
      },
      "models": {
        "YOUR_MODEL": {
          "name": "YOUR_MODEL"
        }
      }
    }
  },
  "model": "getrun/YOUR_MODEL"
}

Replace your-api-key with your Key and every YOUR_MODEL with the same model ID. Merge provider.getrun and model into an existing file while keeping other settings.

Save in the directory above. In Notepad, use Save As → All files → UTF-8 and name the file opencode.json without an extra .txt extension.

3. Use

Open your project folder in File Explorer, enter powershell in the address bar, and press Enter.

opencode

Select your configured GetRun model and send Reply only OK. After receiving a reply, enter your coding task. Restart after editing the configuration.

macOS

1. Install

Press Command + Space to find and open Terminal.

Check Node.js and npm:

node --version
npm --version

If either command is missing, install the LTS release from Node.js and reopen the terminal. Once both version numbers appear, run:

npm install --global opencode-ai
opencode --version

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

The configuration file is ~/.config/opencode/opencode.json.

  1. Open Finder and press Command + Shift + G.
  2. Enter ~/.config/opencode and select Go.
  3. Open opencode.json in TextEdit or VS Code.
  4. If the folder or file is missing, choose File → Open Folder in VS Code, press Command + Shift + G, and enter ~ to open your home directory. Create the .config → opencode folders in the Explorer sidebar, then create opencode.json inside.
opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "getrun": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "GetRun",
      "options": {
        "baseURL": "https://api.get-apikey.com/v1",
        "apiKey": "your-api-key"
      },
      "models": {
        "YOUR_MODEL": {
          "name": "YOUR_MODEL"
        }
      }
    }
  },
  "model": "getrun/YOUR_MODEL"
}

Replace your-api-key with your Key and every YOUR_MODEL with the same model ID. Merge provider.getrun and model into an existing file while keeping other settings.

Press Command + S to save. In TextEdit, choose Format → Make Plain Text and keep the filename opencode.json.

3. Use

Open Terminal, type cd with a trailing space, drag your project folder from Finder into Terminal, and press Enter.

opencode

Select your configured GetRun model and send Reply only OK. After receiving a reply, enter your coding task. Restart after editing the configuration.

OpenCode Web

Windows · macOS

Windows

1. Install

The Web interface runs through OpenCode CLI. Install the CLI first:

Open PowerShell from the Start menu.

Check Node.js and npm:

node --version
npm --version

If either command is missing, install the LTS release from Node.js and reopen the terminal. Once both version numbers appear, run:

npm install --global opencode-ai
opencode --version

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

The configuration file is %USERPROFILE%\.config\opencode\opencode.json.

  1. Press Win + E to open File Explorer.
  2. Enter %USERPROFILE%\.config\opencode in the address bar and press Enter.
  3. Right-click opencode.json and choose Open with → Notepad.
  4. If the directory is missing, create the .config → opencode folders inside %USERPROFILE%. If the file is missing, create it in Notepad.
opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "getrun": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "GetRun",
      "options": {
        "baseURL": "https://api.get-apikey.com/v1",
        "apiKey": "your-api-key"
      },
      "models": {
        "YOUR_MODEL": {
          "name": "YOUR_MODEL"
        }
      }
    }
  },
  "model": "getrun/YOUR_MODEL"
}

Replace your-api-key with your Key and every YOUR_MODEL with the same model ID. Merge provider.getrun and model into an existing file while keeping other settings.

Save in the directory above. In Notepad, use Save As → All files → UTF-8 and name the file opencode.json without an extra .txt extension.

3. Use

Open your project folder in File Explorer, enter powershell in the address bar, and press Enter.

opencode web

Open the local URL printed in the terminal, select your project, and start a session. Keep the terminal running; press Ctrl + C there to stop the Web service.

Select your configured GetRun model and send Reply only OK. After receiving a reply, enter your coding task. Restart after editing the configuration.

macOS

1. Install

The Web interface runs through OpenCode CLI. Install the CLI first:

Press Command + Space to find and open Terminal.

Check Node.js and npm:

node --version
npm --version

If either command is missing, install the LTS release from Node.js and reopen the terminal. Once both version numbers appear, run:

npm install --global opencode-ai
opencode --version

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

The configuration file is ~/.config/opencode/opencode.json.

  1. Open Finder and press Command + Shift + G.
  2. Enter ~/.config/opencode and select Go.
  3. Open opencode.json in TextEdit or VS Code.
  4. If the folder or file is missing, choose File → Open Folder in VS Code, press Command + Shift + G, and enter ~ to open your home directory. Create the .config → opencode folders in the Explorer sidebar, then create opencode.json inside.
opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "getrun": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "GetRun",
      "options": {
        "baseURL": "https://api.get-apikey.com/v1",
        "apiKey": "your-api-key"
      },
      "models": {
        "YOUR_MODEL": {
          "name": "YOUR_MODEL"
        }
      }
    }
  },
  "model": "getrun/YOUR_MODEL"
}

Replace your-api-key with your Key and every YOUR_MODEL with the same model ID. Merge provider.getrun and model into an existing file while keeping other settings.

Press Command + S to save. In TextEdit, choose Format → Make Plain Text and keep the filename opencode.json.

3. Use

Open Terminal, type cd with a trailing space, drag your project folder from Finder into Terminal, and press Enter.

opencode web

Open the local URL printed in the terminal, select your project, and start a session. Keep the terminal running; press Ctrl + C there to stop the Web service.

Select your configured GetRun model and send Reply only OK. After receiving a reply, enter your coding task. Restart after editing the configuration.

Other configuration locations

On Linux, CLI and Web use the same installation command and default to ~/.config/opencode/opencode.json. If XDG_CONFIG_HOME is set, use opencode/opencode.json inside it. If OPENCODE_CONFIG is set, check that file. A project’s opencode.json can also override global settings. See the OpenCode configuration guide.

On this page