Claude Code

Connect Claude Code to APIClaw using settings.json.

Watch the setup walkthrough:

Open video on YouTube

1. Install Claude Code

macOS / Linux:

bash
curl -fsSL https://claude.ai/install.sh | bash

Windows (PowerShell):

powershell
irm https://claude.ai/install.ps1 | iex

Create an API key in the API Keys dashboard if you do not have one yet. Copy a full model ID from the model hub.

2. Open settings.json

Open (or create) Claude Code's settings file:

OSPath
Windows%USERPROFILE%\.claude\settings.json
macOS / Linux~/.claude/settings.json

Windows tip: press Win + R, paste %USERPROFILE%\.claude\, and open settings.json in any text editor. Create the .claude folder and the file if they do not exist yet.

3. Replace the file contents

Delete everything inside settings.json, then paste this:

json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://apiclaw.biz",
    "ANTHROPIC_AUTH_TOKEN": "API_key",
    "ANTHROPIC_MODEL": "YOUR_MODEL_ID",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
  }
}

Save the file.

Replace YOUR_MODEL_ID with the exact ID from the model hub. Use https://apiclaw.biz (no /v1) for ANTHROPIC_BASE_URL; Claude Code appends the Anthropic paths itself.

4. Put your APIClaw API key in the file

Replace API_key with the virtual key you created on APIClaw.

Example:

json
"ANTHROPIC_AUTH_TOKEN": "sk-your-apiclaw-key"

Do not commit this file with a real key. Keep the key private.

5. Verify

Open a terminal and run:

bash
claude

Inside Claude Code, run:

text
/status

You should see Anthropic base URL: https://apiclaw.biz and your auth token source. Send a short prompt, then confirm the request appears in logs.

Troubleshooting

Still connecting to api.anthropic.com

Close Claude Code completely, confirm ANTHROPIC_BASE_URL is exactly https://apiclaw.biz, save settings.json, then start claude again.

401 authentication errors

Paste the key again with no extra spaces. Confirm the key is active in the API Keys dashboard.

Claude Code asks you to sign in to Anthropic

Make sure ANTHROPIC_AUTH_TOKEN is set in ~/.claude/settings.json (or %USERPROFILE%\.claude\settings.json on Windows), not only in a project folder. Restart Claude Code after saving.