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.
| Client | Installation and API settings | Verification |
|---|---|---|
| Claude Code CLI | Terminal installer; environment variables | Start claude from the configured terminal |
| Claude Desktop | Desktop app; Gateway in the Developer menu | Save the gateway and model, then restart the app |
| Claude Code on Windows | PowerShell / CMD or WSL | Configure the environment that actually runs the CLI |
Before you start: account, key, and model
- Register, sign in, and copy your site key from API Keys. Do not use your account password.
- Choose and save an endpoint for the model family under Endpoint selection. See Getting Started for the account flow.
- 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
| Symptom | Check first | Next step |
|---|---|---|
claude is missing or will not start | Installation completion and refreshed PATH | Reopen the terminal; check whether you installed in Windows or WSL |
| 401 / authentication failed | A valid site key in the current process; old authentication settings | Check or rotate the key in API Keys and reopen the terminal without printing it |
| 403 / permission denied | Error text, endpoint selection, account and model conditions | Follow the specific error; retain a redacted copy rather than inferring the cause from the code alone |
| 429 / rate limit | Error text, concurrent requests, account status | Pause repeated retries, reduce concurrency, and check balance and limits |
| Timeout or connection failure | Actual Base URL, proxy, DNS, and connectivity | Change one factor at a time; try the JP / SG backup domains below |
| New variables still use an old key or address | Terminal, IDE, and launcher environment | Exit the client, refresh the launching environment, and check for duplicate configuration |
| Unexpected login prompt | CLI setup versus Desktop setup; mixed authentication | Follow 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:
| Field | Value |
|---|---|
| Connection | Gateway |
| Base URL | https://api.icodeeasy.cc |
| API key | your 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
Related guides
Kimi Code Setup: API Key, K3.1 Pro, and Claude Code
Set up Kimi Code CLI or Claude Code with K3.1 Pro. Compare persistent and temporary settings, verify your first call, and fix 401, model, and URL errors.
How to use GLM-5.3 with Claude Code
Use GLM-5.3 in Claude Code: set an API key, Base URL and model, check Windows or Unix settings, and fix authentication, model selection and connection errors.
Getting Started
Create an account, obtain an API key, choose an endpoint, and send a first request to confirm that I Code Easy is working.