# OpenCode V2 config — Relax AI (Beta) provider only

> Source: <https://gist.github.com/mpvii/43c9acb469a259e92c5eb90f2ff0aeda>
> Published: 2026-09-19 21:36:37+00:00

Set up OpenCode V2 with a single custom provider: **Relax AI (Beta)**, authenticated with a **saved account** — no environment variables or API keys in your shell config.

The matching config lives in [`opencode-relax-beta.jsonc`](https://gist.github.com/mpvii/43c9acb469a259e92c5eb90f2ff0aeda#file-opencode-relax-beta-jsonc).

Always prefer the pages above for the latest download links — version numbers in this guide may lag behind.

Open the `.dmg`, drag **OpenCode** into **Applications**, then launch it.

Run the installer, then launch **OpenCode**.

The desktop app auto-updates to the latest version and runs its own bundled V2 server.

The desktop app can install the `opencode` command-line tool for you:

1. From the app menu, choose **Install CLI…**
2. Wait for the **“CLI Installed”** confirmation.

It installs `opencode` to `~/.opencode/bin/opencode` (the same location as the standalone installer) and sets up your `PATH`.

Open a **new terminal** afterward so `PATH` picks it up, then verify:

```
opencode --version   # should report v2.x
```

Pick **one**:

```
# curl (recommended)
curl -fsSL https://opencode.ai/v2/install | bash

# or Homebrew
brew install anomalyco/tap/opencode-v2

# or npm
npm install -g @opencode/cli
```

Windows package managers are not officially supported — use **npm** or a **standalone binary**.

```
# npm (requires Node.js installed)
npm install -g @opencode/cli
```

Or download a standalone binary and add it to your `PATH`:

OpenCode reads its **global** config from a file named `opencode.json` (or `opencode.jsonc`) inside the `opencode` config directory:

| OS | Config file location | 
|---|---|
| **macOS** | `~/.config/opencode/opencode.json` | 
| **Windows** | `%USERPROFILE%\.config\opencode\opencode.json`(that's `C:\Users\<You>\.config\opencode\opencode.json` ) | 

Save [`opencode-relax-beta.jsonc`](https://gist.github.com/mpvii/43c9acb469a259e92c5eb90f2ff0aeda#file-opencode-relax-beta-jsonc) to that path **as `opencode.json`**.

```
{
  "$schema": "https://opencode.ai/config.json",
  "model": "relax-beta/DeepSeek-V4-Pro",
  "providers": {
    "relax-beta": {
      "name": "Relax AI (Beta)",
      "package": "@opencode/ai/providers/openai-compatible",
      "settings": {
        "baseURL": "https://api.beta.relax.ai/v1"
      },
      "models": {
        "DeepSeek-V4-Pro": {
          "name": "DeepSeek V4 Pro"
        },
        "DeepSeek-V41-Flash": {
          "name": "DeepSeek V41 Flash"
        }
      }
    }
  }
}
```

Both `opencode.json` and `opencode.jsonc` are valid. To use a different directory, set the `OPENCODE_CONFIG_DIR` environment variable. Run `opencode debug paths` to print the config directory OpenCode is actually using.

Instead of exporting a key in your shell, store it **once** with the CLI. OpenCode keeps it in its local database and reads it on every request — nothing depends on environment variables.

⚠️ **Workshop key — temporary.** Use this key for the workshop:

```
rak_8aa54e52e1a2b0bf8bae412c556b10f8498759ab1953339616f5fdca0e27d2ad
```

It is a **temporary key** and will be **revoked later this week**.

```
opencode auth login relax-beta --method key
```

Paste the workshop key above when prompted. Verify it's stored:

```
opencode auth list
```

`relax-beta` should show `API key  stored`.

**Desktop-app users:** you can do the same from the command palette — run `/connect`, choose **Relax AI (Beta)**, and paste the key.

1. Reload the config (run `opencode reload` ) or quit and reopen the desktop app — config changes are read on reload/restart, while saved accounts apply immediately.
2. Open the model picker (`/models` ) — you should see**DeepSeek V4 Pro** and**DeepSeek V41 Flash** from**Relax AI (Beta)** .

That's it.
