Skip to main content
This guide covers Claude Code CLI. Configure the service address, API Key and an available Claude model, then verify your first terminal conversation.

Before you start

Set up Claude Code

1

Install Claude Code

Run the official installer in a macOS, Linux or WSL terminal:
Windows PowerShell:
Run claude --version afterward. If the command is not found, reopen your terminal and check PATH as instructed by the installer.
2

Check your key's configuration

Sign in to aibal.ai, open Use Key in the API Key list, and select Claude Code and your operating system. Confirm the address and a supported full Claude model ID. Replace YOUR_AVAILABLE_CLAUDE_MODEL_ID below.
3

Set the address, key and model

In Bash or Zsh, run these commands and paste the key at the hidden-input prompt:
Windows PowerShell:
Do not append /v1/messages to this base address. If Use Key provides a group-specific path, use the complete base address it supplies.
4

Start and check your connection

Enter your project folder in the same terminal and run claude. Complete the initial setup, then type /status. Check that Anthropic base URL points to aibal.ai and the credential source is ANTHROPIC_AUTH_TOKEN.
5

Send your first message

Send:
After receiving an answer, check the model, time and cost in aibal.ai Usage. Tests may incur charges; confirm your account and key limits before coding.

What the three variables do

These are temporary variables for your current terminal. Set them again in a new terminal. To save and switch configurations in a graphical interface, use cc-switch. Never put a real key in project settings that will be committed to Git.

Common questions

It still asks me to use my previous account

Check the address and credential source in /status. Setting only the address is not sufficient. Check for conflicting ANTHROPIC_API_KEY, apiKeyHelper or settings-file values, keep the intended credential source, and restart.

The variables do not affect VS Code or the desktop app

Terminal variables reach only child processes started from that terminal. This guide covers the CLI. The VS Code extension and desktop app have separate configuration entry points; follow the official gateway connection guide for those surfaces.

The main model works but another model or subtask fails

Models can require different group permissions. Do not assume default Sonnet, Opus or Haiku aliases are all available. Use the model IDs explicitly provided by the console; follow Use Key if model mapping is required.

I get 401, 404, 429 or a quota error

Check the key, an extra /v1 in the address, concurrency/rate limits, and account or key quota respectively. Avoid repeatedly retrying tasks that may incur charges. See Integration overview.

Key security and next steps

Never send real keys to the model or share screenshots of terminals or configuration files containing them. If exposed, disable the old key in the console, create a replacement, and update your settings. Once connected, give Claude Code a small, clear task such as explaining a file. Before allowing edits, make sure the project has a backup or version control. References: Official installation guide, official gateway connection guide.