Claude Code Setup
Claude Code is Anthropic’s command-line coding agent. This page walks you through pointing it at KeyMaker so it runs on campusGenAI’s models, billed to your sponsor’s funding.
Prerequisites
Section titled “Prerequisites”- Terminal access (macOS, Linux, or Windows PowerShell)
- A valid KeyMaker API key from your sponsor — see Getting Started
You don’t need a Claude subscription or an Anthropic account. KeyMaker takes their place.
Install Claude Code
Section titled “Install Claude Code”macOS or Linux:
-
Open a new terminal and install Claude Code:
Terminal window curl -fsSL https://claude.ai/install.sh | bash -
Add Claude Code to your path:
Terminal window echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && source ~/.zshrc
Windows (PowerShell):
-
Open PowerShell. (Your prompt should start with
PS C:\. If it starts with justC:\, you’re in Command Prompt. Typepowershelland pressEnterto switch.) -
Install Claude Code:
Terminal window irm https://claude.ai/install.ps1 | iexThe installer shows no progress while it downloads. Wait for the prompt to return.
-
Close PowerShell and open a new window so it picks up the updated path.
Then, on any platform, confirm the installation:
claude --versionIf you see a version number followed by (Claude Code), the installation was successful. For other install methods (Homebrew, WinGet, Linux package managers), see Anthropic’s Claude Code quickstart.
Connect Claude Code to KeyMaker
Section titled “Connect Claude Code to KeyMaker”Claude Code reads its configuration from a settings.json file in a .claude folder in your home directory:
- macOS / Linux:
~/.claude/settings.json - Windows:
%USERPROFILE%\.claude\settings.json(for example,C:\Users\yourname\.claude\settings.json)
-
Create the folder and open the file in a text editor.
macOS / Linux:
Terminal window mkdir -p ~/.claude && nano ~/.claude/settings.jsonWindows (PowerShell):
Terminal window New-Item -ItemType Directory -Force "$env:USERPROFILE\.claude"notepad "$env:USERPROFILE\.claude\settings.json"If Notepad asks whether to create a new file, choose Yes.
-
Add the configuration below. Replace
YOUR_KEY_HEREwith your actual KeyMaker API key, andYOUR_KEYMAKER_URLwith the API Endpoint value from your KeyMaker portal:{"env": {"ANTHROPIC_AUTH_TOKEN": "YOUR_KEY_HERE","ANTHROPIC_BASE_URL": "YOUR_KEYMAKER_URL"}} -
Save the file. In
nano, pressCtrl + OthenEnter, and exit withCtrl + X. In Notepad, pressCtrl + S. -
Start Claude Code by typing
claudein the terminal:Terminal window claudeClaude Code shouldn’t ask you to log in. If it shows a login screen, it isn’t reading your
settings.json. See Troubleshooting.
Troubleshooting
Section titled “Troubleshooting”claude: command not found (macOS / Linux)
The install directory isn’t on your path. Re-run the path step, then close and reopen your terminal. Confirm the binary exists with ls ~/.local/bin/claude. If you use bash rather than zsh, make sure you edited ~/.bashrc.
'claude' is not recognized (Windows)
Close PowerShell and open a new window. If that doesn’t fix it, the install directory isn’t on your path. Follow Anthropic’s Fix your PATH instructions.
'irm' is not recognized or The token '&&' is not a valid statement separator (Windows)
You’re in the wrong shell. irm only works in PowerShell, not Command Prompt. Open PowerShell and run the install command again.
Claude Code asks you to log in
- Confirm the file is named exactly
settings.jsonand is inside the.claudefolder in your home directory. On Windows, make sure Notepad didn’t save it assettings.json.txt. In File Explorer, turn on View → Show → File name extensions to check. - Confirm the file is valid JSON (see below).
Invalid key / authentication errors
- Confirm you copied the full key from the KeyMaker portal with no extra spaces or line breaks.
- Make sure the key is set as
ANTHROPIC_AUTH_TOKEN(notANTHROPIC_API_KEY) insettings.json. - Check that your sponsor’s funding is active and your access hasn’t been removed.
Connection or base URL errors
- Verify
ANTHROPIC_BASE_URLmatches the API Endpoint value in your KeyMaker portal exactly, with no trailing slash. - Confirm your
settings.jsonis valid JSON. A missing comma or brace will prevent it from loading. Paste it into a JSON validator if unsure. - If you’re off-campus, make sure you can reach institutional services (some require a VPN).
Next steps
Section titled “Next steps”- Usage and Best Practices: monitoring usage, cost awareness, and security
Need help?
Section titled “Need help?”- Get help: Contact us
- About campusGenAI: Main site
Your interface may look slightly different depending on your institution’s deployment.