Skip to content

ClaudeCode CLI Setup Guide ​

1. Open the configuration directory ​

The Claude Code directory is .claude in your home directory.

bash
open ~/.claude       # macOS
cd ~/.claude         # Linux

On Windows, open %userprofile%\\.claude. If the directory does not exist, run claude once or create it.

2. Edit settings.json ​

json
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "your-api-key",
    "ANTHROPIC_BASE_URL": "https://api.apixhm.com"
  }
}

Claude Code does not use /v1 in the Base URL. Copy a model ID from the Yuan API pricing page, restart the terminal, and run claude.