Claude Code Setup
Claude Code is Anthropic's command-line coding tool. To use it through Yunxi AI, create a key that supports Claude or Anthropic-compatible routing and point Claude Code to Yunxi AI.
Prerequisites
- You have signed in to
https://ai.laiber.cloud. - You have created a Claude Code API key.
- Node.js is installed, or Claude Code has been installed through the official installer.
Recommended
If CC-Switch is installed, open the key action menu, choose CC Switch, select Claude, and import the model profile directly. The environment variable method below is a manual fallback.
Install Claude Code
Recommended:
curl -fsSL https://claude.ai/install.sh | bashAlternative npm install:
npm install -g @anthropic-ai/claude-codeVerify:
claude -vConfigure environment variables
Replace sk-xxx with your Claude Code key.
macOS / Linux
For zsh:
echo 'export ANTHROPIC_AUTH_TOKEN="sk-xxx"' >> ~/.zshrc
echo 'export ANTHROPIC_BASE_URL="https://ai.laiber.cloud"' >> ~/.zshrc
source ~/.zshrcFor bash:
echo 'export ANTHROPIC_AUTH_TOKEN="sk-xxx"' >> ~/.bash_profile
echo 'export ANTHROPIC_BASE_URL="https://ai.laiber.cloud"' >> ~/.bash_profile
source ~/.bash_profileWindows PowerShell
[Environment]::SetEnvironmentVariable("ANTHROPIC_AUTH_TOKEN", "sk-xxx", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://ai.laiber.cloud", "User")Restart your terminal after setting variables.
Start Claude Code
cd your-project
claudeIf Claude Code opens and returns a response, the configuration is working.
FAQ
Connection failed
Check the key, Base URL, model access, and local network or proxy settings.
Can I reuse the same key for Codex?
It is better to create separate keys because Claude Code and Codex often use different protocols, models, and groups.