Skip to content

Connecting Claude Code CLI ​

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

Setup · fill these in
API addresshttps://byesu.si
API keysk-xxxxxxxxCreate in console →
Modelclaude-opus-5-5
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). The script writes the settings into Claude Code's own config file, ~/.claude/settings.json, and skips the official sign-in screen: no source, no terminal restart — run claude right away.

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

The script also comments out old ANTHROPIC_* variables in ~/.bashrc / ~/.zshrc (the original is backed up as *.byesu-bak.<time>) so an old key can't override the new settings; the Windows version removes the user environment variables of the same name.

Option 2: Edit the config files manually ​

① ~/.claude/settings.json (on Windows: C:\Users\<you>\.claude\settings.json; if the file already exists, just add the env block):

json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://byesu.si",
    "ANTHROPIC_AUTH_TOKEN": "sk-your-token"
  }
}

② ~/.claude.json (also in your home directory): add "hasCompletedOnboarding": true inside the outermost { }, or create the file with:

json
{
  "hasCompletedOnboarding": true
}

Without it, the first launch opens the claude.ai sign-in screen (open a link, paste a code). That is Anthropic's own account login — you don't need it with byesu.

Note

  • ANTHROPIC_BASE_URL is https://byesu.si (Anthropic-native format, no /v1). The OpenAI-compatible endpoint https://byesu.si/v1 also exists, but it is for OpenAI-format clients — Claude Code speaks the Anthropic format.
  • Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY: the latter makes Claude Code ask you to confirm the API key first.
  • An old ANTHROPIC_API_KEY still exported in your shell overrides these settings: run unset ANTHROPIC_API_KEY, or delete that line from ~/.bashrc / ~/.zshrc and open a new terminal.

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-5-5"   # 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 an old ANTHROPIC_API_KEY is still set in your shell (run unset ANTHROPIC_API_KEY or open a new terminal) (details)
  • Claude Code opens the claude.ai sign-in screen and asks for a code → The settings didn't apply: run the one-click script again, or add hasCompletedOnboarding to ~/.claude.json as in Option 2
  • 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.