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.

Ready to start?

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

View Plans