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.
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:
- From the app menu, choose Install CLI…
- 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 -fsSL https://opencode.ai/v2/install | bash
brew install anomalyco/tap/opencode-v2
npm install -g @opencode/cli
Windows package managers are not officially supported — use npm or a standalone binary.
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 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.
- 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. - Open the model picker (
/models) — you should seeDeepSeek V4 Pro andDeepSeek V41 Flash fromRelax AI (Beta) .
That's it.