Skip to content

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

  1. You have signed in to https://ai.laiber.cloud.
  2. You have created a Claude Code API key.
  3. 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:

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

Alternative npm install:

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

Verify:

bash
claude -v

Configure environment variables

Replace sk-xxx with your Claude Code key.

macOS / Linux

For zsh:

bash
echo 'export ANTHROPIC_AUTH_TOKEN="sk-xxx"' >> ~/.zshrc
echo 'export ANTHROPIC_BASE_URL="https://ai.laiber.cloud"' >> ~/.zshrc
source ~/.zshrc

For bash:

bash
echo 'export ANTHROPIC_AUTH_TOKEN="sk-xxx"' >> ~/.bash_profile
echo 'export ANTHROPIC_BASE_URL="https://ai.laiber.cloud"' >> ~/.bash_profile
source ~/.bash_profile

Windows PowerShell

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

bash
cd your-project
claude

If 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.

Stable, clear, and easy to connect