Model guidesBeginnersUpdated

Install Claude Code, Configure a Custom API, and Troubleshoot Windows

To use an I Code Easy API key with Claude Code, install the CLI, set ANTHROPIC_AUTH_TOKEN and ANTHROPIC_BASE_URL, then reopen your terminal and run claude in a project folder. Claude Desktop has its own Gateway settings in the app; those steps appear below.

ClientInstallation and API settingsVerification
Claude Code CLITerminal installer; environment variablesStart claude from the configured terminal
Claude DesktopDesktop app; Gateway in the Developer menuSave the gateway and model, then restart the app
Claude Code on WindowsPowerShell / CMD or WSLConfigure the environment that actually runs the CLI

Before you start: account, key, and model

  1. Register, sign in, and copy your site key from API Keys. Do not use your account password.
  2. Choose and save an endpoint for the model family under Endpoint selection. See Getting Started for the account flow.
  3. Review prices, balance, and usage and model capabilities for model IDs, conditions, and protocol support. Installing a client does not supply API credit or model access.

Keep the key in your own client configuration. Do not commit it or include it in public screenshots. Rotate an exposed key on the API Keys page.

Step 1: Install Claude Code

Choose either the native installer or npm. For Node.js and terminal preparation required by npm, see Environment Setup.

MacOS / Linux / WSL

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

Windows PowerShell

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

Windows CMD

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

The native installer updates Claude Code automatically in the background.

npm installation (after completing Environment Setup)

npm i -g @anthropic-ai/claude-code

Step 2: Configure API

The environment variables below apply only to Claude Code CLI. Desktop does not read this ANTHROPIC_BASE_URL or the CLI settings.json; use its separate settings below.

Linux / MacOS

Run these commands in your current shell. To keep them for later sessions, add them to the appropriate ~/.bashrc or ~/.zshrc for that shell. Replace the key placeholder with your API key:

export ANTHROPIC_AUTH_TOKEN="your API Key"
export ANTHROPIC_BASE_URL="https://api.icodeeasy.cc"
export CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC="1"

Do not set CLAUDE_CODE_ATTRIBUTION_HEADER=0; some Claude Code-only channels validate the native client attribution metadata.

If api.icodeeasy.cc is slow from your network, change ANTHROPIC_BASE_URL to https://jp.icodeeasy.cc or https://sg.icodeeasy.cc.

Save the file and run source ~/.bashrc or source ~/.zshrc.

Windows

Run in PowerShell:

# Set API key
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "your API Key", "User")

# Set API base URL
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://api.icodeeasy.cc", "User")

# Disable non-essential traffic
[Environment]::SetEnvironmentVariable("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "1", "User")

If api.icodeeasy.cc is slow from your network, change ANTHROPIC_BASE_URL to https://jp.icodeeasy.cc or https://sg.icodeeasy.cc.

Open a new PowerShell window after setting environment variables.

Verify user-level environment variables in the new window:

-not [string]::IsNullOrWhiteSpace([Environment]::GetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "User"))
[Environment]::GetEnvironmentVariable("ANTHROPIC_BASE_URL", "User")
[Environment]::GetEnvironmentVariable("CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC", "User")

SetEnvironmentVariable writes persistent user-level variables. It does not update the current PowerShell session. Open a new PowerShell window before starting claude.

Check what the CLI process will read

On macOS / Linux / WSL, check for a key without printing it:

[ -n "$ANTHROPIC_AUTH_TOKEN" ] && echo "Token configured" || echo "Token missing"
printf '%s\n' "$ANTHROPIC_BASE_URL"

On Windows, check the process environment in a newly opened PowerShell window:

-not [string]::IsNullOrWhiteSpace($env:ANTHROPIC_AUTH_TOKEN)
$env:ANTHROPIC_BASE_URL

The first result should be True, and the address should match your chosen domain. If the saved user variable exists but this check returns False, the launching process has not refreshed its environment. An IDE terminal can inherit old values from the editor; fully close and reopen the editor as needed.

WSL uses a Linux environment. Variables saved in Windows PowerShell still need to be configured inside your WSL shell using the Linux steps. Use the domain as Base URL; do not append the /v1/messages request path.


Step 3: Start Claude Code

First check the installed version in your terminal:

claude --version
cd your-project-folder
claude

After launch, enter /status to inspect the current model, account, credential source, and gateway URL. This checks configuration; it does not replace verification with an actual request.

Send one short question, confirm a reply, and check the model, status, and usage in request logs. A completed installation, a working CLI prompt, or a present key alone does not prove that an API request succeeded.

Claude Code troubleshooting

SymptomCheck firstNext step
claude is missing or will not startInstallation completion and refreshed PATHReopen the terminal; check whether you installed in Windows or WSL
401 / authentication failedA valid site key in the current process; old authentication settingsCheck or rotate the key in API Keys and reopen the terminal without printing it
403 / permission deniedError text, endpoint selection, account and model conditionsFollow the specific error; retain a redacted copy rather than inferring the cause from the code alone
429 / rate limitError text, concurrent requests, account statusPause repeated retries, reduce concurrency, and check balance and limits
Timeout or connection failureActual Base URL, proxy, DNS, and connectivityChange one factor at a time; try the JP / SG backup domains below
New variables still use an old key or addressTerminal, IDE, and launcher environmentExit the client, refresh the launching environment, and check for duplicate configuration
Unexpected login promptCLI setup versus Desktop setup; mixed authenticationFollow the matching client section and verify the current environment and authentication source

Backup addresses are https://jp.icodeeasy.cc and https://sg.icodeeasy.cc; keep the same site key. Switching hosts is a connection recovery step, not an account or model change. See Connection and Recovery for more checks.

For support, include the client version, OS, Beijing time, redacted error text, and request identifier. Do not send your API key or a full environment dump.

Use Kimi or GLM in Claude Code

The client, API address, and model name are separate choices. Setting Base URL alone does not select Kimi or GLM. Follow the Kimi guide or GLM guide to configure the model and verify the selection after launch. Consult those guides and the capability catalog for current conditions.


Claude Desktop Configuration

Claude Desktop can connect to a third-party gateway through Developer Mode.

Desktop uses separate third-party inference settings and does not inherit the CLI variables above. Menu availability depends on the installed version. Model use also depends on the site catalog and endpoint conditions; entering a model name alone does not verify compatibility.

Enable Developer Mode

In the menu bar, click Help -> Troubleshooting -> Enable Developer mode, then restart Claude Desktop.

Configure Gateway

After restart, click Developer -> Configure third-party inference in the menu bar and fill in:

FieldValue
ConnectionGateway
Base URLhttps://api.icodeeasy.cc
API keyyour API Key

If api.icodeeasy.cc is slow from your network, change Base URL to https://jp.icodeeasy.cc or https://sg.icodeeasy.cc.

Set Model

Enter the model name you want to use, such as claude-opus-5-5 or claude-sonnet-5-5, save, and restart Claude Desktop. Claude models can use the Claude endpoints.

For Kimi and GLM model setup, see the Kimi guide and GLM guide. To pin Claude Fable 5, see the Claude Fable 5 Guide.

Official references