Setup Guideline

Full beginner guide · Windows and macOS

Claude Code + Space Router

Model selection: Opus uses claude-opus-5; Sonnet uses claude-sonnet-5. This catalogue has no Haiku route, so its slot is clearly labelled Sonnet (Haiku fallback). After repairing an older setup, fully close VS Code, reopen it, and start a new chat.

Windows setup supports local, domain and Microsoft Entra ID (Azure AD) accounts. If an earlier setup failed with a SID configuration error, rerun the one-command installer below. No Windows or editor upgrade is needed for this fix.

Install Claude Code and point its model requests to Space Router with a Space Router API key.

Gateway: https://space.stationine.com · Last checked:

Keep your API key private. Never share a real API key in screenshots, chat messages, repositories, project files, or public documents. If a key has been exposed, revoke or rotate it in Space Router and create a new one. Every example uses the literal placeholder YOUR_SPACE_API_KEY; replace it only on your own computer.

Quick install — one command

This installs Claude Code only and connects it to Space Router automatically. Codex has its own command on the Codex guide; run one at a time. The manual steps below are the fallback if you prefer to set it up yourself or if the installer fails.

Where to paste the command. The one-line installer below runs in a text window — PowerShell on Windows, Terminal on macOS. You do not need to know anything else about it. The installer will ask for your API key: paste the sk- key you created and press Enter. It checks the key works before saving anything.

Windows

irm https://stationine.com/setup-claude.ps1 | iex

macOS

curl -fsSL https://stationine.com/setup-claude.sh | bash

The installer:

Use a key from the Claude group. Claude and GPT need separate keys because pricing differs by group.

Inside VS Code (Claude Code and Codex together)

If you work in VS Code, use this instead. It installs VS Code if needed, both tools, the two VS Code extensions (Claude Code and Codex), and asks for a Claude key and a GPT key; press Enter to skip the one you do not have. Nothing else on the computer is changed.

irm https://stationine.com/setup-vscode.ps1 | iex
curl -fsSL https://stationine.com/setup-vscode.sh | bash

Afterwards open VS Code (close and reopen it if it was already running) and click the Claude or Codex icon in the left bar. A Claude key cannot be used for GPT and a GPT key cannot be used for Claude; the relay refuses the request.

If this computer already has Claude Code conversations, the installer points the terminal at Space Router and leaves the desktop app on its existing account.

What is Space Router?

Space Router is an AI API relay operated by Station Nine. Its base URL is https://space.stationine.com.

It accepts Anthropic Messages requests at POST /v1/messages, OpenAI Chat Completions requests at POST /v1/chat/completions, and OpenAI Responses requests at POST /v1/responses. It provides OpenAI GPT and Anthropic Claude model families; the Space Router dashboard is the authoritative source for the current model list.

Pointing Claude Code at Space Router sends its supported Anthropic-format model requests through that relay. See the full Space Router overview for service and account details.

0. Get a Space Router API key

  1. Create an account at Space Router with an email address and verification, or sign in with GitHub or Google.
  2. Add credit, then create an API key in the dashboard.
  3. Use that private key wherever this guide says YOUR_SPACE_API_KEY; never publish or commit it.

The main Windows issue we encountered was:

claude : The term 'claude' is not recognized

That is a PATH problem, not an API-key problem. The permanent fix is included below.

1. What you need

Software requirements for running Claude Code through Space Router
SoftwareWindowsmacOSRequired?
Claude CodeYesYesYes
GitRecommendedRecommendedStrongly recommended
PowerShellBuilt inNoWindows install method
Node.js / npmNoNoNot required with the native installer
HomebrewNoOptionalAlternative macOS method
VS CodeOptionalOptionalNot required for terminal Claude Code
WSLOptionalNoNot required for native Windows Claude Code

Important

The current recommended installation is the native installer. You do not need npm or Node.js for it. Anthropic recommends Git for Windows on native Windows so Claude Code can use its Bash tool; without Git for Windows, Claude Code can use PowerShell instead.

2. Install Git

Windows

Install Git for Windows. Close and reopen PowerShell, then check:

git --version

macOS

Check Git:

git --version

If macOS asks to install Command Line Tools, accept it. Or run:

xcode-select --install
git --version

3. Install Claude Code

irm https://claude.ai/install.ps1 | iex
claude --version

Windows CMD alternative

Use this only in Command Prompt, not PowerShell:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
curl -fsSL https://claude.ai/install.sh | bash
claude --version

macOS Homebrew alternative

brew install --cask claude-code
claude --version

4. Windows fix — claude is not recognized

In our testing, Claude Code installed successfully to %USERPROFILE%\.local\bin\claude.exe, but that folder was not yet in Windows PATH.

First confirm Claude is installed

Test-Path "$HOME\.local\bin\claude.exe"

If this returns True, Claude Code is installed. Launch it immediately with:

& "$HOME\.local\bin\claude.exe"

Permanent PATH fix

  1. Press the Windows Start button and search for Environment Variables.
  2. Open Edit environment variables for your account.
  3. Under User variables, select Path, choose Edit, then New.
  4. Add %USERPROFILE%\.local\bin.
  5. Press OK on every window, close all PowerShell, CMD, and Windows Terminal windows, then open a new PowerShell window.
claude --version
Get-Command claude
claude

You should now be able to run claude without the full .exe path.

5. macOS fix — claude: command not found

Check whether Claude exists:

ls -l ~/.local/bin/claude 2>/dev/null

If it exists, add its folder to PATH:

File: ~/.zshrc (macOS)

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
claude --version

6. First test Space Router temporarily

Before saving anything permanently, test the gateway in one terminal session. Replace only the API key.

Windows PowerShell

Destination: the current Windows PowerShell session; this temporary test does not save a file.

$env:ANTHROPIC_BASE_URL = "https://space.stationine.com"
$env:ANTHROPIC_API_KEY = "YOUR_SPACE_API_KEY"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_SPACE_API_KEY"
$env:CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC = "1"
$env:CLAUDE_CODE_ATTRIBUTION_HEADER = "0"

claude

If PATH is not fixed yet:

& "$HOME\.local\bin\claude.exe"

macOS

Destination: the current macOS terminal session; this temporary test does not save a file.

export ANTHROPIC_BASE_URL="https://space.stationine.com"
export ANTHROPIC_API_KEY="YOUR_SPACE_API_KEY"
export ANTHROPIC_AUTH_TOKEN="YOUR_SPACE_API_KEY"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
export CLAUDE_CODE_ATTRIBUTION_HEADER=0

claude

7. Confirm Claude Code is using Space Router

Inside Claude Code, run:

/status

Find Anthropic base URL. It should point to https://space.stationine.com. The authentication source should use ANTHROPIC_API_KEY, with ANTHROPIC_AUTH_TOKEN carrying the same value for compatibility, or show an equivalent active-key indication.

Then send this simple test:

Reply with exactly: Space Router connection works.

If Claude responds normally, the basic connection is working.

8. Recommended permanent configuration

For a gateway, a Claude Code user settings file is more reliable than terminal environment variables alone. It works across new terminal sessions and is the correct place when background Claude Code processes must inherit the gateway configuration.

Windows

File: %USERPROFILE%\.claude\settings.json

New-Item -ItemType Directory -Force "$HOME\.claude" | Out-Null
notepad "$HOME\.claude\settings.json"

macOS

File: ~/.claude/settings.json

mkdir -p ~/.claude
nano ~/.claude/settings.json

9. Put this in settings.json

File: %USERPROFILE%\.claude\settings.json (Windows) / ~/.claude/settings.json (macOS)

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "env": {
    "ANTHROPIC_BASE_URL": "https://space.stationine.com",
    "ANTHROPIC_API_KEY": "YOUR_SPACE_API_KEY",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_SPACE_API_KEY",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
  }
}

ANTHROPIC_API_KEY is the key name Claude Code authenticates with; ANTHROPIC_AUTH_TOKEN is kept for older versions, so use the same value for both.

Replace YOUR_SPACE_API_KEY with your Space Router key only on your own computer. Do not add comments inside JSON or leave a trailing comma after the last item.

macOS file permission

Because the API key is stored in this file:

chmod 600 ~/.claude/settings.json

10. About the two extra Space Router variables

Our current Space Router setup instructions include these settings.

File: %USERPROFILE%\.claude\settings.json (Windows) / ~/.claude/settings.json (macOS)

ANTHROPIC_API_KEY=YOUR_SPACE_API_KEY
ANTHROPIC_AUTH_TOKEN=YOUR_SPACE_API_KEY
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1
CLAUDE_CODE_ATTRIBUTION_HEADER=0

CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1

This variable is documented by Anthropic. It stops nonessential background traffic outside the gateway path. Important side effects:

Because auto-update is disabled, update Claude Code manually from time to time.

CLAUDE_CODE_ATTRIBUTION_HEADER=0

This variable appears in our current Space Router instructions. Anthropic's current public gateway documentation does not list it as a standard gateway requirement. Keep it while Space Router's current instructions include it; if Space Router later removes it, it may no longer be necessary.

11. Restart Claude Code after saving settings

Close every running Claude Code session and open a fresh terminal.

Windows

claude --version
claude

macOS

claude --version
claude

Inside Claude Code, run /status and confirm:

Anthropic base URL = https://space.stationine.com

12. Start Claude Code in your project

Claude Code works on the directory from which you launch it.

Windows example

cd "C:\Users\YourName\Documents\MyProject"
claude

macOS example

cd ~/Documents/MyProject
claude

If you start Claude from the wrong folder, it will inspect and edit the wrong folder. Before asking it to make changes, you can ask:

Tell me your current working directory and list the top-level files. Do not modify anything.

13. Initialize Git before major work

If this is a new project:

git init
git status

A safe beginner workflow is to create a checkpoint:

git add .
git commit -m "checkpoint before Claude changes"
claude

This gives you a checkpoint to return to if an AI change is not what you wanted.

14. Useful Claude Code commands

Claude Code commands for checking and managing a Space Router session
CommandWherePurpose
/helpInside Claude CodeShow help.
/statusInside Claude CodeCheck gateway, authentication, and session configuration.
/modelInside Claude CodeChoose or inspect a model.
/clearInside Claude CodeClear the current conversation context.
/exitInside Claude CodeExit Claude Code.
claudeTerminalStart interactive mode.
claude -cTerminalContinue the most recent conversation for the current directory.
claude -rTerminalChoose a previous session to resume.
claude doctorTerminalCheck the installation and environment.

15. Troubleshooting

Claude Code and Space Router troubleshooting fixes
ProblemFirst checkFix
claude not recognizedPATH and the installation pathRun & "$HOME\.local\bin\claude.exe", then add %USERPROFILE%\.local\bin to User PATH and reopen the terminal.
Claude shows a login screensettings.json, ANTHROPIC_API_KEY, and ANTHROPIC_AUTH_TOKENCreate the user settings.json, assign the same key to both authentication variables, restart Claude Code, and check /status.
/status does not show Space RouterANTHROPIC_BASE_URLSet ANTHROPIC_BASE_URL to https://space.stationine.com, then completely restart Claude Code.
401 UnauthorizedKey status, both variable names, and JSON syntaxPut the same valid, complete key with no surrounding spaces in ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN, then save valid JSON.
Model not foundSpace Router's current supported modelsRun /model and choose a model from the current list in the Space Router dashboard.
Git tools failGit for WindowsInstall Git for Windows, reopen the terminal, and run git --version.
VS Code asks for loginExtension-specific environment variablesAdd ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY, and ANTHROPIC_AUTH_TOKEN to claudeCode.environmentVariables in VS Code User Settings JSON.

Problem A — claude is not recognized

The symptom is that Windows says claude is not recognized. The cause is that Claude Code's installation folder is missing from PATH; run the executable directly, then add %USERPROFILE%\.local\bin to User PATH and reopen the terminal.

& "$HOME\.local\bin\claude.exe"

Problem B — Claude shows a login screen

The symptom is an unexpected Claude login screen. Claude Code is not reading the Space Router key because the user settings file is missing, one of the authentication variables is absent, or the process has not been restarted.

  1. Confirm settings.json exists.
  2. Confirm the same key is assigned to ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN.
  3. Close Claude completely, open a new terminal, run Claude again, and check /status.

Windows file: %USERPROFILE%\.claude\settings.json

Test-Path "$HOME\.claude\settings.json"

macOS file: ~/.claude/settings.json

ls -l ~/.claude/settings.json

Problem C — /status does not show Space Router

The symptom is that /status does not show Space Router. Claude Code is not seeing the configured base URL; confirm the setting is exactly:

File: %USERPROFILE%\.claude\settings.json (Windows) / ~/.claude/settings.json (macOS)

"ANTHROPIC_BASE_URL": "https://space.stationine.com"

Completely restart Claude Code. If you are testing temporary PowerShell variables, Claude must be launched from the same PowerShell window where you set them.

Problem D — 401 Unauthorized

The symptom is a 401 Unauthorized response, which means Space Router did not receive an accepted valid credential. Put the same valid, unexpired, complete key with no surrounding spaces in ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN, and make sure settings.json is valid JSON.

ANTHROPIC_API_KEY is the name Claude Code authenticates with from settings.json; the matching ANTHROPIC_AUTH_TOKEN value keeps the setup compatible with older versions.

Problem E — model not found

The symptom is that Claude Code reports a model is not found or rejects its name. The requested name is not available through the gateway; run /model and choose a model from the authoritative current list in the Space Router dashboard.

Problem F — Claude can answer but cannot use Git correctly

git --version

The symptom is that Claude can answer but its Git tools fail. Git for Windows is missing or unavailable; install Git for Windows, reopen the terminal, and run the command above to verify it.

Problem G — terminal works but the VS Code extension asks you to log in

The symptom is that terminal Claude Code works while the VS Code extension asks for login. The extension uses its own environment-variable configuration, so add the following to the file opened by Preferences: Open User Settings (JSON):

{
  "claudeCode.environmentVariables": [
    {
      "name": "ANTHROPIC_BASE_URL",
      "value": "https://space.stationine.com"
    },
    {
      "name": "ANTHROPIC_API_KEY",
      "value": "YOUR_SPACE_API_KEY"
    },
    {
      "name": "ANTHROPIC_AUTH_TOKEN",
      "value": "YOUR_SPACE_API_KEY"
    }
  ]
}

Open Preferences: Open User Settings (JSON) and add the setting there. Do not commit this API key to a project repository.

16. Manual update because nonessential traffic is disabled

If you keep CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1, automatic updates are disabled.

Windows native installer

irm https://claude.ai/install.ps1 | iex
claude --version

macOS native installer

curl -fsSL https://claude.ai/install.sh | bash
claude --version

Homebrew

brew upgrade claude-code

FAQ

Do I need Node.js to use Claude Code with Space Router?

No. The recommended native Claude Code installer does not require Node.js or npm, and the Space Router configuration is stored in Claude Code's user settings file.

Do I need WSL on Windows?

No. WSL is optional because Claude Code runs natively on Windows; Git for Windows is recommended for its Bash tool, and PowerShell remains available.

Why does the terminal say claude is not recognized?

Claude Code's installation folder is missing from Windows PATH. Run & "$HOME\.local\bin\claude.exe" immediately, then add %USERPROFILE%\.local\bin to User PATH and reopen the terminal.

What does a 401 Unauthorized response mean, and how do I fix it?

A 401 means Space Router did not receive an accepted valid credential. Put a valid, complete key with no surrounding spaces in both ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN in the Claude Code user settings file, use the same value for both, save valid JSON, and restart Claude Code.

What if the model name is rejected?

The requested model name is not available through the gateway. Run /model and choose a model from the authoritative current list in the Space Router dashboard.

Can I use this with the VS Code extension?

Yes. Add ANTHROPIC_BASE_URL, ANTHROPIC_API_KEY, and ANTHROPIC_AUTH_TOKEN to claudeCode.environmentVariables in VS Code User Settings JSON, use the same key value for both authentication variables, and never commit the API key to a project repository.

How do I switch back to the official Anthropic endpoint?

Remove the Space Router environment entries from %USERPROFILE%\.claude\settings.json on Windows or ~/.claude/settings.json on macOS. Close every Claude Code session and restart it from a fresh terminal so it no longer uses the Space Router base URL.

Where do I get Space Router support?

Contact Space Router at apisupport@stationine.com or through the Space Router Telegram group. Space Router is operated by Station Nine.

17. References

Space Router is operated by Station Nine (stationine.com). With respect to Anthropic it is a third-party gateway: Anthropic does not maintain, audit, or support third-party gateways, so vendor-specific issues should be reported to Space Router, not to Anthropic.