Claude Code

Connect Claude Code to APIClaw through Anthropic-compatible environment variables.

Claude Code is Anthropic's terminal coding assistant. APIClaw supports Anthropic-compatible requests, so you can point Claude Code at APIClaw instead of Anthropic's hosted API.

Prerequisites

  1. Install Claude Code on your machine.
  2. Create an API key in the API Keys dashboard.
  3. Copy a model ID from the model hub if your workflow requires an explicit model override.

Install Claude Code

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

On Windows PowerShell:

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

Skip official onboarding (optional)

If Claude Code keeps asking you to sign in to Anthropic, merge this into ~/.claude.json:

json
{
  "hasCompletedOnboarding": true
}

Configure APIClaw

Add these variables to your shell profile (~/.bashrc, ~/.zshrc, or Windows environment variables):

bash
export APICLAW_API_KEY="sk-your-apiclaw-key"
export ANTHROPIC_BASE_URL="https://apiclaw.biz/v1"
export ANTHROPIC_AUTH_TOKEN="$APICLAW_API_KEY"
export ANTHROPIC_API_KEY=""

Leave ANTHROPIC_API_KEY empty so Claude Code does not fall back to Anthropic's official service.

Reload your shell:

bash
source ~/.zshrc

Verify

bash
cd /path/to/your/project
claude

Inside Claude Code, run:

text
/status

You should see Anthropic base URL: https://apiclaw.biz/v1 and your auth token source. Send a simple prompt to confirm responses arrive and appear in logs.

IDE plugins

The VS Code and JetBrains Claude Code extensions reuse the same environment variables. Launch your IDE from a terminal where the variables above are loaded, or set them in the extension's environment settings.

Troubleshooting

Still connecting to api.anthropic.com

Restart the terminal or IDE after exporting variables. Confirm ANTHROPIC_BASE_URL points to https://apiclaw.biz/v1.

401 authentication errors

Regenerate the API key, remove extra spaces, and confirm the key is active in the dashboard.