SEI Robotics Logo
Internal Staff Guide

Claude Code Setup Guide

Install Claude Code and connect it to OpenRouter for AI-powered coding assistance. Follow the steps below for your operating system.

1

Prerequisites

🌐

Internet

Required for installation and API calls.

💻

Terminal

macOS Terminal, Linux shell, or Windows PowerShell / CMD.

🔑

OpenRouter Account

Free sign-up at openrouter.ai.

📦

Git (Windows only)

Install Git for Windows before proceeding.

2

Create an OpenRouter API Key

  1. 1

    Go to openrouter.ai and click Sign Up.

    You can sign up with Google, GitHub, or email.

  2. 2

    Navigate to Settings → Keys.

  3. 3

    Click "Create Key".

    Give it a descriptive name, e.g., claude-code-work.

  4. 4

    Copy your API key immediately.

    It starts with sk-or-v1- and is only shown once. Store it in a password manager.

  5. 5

    (Optional) Add credits at openrouter.ai/credits.

    Credits are required to make API calls. Usage is pay-as-you-go.

Security reminder: Treat your API key like a password. Never share it, commit it to git, or paste it in Slack/Teams/email.

3

Install Claude Code

Option A — Native Install Recommended

Auto-updates in the background. Open Terminal and run:

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

Option B — Homebrew

Does not auto-update — run brew upgrade claude-code periodically.

brew install --cask claude-code

Native Install Recommended

Works on most Linux distributions and WSL. Open your terminal and run:

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

Prerequisite: Install Git for Windows first. Accept all defaults during installation.

Option A — PowerShell Recommended

Open PowerShell and run:

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

Option B — Command Prompt (CMD)

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

Option C — WinGet

Does not auto-update — run winget upgrade Anthropic.ClaudeCode periodically.

winget install Anthropic.ClaudeCode

Option D — WSL

If you have WSL set up, open your WSL terminal and use the Linux install command above.

4

Configure Environment Variables

Tell Claude Code to route requests through OpenRouter by setting these environment variables.

Step 1: Open your shell profile in a text editor.

Zsh (default on macOS)

nano ~/.zshrc

Bash (default on most Linux)

nano ~/.bashrc

Step 2: Add these lines at the bottom of the file. Replace the placeholder with your actual key.

# Claude Code — OpenRouter Configuration
export OPENROUTER_API_KEY="sk-or-v1-YOUR_KEY_HERE"
export ANTHROPIC_BASE_URL="https://openrouter.ai/api"
export ANTHROPIC_AUTH_TOKEN="$OPENROUTER_API_KEY"
export ANTHROPIC_API_KEY=""

Step 3: Save the file (in nano: Ctrl+OEnterCtrl+X).

Step 4: Reload your profile:

source ~/.zshrc    # or: source ~/.bashrc

Option A — PowerShell Commands Recommended

Run these in PowerShell. Replace the placeholder with your actual key.

[Environment]::SetEnvironmentVariable("OPENROUTER_API_KEY", "sk-or-v1-YOUR_KEY_HERE", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://openrouter.ai/api", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-or-v1-YOUR_KEY_HERE", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "", "User")

After running, close and reopen PowerShell.


Option B — System Environment Variables (GUI)

  1. Press Win+R, type sysdm.cpl, press Enter.
  2. Go to Advanced tab → Environment Variables.
  3. Under User variables, click New and add each:
Variable Name Value
OPENROUTER_API_KEYsk-or-v1-YOUR_KEY_HERE
ANTHROPIC_BASE_URLhttps://openrouter.ai/api
ANTHROPIC_AUTH_TOKENsk-or-v1-YOUR_KEY_HERE
ANTHROPIC_API_KEY(leave empty)

Click OK to save, then close and reopen your terminal.

Important: Do not put these variables in a .env file in your project. The native Claude Code installer does not read .env files. They must be in your shell profile or set as system-level environment variables.
5

Launch & Verify

1

Open a new terminal window

Old windows won't have the new environment variables.

2

Navigate to any project folder and launch Claude Code:

cd your-project-folder
claude
3

If you were previously logged in to Anthropic, log out first:

/logout

This clears cached Anthropic credentials so OpenRouter takes over.

4

Verify the connection:

/status

You should see confirmation that your connection is active and routed through OpenRouter.

5

Try a test prompt:

What files are in this directory?

If Claude responds with a file listing — you're all set!

Success! Claude Code is now connected through OpenRouter. You can start using it for coding tasks.

6

Troubleshooting

"Authentication failed" or "Invalid API key"
  • Double-check your OPENROUTER_API_KEY starts with sk-or-v1-.
  • Make sure you opened a new terminal window after setting variables.
  • Run /logout inside Claude Code to clear old Anthropic credentials.
  • Ensure ANTHROPIC_API_KEY is set to an empty string (""), not left unset.
"Insufficient credits" or rate limit errors
"claude" command not found
  • Close and reopen your terminal after installation.
  • On Windows, ensure Git for Windows is installed.
  • Try reinstalling with the native installer.
Environment variables not being picked up
  • Do not put variables in a .env file — the native installer ignores them.
  • Variables must be in your shell profile (~/.zshrc or ~/.bashrc) or system environment variables.
  • Verify: echo $ANTHROPIC_BASE_URL (macOS/Linux) or echo %ANTHROPIC_BASE_URL% (Windows CMD).
Behind a corporate proxy

Add your proxy to your shell profile:

export HTTPS_PROXY="https://your-proxy:port"
ESAFENET (亿赛通) encryption blocking Claude Code

ESAFENET CDG uses kernel-level transparent encryption that blocks node.exe and git.exe from reading encrypted source files. IT admins need to whitelist Claude Code processes.

View full ESAFENET Compatibility Guide
7

Department CLI Tools

Curated command-line tools for each SEI Robotics department. Click any command to copy it.

8

AI Tool Recommendations

Ask our AI assistant for personalized CLI tool recommendations based on your role and workflow.

Your key is only used in your browser and sent directly to OpenRouter. It is never stored or sent anywhere else.

Hello! I'm your SEI Robotics AI assistant. Tell me your department and what you're working on, and I'll recommend the best CLI tools for your workflow.

Quick Reference

What Command / Link
Install (macOS / Linux) curl -fsSL https://claude.ai/install.sh | bash
Install (Windows PS) irm https://claude.ai/install.ps1 | iex
Install (Homebrew) brew install --cask claude-code
Install (WinGet) winget install Anthropic.ClaudeCode
Launch claude
Check status /status
Log out /logout
OpenRouter keysopenrouter.ai/settings/keys
OpenRouter creditsopenrouter.ai/credits
Usage dashboardopenrouter.ai/activity

Tips & Best Practices

Monitor Costs

Check openrouter.ai/activity regularly. Set spending limits in your account settings.

Stay Updated

Native installs auto-update. Homebrew/WinGet users: upgrade manually.

Provider Failover

OpenRouter routes between multiple Anthropic providers for high availability.

Never Commit Keys

Keep your API key out of code, git repos, and shared documents. Use env vars only.

Copied to clipboard