OpenCode
Install and configure OpenCode CLI, Desktop, and Web.
Prerequisites
You need Node.js (npm is included).
1. Install
Install OpenCode CLI on Windows, macOS, or Linux:
npm install --global opencode-aiFor a standalone graphical client, install the Windows, macOS, or Linux desktop build from the official OpenCode download page. The CLI can also start a local Web interface with opencode web.
2. Configure in Desktop
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.
Windows
macOS
3. Configure with a file
OpenCode CLI, Desktop, and Web can also share the same 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": "sk-xxxxx-xxx"
},
"models": {
"YOUR_MODEL": {
"name": "YOUR_MODEL"
}
}
}
},
"model": "getrun/YOUR_MODEL"
}Replace sk-xxxxx-xxx and both YOUR_MODEL values. If a configuration already exists, merge provider.getrun and model.
Windows
$openCodeDir = Join-Path $HOME ".config\opencode"
New-Item -ItemType Directory -Force -Path $openCodeDir | Out-Null
notepad (Join-Path $openCodeDir "opencode.json")macOS / Linux
OPENCODE_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/opencode"
mkdir -p "$OPENCODE_DIR"
${EDITOR:-vi} "$OPENCODE_DIR/opencode.json"4. Use and confirm a reply
Run from the CLI:
opencode run --model getrun/YOUR_MODEL "Reply only with OK"Start the Web interface when needed:
opencode webIn Desktop or Web, create a session, select YOUR_MODEL, and send “Reply only with OK”. The setup is complete when the reply is OK.