wylon

Configuring Claude Code

Claude Code is Anthropic's command-line coding agent. It talks to the model over the Anthropic-compatible protocol, so connecting it to wylon is just a matter of setting a few environment variables that point requests at wylon's Anthropic-compatible endpoint.

1. Install

Make sure Node.js 18+ is installed (Windows users also need Git for Windows), then install Claude Code globally:

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

Verify the installation:

claude --version

2. Configure environment variables

Add the following to your shell profile (e.g. ~/.zshrc, ~/.bashrc) and replace <your_wylon_API_Key> with your actual key.

Linux / macOS

export ANTHROPIC_BASE_URL=https://api.wylon.cn
export ANTHROPIC_AUTH_TOKEN=<your_wylon_API_Key>
export ANTHROPIC_MODEL=moonshotai/Kimi-K2.6
export ANTHROPIC_DEFAULT_OPUS_MODEL=moonshotai/Kimi-K2.6
export ANTHROPIC_DEFAULT_SONNET_MODEL=moonshotai/Kimi-K2.6
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-ai/DeepSeek-V4-Flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-ai/DeepSeek-V4-Flash

Windows PowerShell

$env:ANTHROPIC_BASE_URL="https://api.wylon.cn"
$env:ANTHROPIC_AUTH_TOKEN="<your_wylon_API_Key>"
$env:ANTHROPIC_MODEL="moonshotai/Kimi-K2.6"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL="moonshotai/Kimi-K2.6"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL="moonshotai/Kimi-K2.6"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-ai/DeepSeek-V4-Flash"
$env:CLAUDE_CODE_SUBAGENT_MODEL="deepseek-ai/DeepSeek-V4-Flash"

Variable reference:

VariablePurpose
ANTHROPIC_BASE_URLwylon's Anthropic-compatible endpoint, fixed at https://api.wylon.cn
ANTHROPIC_AUTH_TOKENYour wylon API Key
ANTHROPIC_MODELDefault model used for conversations
ANTHROPIC_DEFAULT_OPUS_MODEL / …_SONNET_MODELThe wylon model that Claude Code's Opus / Sonnet tiers map to
ANTHROPIC_DEFAULT_HAIKU_MODELThe model the lightweight tier maps to; use a faster model
CLAUDE_CODE_SUBAGENT_MODELThe model used for sub-tasks (subagents); a faster model is recommended to reduce cost

3. Run

Change into your project directory and run:

cd /path/to/your-project
claude

You can now drive coding, edits, and command execution in the current directory using natural language.

info
If changes don't take effect after editing the variables, open a new terminal or run source ~/.zshrc (or your relevant profile) to reload them.
沪ICP备2026010432号-1 沪公网安备31010402336632号