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.

  1. 01

    Install the desktop app

    1. 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.
    2. Open it once after installing, then close it. That creates the folder the settings go in.

    You should seeOpenCode opens normally.

  2. 02

    Open the settings folder

    1. Windows: press Win + R, paste the Windows line from the table and press Enter.
    2. 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.

  3. 03

    Create opencode.json and paste the settings

    1. In Notepad (TextEdit on a Mac), start a new file and paste the whole block below.
    2. Replace sk-your-key with your key.
    3. 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.

  4. 04

    Pick the model and send a test message

    1. Reopen OpenCode, add a project (any folder will do) and start a session.
    2. Click the model button above the input box and choose GPT-6.2 Astra under XylemNode.
    3. 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.

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.