Skip to content

Connecting Claude Code CLI

Difficulty ⌨️ Intermediate (command line) | API format Claude | base_url https://byesu.com

Setup · fill these in
API addresshttps://byesu.com
API keysk-xxxxxxxxCreate in console →
Modelclaude-opus-4-8
API format Claude · model names follow the console

Claude Code is Anthropic's official command-line coding assistant. By default it connects to Anthropic; two environment variables point it at byesu — an AI API gateway with Anthropic-native and OpenAI-compatible endpoints. One key covers Claude, GPT-5.6, Grok, Gemini and more, billed pay-as-you-go with no subscription.

Before you start

First go to Console → Tokens and create a token in the Claude group (see Choosing a Group). Replace the sk-xxxx below with your own.

Step 1: Install Claude Code

Pick either method:

bash
curl -fsSL https://claude.ai/install.sh | bash
bash
npm install -g @anthropic-ai/claude-code

The npm route requires Node.js 18+ first (if you don't have it, download the LTS version from nodejs.org). Windows users also need to install Git for Windows beforehand — Claude Code depends on Git Bash and will fail to start without it.

Once installed, verify it:

bash
claude --version

Step 2: Point it at byesu (pick one)

We've already written the gateway endpoint into the script for you — after running it, just paste your API Key (sk-xxxx) and it will automatically set both the ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY environment variables:

powershell
iex (irm 'https://docs.byesu.com/setup/claude.ps1')
bash
curl -fsSL https://docs.byesu.com/setup/claude.sh | bash

Option 2: Set the two environment variables manually

bash
# Add to ~/.zshrc or ~/.bashrc, then reopen your terminal for it to take effect
export ANTHROPIC_BASE_URL="https://byesu.com"
export ANTHROPIC_API_KEY="sk-your-token"
powershell
setx ANTHROPIC_BASE_URL "https://byesu.com"
setx ANTHROPIC_API_KEY "sk-your-token"
# Takes effect after you reopen PowerShell

Note

  • ANTHROPIC_BASE_URL is https://byesu.com (Anthropic-native format, no /v1). The OpenAI-compatible endpoint https://byesu.com/v1 also exists, but it is for OpenAI-format clients — Claude Code speaks the Anthropic format.
  • If a particular version fails to authenticate, try swapping ANTHROPIC_API_KEY for ANTHROPIC_AUTH_TOKEN.

Step 3: Choose a model (optional)

After starting Claude Code, type /model to switch models. You can also set a default with an environment variable:

bash
export ANTHROPIC_MODEL="claude-opus-4-8"   # the strongest right now; or any other Claude model in the console

Billing is pay-as-you-go per token. The console shows your live billed price next to the official list price, and it follows automatically whenever multipliers change.

Step 4: Run it and verify

Go into any project directory and start it:

bash
claude

Ask it to do something small (for example, "list the files in the current directory"). If it answers normally, you're connected ✅

Claude Code running normally

Stuck?

  • 401 / invalid token → The Key is wrong, or try swapping ANTHROPIC_API_KEY for ANTHROPIC_AUTH_TOKEN (details)
  • No available channel → The token isn't in the Claude group (Choosing a Group, details)
  • Insufficient balance → Top up in the console with USDT or Alipay (details)
  • For other issues, see Common Errors & Solutions

Got a problem? Contact support or join our group.