N·04Integration guides
OpenCode
An open-source coding assistant with a desktop app and a command-line version. Both read the same settings file, opencode.json, so writing it once covers both.
The three things this tool needs
- Address
https://api.xylemnode.com/v1- Key
sk-your-key- Model name
gpt-6.2-astra
OpenCode's address must end in /v1.
Pick this if you'd rather not touch a terminal. OpenCode Desktop works as soon as it's installed; connecting it to XylemNode only takes one settings file on your computer.
- 01
Install the desktop app
- Click "Download OpenCode Desktop" above and pick your system under OpenCode Desktop: on Windows usually x64; on a Mac, Apple silicon or Intel; on Linux, .deb or .rpm.
- Open it once after installing, then close it. That creates the folder the settings go in.
You should seeOpenCode opens normally.
- 02
Open the settings folder
- Windows: press Win + R, paste the Windows line from the table and press Enter.
- Mac: in Finder press Shift + Command + G, paste the macOS line and press Enter.
- Windows
%USERPROFILE%\.config\opencode- macOS / Linux
~/.config/opencode
You should seeA folder called opencode is open.
- 03
Create opencode.json and paste the settings
- In Notepad (TextEdit on a Mac), start a new file and paste the whole block below.
- Replace sk-your-key with your key.
- Save it in that folder as opencode.json.
json { "$schema": "https://opencode.ai/config.json", "model": "xylemnode/gpt-6.2-astra", "provider": { "xylemnode": { "npm": "@ai-sdk/openai-compatible", "name": "XylemNode", "options": { "baseURL": "https://api.xylemnode.com/v1", "apiKey": "sk-your-key" }, "models": { "gpt-6.2-astra": { "name": "GPT-6.2 Astra" } } } } }You should seeThe folder has an opencode.json, with no extra .txt on the end.
Why, and what to do if it goes wrong
In Windows Notepad's "Save as", set "Save as type" to "All files" and the encoding to UTF-8, or it saves as opencode.json.txt. In Mac TextEdit, choose Format → Make Plain Text first. The model on the third line is what new sessions use; the baseURL line is the address and needs /v1.
- 04
Pick the model and send a test message
- Reopen OpenCode, add a project (any folder will do) and start a session.
- Click the model button above the input box and choose GPT-6.2 Astra under XylemNode.
- Send "Hi, reply with OK only".
You should seeYou get a reply.
Why, and what to do if it goes wrong
Until the setup is right, OpenCode suggests its own free models; make sure you don't pick one of those.
- 01
Open a terminal and install OpenCode
On Windows, search the Start menu for "PowerShell"; on a Mac, open Terminal. Paste one of the install commands below and press Enter.
terminal # Official script (macOS / Linux / WSL)
curl -fsSL https://opencode.ai/install | bash# Or npm (all platforms, needs Node.js)
npm install -g opencode-aiYou should seeThe install finishes without red error text.
Why, and what to do if it goes wrong
These install the 1.x line, still maintained; the desktop app is OpenCode 2, and both read the settings below. On Windows the command-line version works better inside WSL, where paths follow Linux.
- 02
Check that it installed
terminal opencode --versionYou should seeIt prints a version number.
- 03
Create opencode.json and paste the settings
In Notepad, create opencode.json at the location in the table (make the folder first if needed), paste the whole block, replace sk-your-key with your key, and save.
- Windows
%USERPROFILE%\.config\opencode\opencode.json- macOS / Linux
~/.config/opencode/opencode.json
json { "$schema": "https://opencode.ai/config.json", "model": "xylemnode/gpt-6.2-astra", "provider": { "xylemnode": { "npm": "@ai-sdk/openai-compatible", "name": "XylemNode", "options": { "baseURL": "https://api.xylemnode.com/v1", "apiKey": "sk-your-key" }, "models": { "gpt-6.2-astra": { "name": "GPT-6.2 Astra" } } } } }You should seeopencode.json is saved.
Why, and what to do if it goes wrong
This is the same file the desktop app uses, so one copy serves both. For a single project only, put opencode.json in that project's root folder. To keep the key out of the file, delete the apiKey line (and the comma at the end of the line above it) and store the key with opencode auth login instead: choose Other and enter xylemnode as the provider id.
- 04
Start it, pick the model and send a test message
Run opencode, type /models to open the model list, choose gpt-6.2-astra under XylemNode, then send "Hi, reply with OK only".
terminal opencode# Then, inside it
/modelsYou should seeYou get a reply.
Common questions
The provider is configured in OpenCode but its models never appear, or you get ProviderModelNotFoundError
Usually the provider block has npm but no models. There is a confirmed behaviour in the repository: a provider-level npm field is silently ignored unless models is configured as well — nothing errors, the provider simply does not take effect. So list the model ids you intend to use under models. And put the key where OpenCode reads it: options.apiKey in opencode.json, or auth.json via opencode auth login. Either one is enough; with neither, authentication fails.