ClaudeStore/Docs
⚠ These docs are a work in progress. Some content may be inaccurate or temporarily AI-generated.

Claude Code — Terminal AI Assistant Setup

Set up Claude Code CLI against the ClaudeStore api2.claudestore.store gateway. Use ANTHROPIC_API_KEY with an sk-cs2 key — no Anthropic account or OAuth required.

ANTHROPIC_BASE_URL: https://api2.claudestore.store. ANTHROPIC_API_KEY: sk-cs2-*. Subscription required: No. Minimum top-up: $5.

1. Install the CLI

Install the official @anthropic-ai/claude-code package globally:

Install Claude Code CLIbash
npm install -g @anthropic-ai/claude-code

Verify the binary is on your $PATH:

claude --version

2. Get an API Key

The Claude Code gateway uses v2 keys with the prefix sk-cs2-:

  1. Open the Gateway v2 → Keys page in the dashboard
  2. Click New v2 key, give it a name, and copy the sk-cs2-… value (shown once)
  3. Top up the v2 credit pool from the Plans page if needed
v1 keys (sk-cs2-… on api2.claudestore.store) are billed separately and are not used for the Claude Code setup below.

3. Set Environment Variables

Linux / macOS

~/.zshrc or ~/.bashrcbash
export ANTHROPIC_BASE_URL="https://api2.claudestore.store"
export ANTHROPIC_API_KEY="YOUR_SK_CS2_KEY"
export ANTHROPIC_MODEL="claude-sonnet-4.6"
export ANTHROPIC_SMALL_FAST_MODEL="claude-haiku-4.5"
export DISABLE_TELEMETRY=1
export DISABLE_AUTOUPDATER=1

Reload your shell with source ~/.zshrc (or ~/.bashrc).

Windows PowerShell

PowerShell profile ($PROFILE)powershell
$env:ANTHROPIC_BASE_URL = "https://api2.claudestore.store"
$env:ANTHROPIC_API_KEY = "YOUR_SK_CS2_KEY"
$env:ANTHROPIC_MODEL = "claude-sonnet-4.6"
$env:ANTHROPIC_SMALL_FAST_MODEL = "claude-haiku-4.5"
$env:DISABLE_TELEMETRY = "1"
$env:DISABLE_AUTOUPDATER = "1"

4. User-Level Settings File

Create ~/.claude/settings.json so Claude Code picks the same configuration even when env vars are not loaded (e.g. inside the VS Code extension):

~/.claude/settings.json (canonical)json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api2.claudestore.store",
    "ANTHROPIC_API_KEY": "YOUR_SK_CS2_KEY",
    "ANTHROPIC_MODEL": "claude-sonnet-4.6",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4.5",
    "DISABLE_TELEMETRY": "1",
    "DISABLE_AUTOUPDATER": "1"
  }
}

Use only ANTHROPIC_API_KEY

Claude Code accepts both ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN. For ClaudeStore use only ANTHROPIC_API_KEY.ANTHROPIC_AUTH_TOKEN is reserved for Anthropic's OAuth-based Claude Pro/Max login and will not authenticate against this gateway.

5. Project-Level Override (optional)

If a repository ships its own .claude/settings.json at the project root, it will be merged on top of the user-level file. Make sure both agree — otherwise the project file silently overrides your global config:

.claude/settings.json (project root)json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api2.claudestore.store",
    "ANTHROPIC_API_KEY": "YOUR_SK_CS2_KEY",
    "ANTHROPIC_MODEL": "claude-sonnet-4.6",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4.5",
    "DISABLE_TELEMETRY": "1",
    "DISABLE_AUTOUPDATER": "1"
  },
  "model": "claude-sonnet-4.6"
}

6. Verify the Connection

Run all three checks before launching the CLI for the first time:

Health check (no auth)bash
curl https://api2.claudestore.store/healthz
Models catalog (auth required)bash
curl https://api2.claudestore.store/v1/models \
  -H "Authorization: Bearer $ANTHROPIC_API_KEY"
End-to-end CLI smoke testbash
claude --print "reply with exactly: pong"

You should see pong in stdout. If you do, the gateway, key, and model resolution are all working.

Troubleshooting

Project settings override user settings

A project-level .claude/settings.json at the repository root takes precedence over ~/.claude/settings.json. If the CLI suddenly stops connecting after switching directories, check whether the project ships its own settings file pointing at a different base URL or key.

Custom API key was previously rejected

If Claude Code refused this key in an earlier session (for example after an auth error), it stores the key fingerprint as rejected inside ~/.claude.json. Subsequent runs will keep blocking that key or repeatedly ask you to confirm it.

Fix: open ~/.claude.json and either approve the custom API key explicitly, or move its fingerprint from the rejected list into the approved list. Then restart the CLI.

401 / 403 from the gateway

The key is wrong, revoked, or you are sending it as ANTHROPIC_AUTH_TOKEN. Re-export it as ANTHROPIC_API_KEY and confirm it appears in env | grep ANTHROPIC.

Common Claude Code configuration mistakes

UI model and ANTHROPIC_MODEL conflict

One of the most common mistakes: you pick a model in the Claude Code UI (for example opus[1m]), but the requests on the wire actually go out as a different model (for example claude-sonnet-4.6). The 1M context window or the selected effort never seem to apply.

This usually happens when ~/.claude/settings.json contains both:

  • a top-level "model": "opus[1m]" (the UI / picker selection), and
  • an env.ANTHROPIC_MODEL that points at a different model.

ANTHROPIC_MODEL is an environment override and will win over the UI selection for outgoing requests.ANTHROPIC_SMALL_FAST_MODEL is similar but only affects internal small/fast paths (summaries, lightweight steps) — it is not necessarily a bug, but it explains why some calls go to a different, cheaper model.

Pick one source of truth for the model

Don't keep a UI-selected model and a conflicting ANTHROPIC_MODEL at the same time if you expect the picker to be authoritative.

Checklist: wrong model is being used

If any of the following is happening:

  • the model shown in the UI doesn't match the model you see being charged,
  • the 1m context flag isn't applied,
  • your effort setting doesn't seem to take effect,
  • Sonnet is used unexpectedly instead of Opus (or vice versa).

Check, in this order:

  1. ~/.claude/settings.json — does env.ANTHROPIC_MODEL conflict with the top-level "model"?
  2. .claude/settings.json in the project root — same check, project file wins over the user file.
  3. Shell environment: env | grep ANTHROPIC — any ANTHROPIC_MODEL or ANTHROPIC_SMALL_FAST_MODEL exported from ~/.zshrc / ~/.bashrc / PowerShell profile?
  4. VS Code / Claude Code extension settings — the extension may inherit its own environment with an ANTHROPIC_MODEL override.

Remove the conflicting override (or align both values), restart the CLI / VS Code, and try again.

Windows setup (full walkthrough)

The Linux/macOS instructions above work on Windows too, but PATH, env vars, and config paths behave differently. This section is a standalone Windows recipe.

1. Install Node.js LTS

Download the LTS installer from nodejs.org. Open a fresh PowerShell window and verify:

node -v
npm -v

2. Install Claude Code globally

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

If claude is "not recognized", reopen PowerShell — npm's global bin folder (%APPDATA%\npm) is added to PATH only in new shells.

3. Persist environment variables

$env:... only lives in the current shell. Use setx to write them permanently to your user profile:

PowerShell (run once)powershell
setx ANTHROPIC_BASE_URL "https://api2.claudestore.store"
setx ANTHROPIC_API_KEY "YOUR_SK_CS2_KEY"
setx ANTHROPIC_MODEL "claude-sonnet-4.6"
setx ANTHROPIC_SMALL_FAST_MODEL "claude-haiku-4.5"
setx DISABLE_TELEMETRY "1"
setx DISABLE_AUTOUPDATER "1"

GUI alternative: Win+Rsysdm.cpl → Advanced → Environment Variables → User variables.

setx never updates the current terminal. Close it, open a new PowerShell, then run claude.

4. settings.json on Windows

Claude Code reads %USERPROFILE%\.claude\settings.json (e.g. C:\Users\<you>\.claude\settings.json). Create the folder and file:

mkdir $env:USERPROFILE\.claude -ErrorAction SilentlyContinue
notepad $env:USERPROFILE\.claude\settings.json

Paste the same JSON shown in section 4 above.

5. WSL / Remote-WSL

Variables set with setx do NOT propagate into WSL. Inside the WSL distro, also add to ~/.bashrc:

~/.bashrc (inside WSL)bash
export ANTHROPIC_BASE_URL="https://api2.claudestore.store"
export ANTHROPIC_API_KEY="YOUR_SK_CS2_KEY"
export ANTHROPIC_MODEL="claude-sonnet-4.6"
export ANTHROPIC_SMALL_FAST_MODEL="claude-haiku-4.5"

6. Windows-specific troubleshooting

  • "claude is not recognized" — open a new PowerShell, or add %APPDATA%\npm to PATH manually.
  • PowerShell quoting — always wrap values in double quotes; cmd.exe quoting is different and breaks URLs.
  • Corporate proxy: setx HTTPS_PROXY "http://proxy.company:8080".
  • Antivirus / SmartScreen — whitelist api2.claudestore.store and the node.exe binary.
  • Long path errors on global npm install — enable Win10/11 long paths via git config --system core.longpaths true or the LongPathsEnabled registry tweak.

Ready to start?

Get API access to all Claude models in under 2 minutes.

View Plans