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:
npm install -g @anthropic-ai/claude-codeVerify the binary is on your $PATH:
claude --version2. Get an API Key
The Claude Code gateway uses v2 keys with the prefix sk-cs2-:
- Open the Gateway v2 → Keys page in the dashboard
- Click New v2 key, give it a name, and copy the
sk-cs2-…value (shown once) - Top up the v2 credit pool from the Plans page if needed
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
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=1Reload your shell with source ~/.zshrc (or ~/.bashrc).
Windows 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):
{
"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
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:
{
"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:
curl https://api2.claudestore.store/healthzcurl https://api2.claudestore.store/v1/models \
-H "Authorization: Bearer $ANTHROPIC_API_KEY"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.