Mahdi Rahimi · Societal Analytics Lab · Vrije Universiteit Amsterdam · November 2026
Summary. This tutorial explains how researchers and students at VU Amsterdam can run coding agents on Nebula, the university’s own large language model (LLM) service, instead of on commercial AI services. It defines what a coding agent is, explains where data goes when you use one, and gives step-by-step instructions for two agents, opencode and Claude Code, on Ubuntu, macOS and Windows.
Contents
- 1. Introduction
- 2. Data protection and security
- 3. Prerequisites
- 4. Setting up opencode
- 5. Setting up Claude Code
- 6. Choosing a model and working well
- 7. Troubleshooting
- 8. References
1. Introduction
1.1 What is a coding agent?
A coding agent is a program that uses a large language model to carry out software tasks on your computer, rather than only answering questions about them. You describe a goal in plain language, for example “find why clean_data.py drops rows with missing dates and fix it”. The agent then works in a loop:
- Plan. The model decides what to do next.
- Act. It calls a tool: read a file, search the project, edit a file, or run a command such as a test or a script.
- Observe. The result of that tool (file contents, command output, an error) is sent back to the model.
- Repeat until the task is done or the agent needs your decision.
Three properties distinguish a coding agent from related tools:
| Tool type | What it does | Example |
|---|---|---|
| Chat assistant | Answers in text; you copy code in and out yourself | The Nebula web chat |
| Code completion | Suggests the next lines while you type in an editor | Editor autocomplete |
| Coding agent | Reads your files, changes them and runs commands itself, in several steps, with you approving actions | opencode, Claude Code |
Two consequences follow, and the rest of this tutorial is built around them:
- The agent sends your files to the model. Everything it reads, including data files and command output, becomes part of the request. Which model you choose therefore decides where your data goes (Section 2).
- The agent needs a capable model. It must follow instructions over many steps, call tools in the correct format and keep a long history in view. Small models fail at this (Section 6).
1.2 Nebula
Nebula is VU’s LLM service, run by the Network Institute. Its user documentation is at nebula.cs.vu.nl, and the Pro server, which this tutorial uses, is at pro.nebula.cs.vu.nl. It is a version of Open WebUI with a chat website and an API (source code, API examples). The API offers two formats, which is why it works with both agents in this tutorial:
| API format | Address | Used by |
|---|---|---|
| OpenAI-compatible | https://pro.nebula.cs.vu.nl/api (for example /api/chat/completions, /api/models) |
opencode |
| Anthropic Messages | https://pro.nebula.cs.vu.nl/api/v1/messages |
Claude Code |
1.3 The two agents covered
| opencode | Claude Code | |
|---|---|---|
| Made by | Open-source project (opencode.ai) | Anthropic |
| Designed for | Any model, from any provider | Anthropic’s Claude models; other models through a custom address |
| Connects to Nebula through | The OpenAI-compatible API | The Anthropic Messages API |
| Recommendation | Start here | Try it if you already know Claude Code |
1.4 Platforms
Every step has instructions for Ubuntu, macOS and Windows:
| Platform | How commands are given |
|---|---|
| Ubuntu (and other Linux) | bash commands |
| macOS | The same commands as Ubuntu; differences are marked macOS |
| Windows | PowerShell versions of the commands. If you use WSL (Ubuntu inside Windows), follow the Ubuntu steps instead |
2. Data protection and security
2.1 Where your data goes
Where a request goes depends only on the model you pick, not on the agent:
| Model you pick | Runs on | Your data |
|---|---|---|
FAST.* (Nebula) |
VU hardware | Stays at VU |
SURF.* (Nebula) |
SURF, the Dutch academic computing cooperative | Leaves VU, stays within Dutch academic infrastructure |
| Anything else (“Big Pickle”, Nemotron and other free models in opencode, providers added with Connect: OpenAI, Anthropic and so on, or Claude Code logged in to an Anthropic account) | Outside companies | Leaves VU, under that company’s terms |
Only the Nebula models are covered by VU agreements.
2.2 Rules of thumb
- Personal data, unpublished research data and confidential code go only to Nebula models. If in doubt, use
FAST.*. - An agent sends the files it reads to the model. Start it inside the project folder, not in your home folder.
- Check your faculty’s data-management rules before using any model on sensitive data.
2.3 Handling your API key
Your API key works like a password: anyone who has it can use Nebula as you.
- Never paste it into a chat, an email, a screenshot or a Git repository.
- The setup scripts in this tutorial ask for the key without showing it on screen and store it in a file only you can read.
- If it leaks, delete it in Nebula (Settings → Account → API Keys), create a new one, and rerun the setup script.
3. Prerequisites
3.1 A Nebula API key
- Log in to the Pro server at pro.nebula.cs.vu.nl. Keys are tied to the server they were made on, so a key from the old address (
nebula.cs.vu.nl, before 1 December 2026) may not work; create a new one here. - Click your name or picture (bottom left), then Settings.
- Open Account, find API Keys, and click to create a key.
- Copy the key. It starts with
sk-. Keep it in your password manager.
No API Keys section? API access has to be switched on for your account. Ask the Nebula administrators at the Network Institute to enable it.
Test the key and list the models you can use. Replace sk-... with your key. This puts the key in your shell history; the setup scripts later avoid that.
Ubuntu and macOS:
curl -s -H "Authorization: Bearer sk-..." https://pro.nebula.cs.vu.nl/api/models | python3 -c 'import json,sys; d=json.load(sys.stdin); print("\n".join(sorted(m["id"] for m in d["data"])) if "data" in d else d)'
Windows (PowerShell):
(Invoke-RestMethod https://pro.nebula.cs.vu.nl/api/models -Headers @{ Authorization = "Bearer sk-..." }).data.id | Sort-Object -Unique
You should see model IDs such as FAST.gpt-oss:120b and SURF.Qwen3.8-27B-FP8. Your session has expired or the token is invalid, Not authenticated or 401 (Unauthorized) means the key is wrong, incomplete or not enabled. On macOS, if the command asks you to install “command line developer tools”, cancel; you can see the same list later with opencode models nebula (Section 4.4).
3.2 A terminal
| Platform | Terminal to use |
|---|---|
| Ubuntu | Terminal |
| macOS | Terminal (Applications → Utilities). Its default shell is zsh; the bash commands here work in it |
| Windows | PowerShell inside Windows Terminal (the default on Windows 11; on Windows 10 install it from the Microsoft Store). Agents’ full-screen interfaces work best there |
3.3 Node.js 18 or newer
opencode is installed with npm, which comes with Node.js. The scripts in this tutorial also use Node to check files. Claude Code can be installed without Node (Section 4.1).
Ubuntu. Install Node with nvm. If you installed Node with apt, npm install -g will fail with a permission error; switch to nvm rather than using sudo npm.
macOS. Install Node with nvm or, if you use Homebrew, with brew install node. The installer from nodejs.org often causes EACCES permission errors with npm install -g; use nvm or Homebrew instead rather than sudo npm.
Windows. Install Node.js in a way that stays available in every new terminal. Use one of these:
- the Windows Installer (.msi) for the LTS version from nodejs.org/download (scroll to the installer buttons and accept the defaults), or
- in PowerShell:
winget install OpenJS.NodeJS.LTS
Then close PowerShell and open a new window. Avoid the command-line instructions at the top of the nodejs.org download page that use fnm or another version manager: they set up Node only for the current window, so node is “not recognized” again after you reopen the terminal, unless you also add fnm to your PowerShell profile (see Section 7.1). If you already installed Node that way, simply install the .msi as well. If PowerShell says npm.ps1 cannot be loaded because running scripts is disabled on this system, run this once:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
Windows with WSL instead: if you already use WSL, open the Ubuntu app and follow the Ubuntu steps throughout. The agent then lives inside Linux and works on files in your Linux home folder; its configuration is separate from a native Windows install.
3.4 Check your setup before continuing
Open a new terminal window (a window opened before you installed Node.js doesn’t know about it yet) and run:
node --version
npm --version
Both must print a version number, for example v26.13.1 and 11.20.0, and node must be version 18 or newer. After you install opencode (Section 4.1) or Claude Code (Section 5.1), check those the same way with opencode --version or claude --version.
| What you see | What to do |
|---|---|
node : The term 'node' is not recognized (Windows) or command not found: node (macOS, Ubuntu) |
Node.js is not installed, or the window was opened before you installed it. Close the terminal, open a new one and try again. If it still fails, install Node.js as described above |
npm.ps1 cannot be loaded because running scripts is disabled or the same message for opencode.ps1 (Windows) |
Run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned once, then try again |
node works but opencode or claude is not recognised |
The install in Section 4.1 or 5.1 didn’t finish, or (Windows) npm’s program folder is not on your PATH. Run the install again and read its last lines for errors, then open a new terminal. On Windows, see the opencode rows in Section 7.1 |
| A Node.js version below 18 | Install a newer LTS version as described above |
Don’t continue with the configuration steps until these checks pass.
4. Setting up opencode
4.1 Install
This tutorial uses the npm package opencode-ai (opencode version 1; 1.19.6 at the time of writing). The command is the same on all three platforms:
npm install -g --allow-scripts=opencode-ai opencode-ai
opencode --version
--allow-scripts=opencode-ai lets the package run its setup step, which puts the real opencode program in place. Newer npm versions skip that step unless you allow it, and opencode then doesn’t start (on Ubuntu and macOS it prints Error: opencode-ai's postinstall script was not run). Older npm versions ignore the option.
opencode --version must print a version number before you continue. If it doesn’t, open a new terminal and try again, and see the table in Section 3.4.
A note on opencode 2. opencode.ai now also offers version 2, installed with curl -fsSL https://opencode.ai/v2/install | bash, plus desktop downloads. Its migration page says version 2 still reads the version 1 config format used here, so the configuration below works for both. Don’t install both side by side: remove the npm version first (npm uninstall -g opencode-ai) if you switch. The commands in this tutorial are those of version 1; where version 2 needs a different command, Section 4.4 says so. opencode --version shows which version you have.
4.2 Configure
opencode reads its settings from ~/.config/opencode/opencode.json on all three platforms. On Windows, ~ is your user folder, so the file is C:\Users\<you>\.config\opencode\opencode.json. You add Nebula there as a provider called nebula:
| Field | Value | Why |
|---|---|---|
npm |
@ai-sdk/openai-compatible |
Nebula speaks the OpenAI API format |
options.baseURL |
https://pro.nebula.cs.vu.nl/api |
Exactly this. No /v1 at the end, no trailing slash |
options.apiKey |
your sk-... key |
See “Where to keep the key” below |
models |
one entry per model ID | IDs must match Nebula’s list exactly, including case and : |
model (top level) |
nebula/<model ID> |
Optional: the model opencode starts with |
Editing JSON by hand is easy to break: one missing comma or quote and opencode silently ignores the whole file. The scripts below ask for your key without showing it, write the file, make sure only you can read it, and check it. Each overwrites any earlier opencode.json, so make a copy first if you had other settings.
Ubuntu and macOS. Paste into a terminal as one block. It works in bash and zsh.
(
printf "Paste your Nebula API key, then press Enter: "; read -s NEBULA_KEY; echo
case "$NEBULA_KEY" in sk-*) ;; *) echo "No valid Nebula key (it must start with sk-). Nothing was changed. Paste the block again and paste your key at the prompt."; exit 1 ;; esac
mkdir -p ~/.config/opencode
cat > ~/.config/opencode/opencode.json <<EOF
{
"\$schema": "https://opencode.ai/config.json",
"model": "nebula/SURF.Qwen3.8-27B-FP8",
"provider": {
"nebula": {
"npm": "@ai-sdk/openai-compatible",
"name": "Nebula (VU)",
"options": {
"baseURL": "https://pro.nebula.cs.vu.nl/api",
"apiKey": "$NEBULA_KEY"
},
"models": {
"SURF.Qwen3.8-27B-FP8": { "name": "Qwen3.8 27B (SURF)" },
"FAST.gpt-oss:120b": { "name": "gpt-oss 120B (VU)" }
}
}
}
}
EOF
chmod 600 ~/.config/opencode/opencode.json
unset NEBULA_KEY
python3 -m json.tool ~/.config/opencode/opencode.json > /dev/null && echo OK
)
You should see OK. If you see an error such as Expecting ',' delimiter: line 12 column 5, run the script again rather than fixing the file by hand. Two details matter: \$schema has a backslash so the shell doesn’t treat it as a variable, and $NEBULA_KEY has none so your key is filled in.
macOS: if the last line asks you to install “command line developer tools”, cancel and check the file with Node instead:
node -e "JSON.parse(require('fs').readFileSync(process.argv[1],'utf8')); console.log('OK')" ~/.config/opencode/opencode.json
Windows. First make sure the checks in Section 3.4 pass. This step takes two pastes, because PowerShell would otherwise read the lines after the key prompt as your key.
First, paste this line exactly as shown and press Enter. Don’t put your key into the line itself. PowerShell then shows the prompt Paste your Nebula API key, then press Enter:; paste your key there and press Enter. The key appears as asterisks.
$secure = Read-Host "Paste your Nebula API key, then press Enter" -AsSecureString
Then paste the following block. If Windows Terminal warns that the text contains several lines, choose Paste anyway. If the key is missing or doesn’t start with sk- (for example because you pasted this block a second time without the first line), the block stops with a red message and changes nothing.
& {
$key = if ($secure) { [Runtime.InteropServices.Marshal]::PtrToStringBSTR([Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure)).Trim() } else { "" }
if (-not $key.StartsWith("sk-")) { Write-Host "No valid Nebula key: read $($key.Length) characters, but a key must start with sk-. Nothing was changed. Run the first line again, paste your key at the prompt, then paste this block again." -ForegroundColor Red; return }
$dir = Join-Path $HOME ".config\opencode"
New-Item -ItemType Directory -Force -Path $dir | Out-Null
$config = [ordered]@{
'$schema' = "https://opencode.ai/config.json"
model = "nebula/SURF.Qwen3.8-27B-FP8"
provider = @{
nebula = [ordered]@{
npm = "@ai-sdk/openai-compatible"
name = "Nebula (VU)"
options = [ordered]@{
baseURL = "https://pro.nebula.cs.vu.nl/api"
apiKey = $key
}
models = [ordered]@{
"SURF.Qwen3.8-27B-FP8" = @{ name = "Qwen3.8 27B (SURF)" }
"FAST.gpt-oss:120b" = @{ name = "gpt-oss 120B (VU)" }
}
}
}
}
$file = Join-Path $dir "opencode.json"
[System.IO.File]::WriteAllText($file, ($config | ConvertTo-Json -Depth 10))
try { Get-Content $file -Raw | ConvertFrom-Json | Out-Null; Write-Host "OK: config written to $file" -ForegroundColor Green }
catch { Write-Host "The file $file is not valid JSON. Run both steps again." -ForegroundColor Red }
}
Remove-Variable secure -ErrorAction SilentlyContinue
You should see a green OK: config written to .... The script writes UTF-8 without a byte-order mark, which opencode expects. Files in your user folder are readable only by you and administrators, so there is no chmod step.
Where to keep the key
There are three options. The first is recommended.
- In the file (recommended). What the scripts above do. It is the most reliable: it works in the terminal and in the desktop app. Never commit this file to Git or share it.
- In an environment variable. Use
"apiKey": "{env:NEBULA_API_KEY}"in the config, then set the variable:- Ubuntu: add
export NEBULA_API_KEY=sk-...to~/.bashrc, then open a new terminal. - macOS: the same line in
~/.zshrc. - Windows: run
[Environment]::SetEnvironmentVariable("NEBULA_API_KEY", "sk-...", "User")once, then open a new PowerShell window.
Caveat: if the variable isn’t set where opencode starts, opencode silently uses an empty key and you get
Not authenticated. On Ubuntu and macOS, desktop apps started from the menu or Dock do not read~/.bashrcor~/.zshrc, so this often fails there. On Windows, apps pick up user variables after you sign out and in again. - Ubuntu: add
- In a separate key file. Save only the key in
~/.config/opencode/nebula.key(on Ubuntu and macOS,chmod 600it) and use"apiKey": "{file:~/.config/opencode/nebula.key}". This keeps the key out of the main config, which helps if you share or back up the config.
4.3 Add Nebula’s models
opencode only shows the Nebula models listed in your config. These scripts ask Nebula for every model you can use and write them all in. They keep names you already gave, read the key from your config (or from NEBULA_API_KEY or the key file if you used option 2 or 3), and never print the key. Run one again whenever Nebula adds models. Section 6.1 explains which model to choose.
Ubuntu and macOS:
python3 - <<'PY'
import json, os, urllib.request
path = os.path.expanduser("~/.config/opencode/opencode.json")
with open(path) as f:
cfg = json.load(f)
nebula = cfg["provider"]["nebula"]
key = nebula["options"]["apiKey"]
if key.startswith("{env:"):
key = os.environ.get(key[5:-1], "")
elif key.startswith("{file:"):
keyfile = os.path.join(os.path.dirname(path), os.path.expanduser(key[6:-1]))
with open(keyfile) as f:
key = f.read().strip()
url = nebula["options"]["baseURL"].rstrip("/") + "/models"
req = urllib.request.Request(url, headers={"Authorization": "Bearer " + key})
data = json.load(urllib.request.urlopen(req, timeout=30))["data"]
ids = sorted({m["id"] for m in data})
old = nebula.get("models", {})
nebula["models"] = {i: old.get(i, {}) for i in ids}
with open(path, "w") as f:
json.dump(cfg, f, indent=2)
print(f"Wrote {len(ids)} models to {path}")
PY
Windows, or macOS without Python: download add-nebula-models.mjs from this site and run it with Node. It does the same thing.
curl.exe -fsSLO https://geo-mahdi.github.io/nebula-coding-agents-tutorial/scripts/add-nebula-models.mjs
node add-nebula-models.mjs
On macOS, write curl instead of curl.exe. Either script reports HTTP 401 if the key is wrong. Afterwards you can delete models you don’t want from the models list.
Optional: context size. opencode summarises long sessions in time when it knows how much text a model accepts. Add a limit to a model entry, then check the file again:
"SURF.Qwen3.8-27B-FP8": { "name": "Qwen3.8 27B (SURF)", "limit": { "context": 262144, "output": 16384 } }
The output value is a cautious guess; Nebula doesn’t publish per-model limits.
4.4 Verify and use
Check that opencode sees Nebula:
opencode models nebula
You should see lines such as nebula/SURF.Qwen3.8-27B-FP8.
opencode version 2 (opencode --version starts with 2) answers Unexpected positional argument: "nebula" to that command. Version 2 also runs a background service that keeps using your old settings until you restart it, so after any change to the config run:
opencode service restart
opencode models | grep -i nebula
On Windows, the second line is opencode models | Select-String nebula. Then start opencode inside the folder you want to work on (on Windows, cd $HOME\projects\my-analysis):
cd ~/projects/my-analysis
opencode
| To do this | Type or press |
|---|---|
| Pick a model | /models or Ctrl+P, then choose one under Nebula (VU) |
| Ask a question or give a task | Just type, for example “Explain what clean_data.py does” |
| Switch between planning and making changes | Tab (the Plan agent only reads and suggests; Build edits files and runs commands) |
| Start a fresh conversation | /new |
| Quit | /exit or Ctrl+C |
The keys are the same on all platforms; use Ctrl, not Cmd, on macOS too.
opencode-specific cautions:
- Don’t use Connect to add OpenAI, Anthropic or other providers, and don’t pick the free models listed outside the Nebula group, for anything sensitive. Those go to outside companies.
- Don’t use
/share: it uploads the conversation to opencode’s servers and makes a public link to it.
4.5 The desktop app
opencode also has a desktop app. It uses the same config format, but where it looks for the file depends on how you installed it.
| How you installed it | Config file it reads |
|---|---|
Ubuntu .deb from opencode.ai |
~/.config/opencode/opencode.json (the same file as the terminal) |
Ubuntu Flatpak (ai.opencode.opencode) |
~/.var/app/ai.opencode.opencode/config/opencode/opencode.json |
| macOS and Windows | The same ~/.config/opencode file (Windows: C:\Users\<you>\.config\opencode); if Nebula doesn’t appear, use the Custom provider screen below |
For the Flatpak, copy your working config into its folder, and copy it again whenever you change the original:
mkdir -p ~/.var/app/ai.opencode.opencode/config/opencode
cp ~/.config/opencode/opencode.json ~/.var/app/ai.opencode.opencode/config/opencode/
chmod 600 ~/.var/app/ai.opencode.opencode/config/opencode/opencode.json
Keep the key in the file (option 1 above); on Ubuntu and macOS the desktop app doesn’t see variables set in ~/.bashrc or ~/.zshrc.
Without a config file: the app has a Custom provider screen in its provider settings. Enter Provider ID nebula, Base URL https://pro.nebula.cs.vu.nl/api and your API key, then add the model IDs from Section 6.1. Don’t use the other providers listed on that screen.
Don’t run the desktop app and the terminal version at the same time (see the port error in Section 7).
5. Setting up Claude Code
Claude Code talks to Nebula through its Anthropic-compatible endpoint, https://pro.nebula.cs.vu.nl/api/v1/messages. It sends your key as Authorization: Bearer and uses the Nebula model IDs you configure. Run the check in Section 5.3 before you start, to confirm that the endpoint is available for your account.
5.1 Install
Claude Code has its own installer, which doesn’t need Node.js.
Ubuntu and macOS:
curl -fsSL https://claude.ai/install.sh | bash
claude --version
Windows (PowerShell). Installing Git for Windows first is recommended but optional: it provides Git Bash, which Claude Code’s Bash tool needs. Without it, Claude Code runs commands in PowerShell.
irm https://claude.ai/install.ps1 | iex
claude --version
Alternatives on any platform: npm install -g --allow-scripts=@anthropic-ai/claude-code @anthropic-ai/claude-code if you already have Node.js 22 or newer, brew install --cask claude-code on macOS, or winget install Anthropic.ClaudeCode on Windows. If claude is not found afterwards, open a new terminal; claude doctor reports installation problems.
5.2 Configure
Claude Code is pointed at Nebula with environment variables. You can put them in its user settings file, ~/.claude/settings.json (Windows: C:\Users\<you>\.claude\settings.json), so they apply every time you start it.
| Setting | Value | Why |
|---|---|---|
ANTHROPIC_BASE_URL |
https://pro.nebula.cs.vu.nl/api |
No /v1: Claude Code adds /v1/messages itself |
ANTHROPIC_AUTH_TOKEN |
your sk-... key |
Sent as Authorization: Bearer, the format Nebula expects. Use this, not ANTHROPIC_API_KEY |
ANTHROPIC_MODEL |
SURF.Qwen3.8-27B-FP8 |
The main model |
ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL |
the same model ID | Claude Code switches between these three model tiers, and makes small background calls with the Haiku one. Without these, it asks Nebula for Anthropic models that Nebula doesn’t have |
CLAUDE_CODE_SUBAGENT_MODEL |
the same model ID | Model for helper agents Claude Code starts on its own |
CLAUDE_CODE_MAX_CONTEXT_TOKENS |
262144 |
Claude Code doesn’t know Nebula’s models and otherwise assumes a context window of 1 million tokens; this sets the real size of SURF.Qwen3.8-27B-FP8 |
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC |
1 |
Turns off usage statistics, error reports and update checks that Claude Code would otherwise send to outside services |
CLAUDE_CODE_EFFORT_LEVEL |
medium |
Claude Code asks for high effort by default, and for that setting Nebula returns an empty answer with SURF.Qwen3.8-27B-FP8: Claude Code then prints nothing and does nothing. medium avoids this. Don’t choose high or max with /effort |
The scripts below write this file. They overwrite an existing settings.json, keeping a copy as settings.json.bak; if you already had Claude Code settings, merge them back by hand. Because the settings apply to every Claude Code session, Claude Code will then always use Nebula. To go back to Anthropic, delete the file or remove its env block.
Ubuntu and macOS. Paste as one block.
(
printf "Paste your Nebula API key, then press Enter: "; read -s NEBULA_KEY; echo
case "$NEBULA_KEY" in sk-*) ;; *) echo "No valid Nebula key (it must start with sk-). Nothing was changed. Paste the block again and paste your key at the prompt."; exit 1 ;; esac
mkdir -p ~/.claude
[ -f ~/.claude/settings.json ] && cp ~/.claude/settings.json ~/.claude/settings.json.bak
M=SURF.Qwen3.8-27B-FP8
cat > ~/.claude/settings.json <<EOF
{
"env": {
"ANTHROPIC_BASE_URL": "https://pro.nebula.cs.vu.nl/api",
"ANTHROPIC_AUTH_TOKEN": "$NEBULA_KEY",
"ANTHROPIC_MODEL": "$M",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "$M",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "$M",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "$M",
"CLAUDE_CODE_SUBAGENT_MODEL": "$M",
"CLAUDE_CODE_MAX_CONTEXT_TOKENS": "262144",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_EFFORT_LEVEL": "medium"
}
}
EOF
chmod 600 ~/.claude/settings.json
unset NEBULA_KEY
node -e "JSON.parse(require('fs').readFileSync(process.argv[1],'utf8')); console.log('OK')" ~/.claude/settings.json
)
Windows. First make sure the checks in Section 3.4 pass. This step takes two pastes, because PowerShell would otherwise read the lines after the key prompt as your key.
First, paste this line exactly as shown and press Enter. Don’t put your key into the line itself. PowerShell then shows the prompt Paste your Nebula API key, then press Enter:; paste your key there and press Enter. The key appears as asterisks.
$secure = Read-Host "Paste your Nebula API key, then press Enter" -AsSecureString
Then paste the following block. If Windows Terminal warns that the text contains several lines, choose Paste anyway. If the key is missing or doesn’t start with sk- (for example because you pasted this block a second time without the first line), the block stops with a red message and changes nothing.
& {
$key = if ($secure) { [Runtime.InteropServices.Marshal]::PtrToStringBSTR([Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure)).Trim() } else { "" }
if (-not $key.StartsWith("sk-")) { Write-Host "No valid Nebula key: read $($key.Length) characters, but a key must start with sk-. Nothing was changed. Run the first line again, paste your key at the prompt, then paste this block again." -ForegroundColor Red; return }
$dir = Join-Path $HOME ".claude"
New-Item -ItemType Directory -Force -Path $dir | Out-Null
$file = Join-Path $dir "settings.json"
if (Test-Path $file) { Copy-Item $file "$file.bak" -Force }
$m = "SURF.Qwen3.8-27B-FP8"
$settings = @{
env = [ordered]@{
ANTHROPIC_BASE_URL = "https://pro.nebula.cs.vu.nl/api"
ANTHROPIC_AUTH_TOKEN = $key
ANTHROPIC_MODEL = $m
ANTHROPIC_DEFAULT_OPUS_MODEL = $m
ANTHROPIC_DEFAULT_SONNET_MODEL = $m
ANTHROPIC_DEFAULT_HAIKU_MODEL = $m
CLAUDE_CODE_SUBAGENT_MODEL = $m
CLAUDE_CODE_MAX_CONTEXT_TOKENS = "262144"
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
CLAUDE_CODE_EFFORT_LEVEL = "medium"
}
}
[System.IO.File]::WriteAllText($file, ($settings | ConvertTo-Json -Depth 5))
try { Get-Content $file -Raw | ConvertFrom-Json | Out-Null; Write-Host "OK: settings written to $file" -ForegroundColor Green }
catch { Write-Host "The file $file is not valid JSON. Run both steps again." -ForegroundColor Red }
}
Remove-Variable secure -ErrorAction SilentlyContinue
You should see OK. Without Node on Ubuntu or macOS, replace the last line with python3 -m json.tool ~/.claude/settings.json > /dev/null && echo OK.
Trying it out for one session only. Instead of the settings file, you can set the same variables in a single terminal; they disappear when you close it.
Ubuntu and macOS:
(
printf "Nebula key: "; read -s ANTHROPIC_AUTH_TOKEN; echo
case "$ANTHROPIC_AUTH_TOKEN" in sk-*) ;; *) echo "No valid Nebula key (it must start with sk-). Nothing was changed. Paste the block again and paste your key at the prompt."; exit 1 ;; esac
export ANTHROPIC_AUTH_TOKEN
export ANTHROPIC_BASE_URL=https://pro.nebula.cs.vu.nl/api
export ANTHROPIC_MODEL=SURF.Qwen3.8-27B-FP8
export ANTHROPIC_DEFAULT_OPUS_MODEL=$ANTHROPIC_MODEL ANTHROPIC_DEFAULT_SONNET_MODEL=$ANTHROPIC_MODEL ANTHROPIC_DEFAULT_HAIKU_MODEL=$ANTHROPIC_MODEL CLAUDE_CODE_SUBAGENT_MODEL=$ANTHROPIC_MODEL
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=262144 CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 CLAUDE_CODE_EFFORT_LEVEL=medium
claude
)
Windows (PowerShell):
First paste this line exactly as shown and press Enter, then paste your key at the Nebula key: prompt (it appears as asterisks):
$env:ANTHROPIC_AUTH_TOKEN = [Runtime.InteropServices.Marshal]::PtrToStringBSTR([Runtime.InteropServices.Marshal]::SecureStringToBSTR((Read-Host "Nebula key" -AsSecureString))).Trim()
Then paste the rest:
& {
if (-not "$env:ANTHROPIC_AUTH_TOKEN".StartsWith("sk-")) { Write-Host "No valid Nebula key (it must start with sk-). Run the first line again and paste your key at the prompt." -ForegroundColor Red; return }
$env:ANTHROPIC_BASE_URL = "https://pro.nebula.cs.vu.nl/api"
$env:ANTHROPIC_MODEL = "SURF.Qwen3.8-27B-FP8"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL = $env:ANTHROPIC_MODEL
$env:ANTHROPIC_DEFAULT_SONNET_MODEL = $env:ANTHROPIC_MODEL
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = $env:ANTHROPIC_MODEL
$env:CLAUDE_CODE_SUBAGENT_MODEL = $env:ANTHROPIC_MODEL
$env:CLAUDE_CODE_MAX_CONTEXT_TOKENS = "262144"
$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
$env:CLAUDE_CODE_EFFORT_LEVEL = "medium"
claude
}
To use a different Nebula model, replace SURF.Qwen3.8-27B-FP8 everywhere and set CLAUDE_CODE_MAX_CONTEXT_TOKENS to that model’s context size, if known.
5.3 Verify
First, check that Nebula’s Anthropic endpoint answers, before involving Claude Code. Replace sk-... with your key.
Ubuntu and macOS:
curl -s https://pro.nebula.cs.vu.nl/api/v1/messages \
-H "Authorization: Bearer sk-..." \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"SURF.Qwen3.8-27B-FP8","max_tokens":50,"messages":[{"role":"user","content":"Say hello"}]}'
Windows (PowerShell):
$body = '{"model":"SURF.Qwen3.8-27B-FP8","max_tokens":50,"messages":[{"role":"user","content":"Say hello"}]}'
Invoke-RestMethod https://pro.nebula.cs.vu.nl/api/v1/messages -Method Post -ContentType "application/json" -Body $body -Headers @{ Authorization = "Bearer sk-..."; "anthropic-version" = "2023-06-01" }
A reply containing "type":"message" and some text means the endpoint works. A 404 means this Nebula version doesn’t offer the Anthropic endpoint; in that case Claude Code won’t work with Nebula, and you should use opencode.
Then check Claude Code. Go to a test folder and run a one-off prompt:
claude -p "Reply with the word OK"
It should print OK. A line starting with [claude-code:unrecognized_model] above it is harmless: it only notes that Claude Code doesn’t know the Nebula model’s name. If nothing else is printed, see the “prints nothing” row in Section 7.3.
Finally start claude interactively and type /status. It should list https://pro.nebula.cs.vu.nl/api as the API address and ANTHROPIC_AUTH_TOKEN as the source of the key. If Claude Code instead asks you to log in to an Anthropic account, the settings were not picked up: don’t log in for sensitive work, because then requests go to Anthropic, and see Section 7.
5.4 Use
Start Claude Code inside the folder you want to work on (on Windows, cd $HOME\projects\my-analysis):
cd ~/projects/my-analysis
claude
| To do this | Type or press |
|---|---|
| Ask a question or give a task | Just type, for example “Explain what clean_data.py does” |
| Switch between asking before every change, accepting edits, and plan mode (read and suggest only) | Shift+Tab |
| Approve or refuse an action | Answer the prompt Claude Code shows before it edits a file or runs a command |
| Check the address, key source and model | /status |
| Switch model tier | /model (all tiers point to the Nebula model you set) |
| Write a project notes file the agent reads every session | /init (creates CLAUDE.md) |
| Start a fresh conversation | /clear |
| Quit | /exit or Ctrl+C twice |
Limitations to expect:
- Claude Code is built and tuned for Anthropic’s Claude models. With open models it usually works less well than opencode with the same model: more failed tool calls, more need to steer it.
- Features that rely on Anthropic’s own services, such as web search and logging in with an Anthropic account, don’t apply when it uses Nebula.
6. Choosing a model and working well
6.1 Which Nebula model
Both agents need the exact model ID as Nebula lists it. Common ones as of November 2026:
| Model ID | Runs on | Use it for |
|---|---|---|
SURF.Qwen3.8-27B-FP8 |
SURF | Recommended for coding agents. Best tool use and coding of the current models; 262K-token context |
FAST.gpt-oss:120b |
VU | Best choice when data must stay at VU |
SURF.gpt-oss-120b |
SURF | Same model as above, run at SURF |
FAST.gemma4:31b |
VU | General writing and chat; weaker as a coding agent |
Avoid small models (a few billion parameters) and anything marked TEST for coding work. As Section 1.1 explains, an agent needs a model that calls tools reliably and has a long context window; small models loop, stall or ignore files. The list changes, so check the current one with the command in Section 3.1. Watch for : versus - in the IDs, for example FAST.gpt-oss:120b and SURF.gpt-oss-120b.
6.2 Good practice with any coding agent
- Plan first. On unfamiliar code, use the read-only mode (opencode’s Plan agent, Claude Code’s plan mode) before letting the agent change anything.
- Use Git. Commit before you let the agent change things, so you can review with
git diffand undo withgit restore. - Read commands before approving them. The model can be wrong. On Windows the agent usually runs PowerShell or Git Bash commands; check those too.
- Keep the scope small. Start the agent in the project folder only, and give it one clear task at a time.
- Check the results. Run the tests or the analysis yourself. An agent’s summary of what it did is not proof that it worked.
7. Troubleshooting
7.1 Both agents
| What you see | What it means | Fix |
|---|---|---|
Not authenticated, the token is invalid or HTTP 401 |
The agent sent no key or a wrong one | Test the key with the command in Section 3.1. If you used an environment variable, check it in the same terminal; it should print sk-... Ubuntu and macOS: echo ${NEBULA_API_KEY:0:5}. Windows: $env:NEBULA_API_KEY.Substring(0,5) |
model not found or 404 on a model |
The model ID doesn’t match Nebula’s | Copy the ID exactly from Nebula’s list (Section 3.1); for opencode rerun the script in Section 4.3 |
A web page or 404 instead of an API answer, from https://nebula.cs.vu.nl/api |
That was Nebula’s address until 1 December 2026; it now shows the user documentation | Change the address to https://pro.nebula.cs.vu.nl/api in your opencode config and Claude Code settings, or rerun the setup scripts |
URLs end up as .../api/v1/v1/... or .../api/v1/models and fail |
/v1 was added to the base address |
Use https://pro.nebula.cs.vu.nl/api exactly, for both agents |
| Agent loops, stops halfway or ignores tools | The model is too small for agent work | Switch to SURF.Qwen3.8-27B-FP8 or FAST.gpt-oss:120b |
| Very slow replies | Nebula is busy or loading the model | Wait a minute and try again; FAST.* models share VU’s GPUs with other users |
node works right after installing, but is “not recognized” in every new terminal (Windows) |
Node was installed with fnm, the version manager in the nodejs.org command-line instructions, which only sets up the current window | Install the Windows Installer (.msi) from nodejs.org or run winget install OpenJS.NodeJS.LTS, then open a new terminal. To keep fnm instead, add it to your PowerShell profile with the second command below this table |
npm.ps1 cannot be loaded or opencode.ps1 cannot be loaded (Windows) |
PowerShell blocks scripts by default, including the small opencode.ps1 launcher that npm installs |
Run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned once, then open a new terminal |
opencode or claude not recognised (Windows) or command not found (macOS, Ubuntu) |
The terminal was opened before the installation | Open a new terminal window. If it persists, reinstall as in Sections 3.3, 4.1 or 5.1 |
opencode not recognised on Windows, even in a new terminal, although npm install -g finished |
npm puts its programs in C:\Users\<you>\AppData\Roaming\npm (%APPDATA%\npm), and that folder is not on your PATH. The Node.js installer normally adds it |
Check with npm prefix -g and Test-Path "$(npm prefix -g)\opencode.cmd". If that prints True, add the folder to your PATH once with the command below this table, then open a new terminal |
Error: opencode-ai's postinstall script was not run, or opencode doesn’t start right after installing |
npm skipped the package’s setup step | Reinstall with npm install -g --allow-scripts=opencode-ai opencode-ai (Section 4.1) |
| Garbled screen or keys not working (Windows) | The old console window doesn’t support the agent’s interface | Use PowerShell inside Windows Terminal |
| Your key was exposed | Someone else could use Nebula as you | Delete the key in Nebula (Settings → Account → API Keys), create a new one, and rerun the setup script |
Windows commands for the table above. To add npm’s program folder to your PATH (the opencode row), paste this into PowerShell, then open a new terminal:
& {
$bin = "$(npm prefix -g)".Trim()
$path = [Environment]::GetEnvironmentVariable("Path", "User")
if (($path -split ";") -contains $bin) { Write-Host "$bin is already on your PATH. Open a new terminal." -ForegroundColor Green; return }
$new = if ($path) { $path.TrimEnd(";") + ";" + $bin } else { $bin }
[Environment]::SetEnvironmentVariable("Path", $new, "User")
Write-Host "Added $bin to your PATH. Open a new terminal." -ForegroundColor Green
}
To keep using fnm (the node row), add it to your PowerShell profile once, then open a new terminal. The profile is a script, so this also needs the Set-ExecutionPolicy command from Section 3.3:
if (-not (Test-Path $PROFILE)) { New-Item -Force $PROFILE | Out-Null }
Add-Content $PROFILE 'fnm env --use-on-cd --shell powershell | Out-String | Invoke-Expression'
7.2 opencode
| What you see | What it means | Fix |
|---|---|---|
No Nebula models in /models or in opencode models nebula |
The config file is invalid and opencode ignored it, or it’s in the wrong place, or (version 2) the background service still has the old settings | Run the check at the end of the Section 4.2 script. On error, rerun the script. For the Flatpak, check the path in Section 4.5. With version 2, run opencode service restart |
Unexpected positional argument: "nebula" |
You have opencode version 2 | Use the version 2 commands in Section 4.4 |
Expecting ':' delimiter, Expecting ',' delimiter or Unexpected token |
A hand edit broke the JSON | Rerun the Section 4.2 script, then the Section 4.3 script |
Managed service port ... already in use |
The desktop app and the terminal version are both running | Close one of them. If no window is open, end the leftover process. Ubuntu and macOS: pkill -f opencode. Windows: Stop-Process -Name opencode |
7.3 Claude Code
| What you see | What it means | Fix |
|---|---|---|
| Claude Code asks you to log in to Anthropic | It didn’t read your settings | Check that ~/.claude/settings.json exists and passes the check in Section 5.2, then restart claude. Don’t log in for sensitive work |
/status shows an Anthropic address or an Anthropic login instead of Nebula |
Same cause: without ANTHROPIC_AUTH_TOKEN, Claude Code falls back to an earlier Anthropic login |
Fix the settings file and restart claude. To remove the old login as well, run /logout inside Claude Code |
404 on /api/v1/messages |
This Nebula version has no Anthropic endpoint | Use opencode instead |
Claude Code prints nothing, or claude -p returns an empty reply |
Effort is set to high or max, for which Nebula returns empty answers with some models |
Set CLAUDE_CODE_EFFORT_LEVEL to medium as in Section 5.2, and don’t choose high or max with /effort |
Errors about tools, tool_use or the stream stopping mid-answer |
Nebula’s Anthropic endpoint doesn’t fully handle Claude Code’s requests, or the model handles tools poorly | Try SURF.Qwen3.8-27B-FP8; if it persists, use opencode and report it to the Nebula administrators |
doesn't recognize the model ... assumes a context window |
CLAUDE_CODE_MAX_CONTEXT_TOKENS is not set |
Add it as in Section 5.2 |
| Claude Code runs only PowerShell commands, or says Git Bash wasn’t found (Windows) | Git for Windows is missing | Install Git for Windows and open a new terminal |
Still stuck? Ask the Nebula administrators at the Network Institute. Send them the error message, never your key.
8. References
- Nebula: source code and API examples
- opencode: documentation, providers, config, models, migrating from version 1 (read 19 November 2026); opencode-ai on npm (latest 1.19.6, 17 November 2026)
- Claude Code: documentation, including settings and model configuration