OpenClaw Installation and Configuration Guide

This guide explains how to install OpenClaw and configure it to use CC Club’s API proxy.

About this document This document focuses on helping you configure the CC Club baseUrl and apiKey in OpenClaw, so you can access Claude without restrictions. For other OpenClaw features and detailed documentation, refer to the official documentation.

System Requirements

ItemMinimumRecommended
Node.js≥ 22.12.0Latest LTS
Memory1GB4GB+
Operating systemmacOS 12+ / Ubuntu 20.04+ / Windows 10+macOS 14+

1. Install OpenClaw

macOS / Linux / WSL2:

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

Windows (PowerShell):

iwr -useb https://openclaw.ai/install.ps1 | iex

The install script automatically detects your environment, installs the CLI, and runs the onboarding wizard. To skip the wizard and only install the CLI:

curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard

2. Run the Onboarding Wizard

After installation, run the onboarding to complete the initial configuration:

openclaw onboard --install-daemon

The wizard will guide you through:

  1. Selecting a model provider (choose Anthropic)
  2. Entering your API key
  3. Setting up the Gateway (port, authentication method)
  4. Configuring messaging channels (Telegram / WhatsApp / Discord, etc.)
  5. Installing the background service (launchd / systemd / Windows scheduled task)

3. Configure the CC Club API Proxy

⚠️

Important: Using CC Club requires manually configuring two things: the API key and a custom baseUrl.

Configuration File Locations

OpenClaw’s configuration directory:

~/.openclaw/
├── openclaw.json               # Main configuration file
├── .env                        # Environment variables (API keys and other sensitive info)
└── agents/main/agent/
    └── auth-profiles.json      # API key credentials

Step 1: Write Your API Key

Edit ~/.openclaw/agents/main/agent/auth-profiles.json (Windows: C:\Users\<username>\.openclaw\agents\main\agent\auth-profiles.json):

{
  "version": 1,
  "profiles": {
    "anthropic:default": {
      "type": "api_key",
      "provider": "anthropic",
      "key": "your-CC-Club-API-Key"
    }
  },
  "lastGood": {
    "anthropic": "anthropic:default"
  }
}

You can also configure this via the command line:

openclaw onboard --auth-choice apiKey --anthropic-api-key your-CC-Club-API-Key

Step 2: Configure the Custom baseUrl

Edit ~/.openclaw/openclaw.json and add a models section:

{
  "models": {
    "mode": "merge",
    "providers": {
      "anthropic": {
        "baseUrl": "https://claude-code.club/api",
        "models": []
      }
    }
  }
}

"models": [] is required. Leaving it empty means the provider’s default model list will be used. Omitting this field will cause a configuration validation error:

Invalid config: models.providers.anthropic.models: expected array, received undefined

CC Club API Nodes

Choose the best node based on your network conditions:

AddressDescription
https://claude-code.club/apiDefault address (fastest when direct connection latency < 100ms)
https://jp.claude-code.club/apiJapan node (Alibaba Cloud, optimized for China)
https://hk.claude-code.club/apiHong Kong node (Alibaba Cloud, optimized for China)

Enter one of the above addresses in the models.providers.anthropic.baseUrl field of openclaw.json.

Step 3: Restart the Gateway

launchctl stop ai.openclaw.gateway
launchctl start ai.openclaw.gateway

Or:

kill $(lsof -ti :18789) && openclaw gateway

4. Complete Configuration Example

Here is a complete openclaw.json example using CC Club:

{
  "meta": {
    "lastTouchedVersion": "2026.2.19"
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4-6"
      },
      "workspace": "~/.openclaw/workspace",
      "compaction": {
        "mode": "safeguard"
      }
    }
  },
  "models": {
    "mode": "merge",
    "providers": {
      "anthropic": {
        "baseUrl": "https://claude-code.club/api",
        "models": []
      }
    }
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto"
  },
  "gateway": {
    "mode": "local",
    "auth": {
      "mode": "token",
      "token": "your-gateway-token"
    },
    "port": 18789
  }
}

Key configuration notes:

Config keyDescriptionExample value
agents.defaults.model.primaryDefault model to use — requires provider prefixanthropic/claude-sonnet-4-6
models.providers.anthropic.baseUrlCC Club API addresshttps://claude-code.club/api
models.providers.anthropic.modelsModel list — leave empty to use defaults[]
gateway.auth.tokenDashboard access tokenGenerate with openssl rand -hex 32
gateway.portGateway listening port18789

5. Start the Gateway

# Foreground (for debugging)
openclaw gateway --port 18789 --verbose
 
# Background service (recommended)
openclaw onboard --install-daemon

When the Gateway starts successfully, it will display:

[gateway] listening on ws://127.0.0.1:18789 (PID xxxxx)

Service Management

# Check status
launchctl list | grep openclaw
 
# Stop / Start
launchctl stop ai.openclaw.gateway
launchctl start ai.openclaw.gateway

6. Access the Dashboard

# Open automatically (recommended)
openclaw dashboard
 
# Or navigate manually
# http://127.0.0.1:18789/#token=your-gateway-token

Dashboard features:

FeatureDescription
ChatChat directly with AI
AgentsManage agent sessions and history
ChannelsView channel status
ModelsView available models
SettingsConfigure tokens, themes, etc.

7. Configure Messaging Channels

Telegram

Create a Bot

Open Telegram, find @BotFather, send /newbot, set a name and username as prompted, and obtain the Bot Token (format: 123456789:ABCDEF...).

Configure the Channel

Add the following to ~/.openclaw/openclaw.json:

{
  "channels": {
    "telegram": {
      "enabled": true,
      "dmPolicy": "open",
      "allowFrom": ["*"],
      "groupPolicy": "allowlist",
      "streamMode": "partial"
    }
  },
  "plugins": {
    "entries": {
      "telegram": { "enabled": true }
    }
  }
}

Set the Bot Token

# ~/.openclaw/.env
TELEGRAM_BOT_TOKEN=123456789:ABCDEF...

Pair with Telegram

Send a message to your Bot in Telegram. The Bot will return a pairing code, which you then approve on the server:

openclaw pairing approve telegram XXXXXXXX

Discord / Slack / WhatsApp

WhatsApp requires scanning a QR code to log in:

openclaw channels login --channel whatsapp

For Discord and Slack, configure the Bot Token in .env — see the official documentation for details.

8. Complete Ubuntu Server Setup

Full steps for deploying OpenClaw on a remote Ubuntu server:

Install Node.js (via nvm)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
\. "$HOME/.nvm/nvm.sh"
nvm install 24

Install OpenClaw

npm install -g openclaw@latest

Configure CC Club API Key

Edit ~/.openclaw/agents/main/agent/auth-profiles.json:

{
  "version": 1,
  "profiles": {
    "anthropic:default": {
      "type": "api_key",
      "provider": "anthropic",
      "key": "cr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    }
  },
  "lastGood": {
    "anthropic": "anthropic:default"
  }
}

Configure the Custom baseUrl

Edit ~/.openclaw/openclaw.json:

{
  "models": {
    "mode": "merge",
    "providers": {
      "anthropic": {
        "baseUrl": "https://claude-code.club/api",
        "models": []
      }
    }
  }
}

Run the Onboarding Wizard

openclaw onboard --install-daemon

Select the Anthropic model in the wizard and configure your Telegram Bot Token.

Pair with Telegram

openclaw pairing approve telegram XXXXXXXX

9. Troubleshooting

API Key Error: No API key found for provider "anthropic"

Checklist:

  1. Confirm the file exists: ~/.openclaw/agents/main/agent/auth-profiles.json
  2. Confirm the format is correct (refer to Section 3)
  3. Restart the Gateway

Configuration File Validation Failure

Invalid config: models.providers.anthropic.models: expected array, received undefined

Fix: Add "models": [] under models.providers.anthropic in openclaw.json.

Gateway Port Already in Use

Port 18789 is already in use. pid xxxxx

Fix (Linux/macOS):

kill $(lsof -ti :18789)

Fix (Windows):

Stop-Process -Id <pid> -Force

TUI shows pairing required or device token mismatch

# Clear old device pairing files
rm -f ~/.openclaw/devices/paired.json \
      ~/.openclaw/identity/device-auth.json \
      ~/.openclaw/identity/device.json
 
# Restart Gateway
systemctl --user restart openclaw-gateway.service
 
# Verify status
sleep 5 && openclaw gateway status

Dashboard shows “unauthorized”

Access with a token-bearing URL:

http://localhost:18789/#token=your-gateway-token

Or view the current token:

openclaw config get gateway.auth.token

Verify Proxy Reachability

curl -X POST "https://claude-code.club/api/v1/messages" \
  -H "x-api-key: your-API-Key" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{"model":"claude-sonnet-4-6","max_tokens":64,"messages":[{"role":"user","content":"hi"}]}'

Update OpenClaw

# Stable release (recommended)
openclaw update --channel stable
 
# Or update directly via npm
npm update -g openclaw

Quick Command Reference

openclaw --version              # Show version
openclaw doctor                 # Diagnose configuration issues
openclaw doctor --repair        # Auto-fix configuration
openclaw gateway --verbose      # Start Gateway (verbose logging)
openclaw dashboard              # Open Dashboard
openclaw status                 # Show running status
openclaw onboard                # Re-run the onboarding wizard
openclaw tui                    # Open the terminal interactive interface
openclaw logs --follow          # Stream logs in real time
openclaw update --channel stable # Update to stable release

Comparison with Claude Code

ItemClaude CodeOpenClaw
PurposeCommand-line coding assistantSelf-hosted multi-channel AI gateway
Configuration toolCC Switch / environment variablesManual JSON editing
Configuration file~/.claude/settings.json~/.openclaw/openclaw.json
API key storageEnvironment variablesauth-profiles.json
InterfaceCommand lineWeb Dashboard
Messaging platformsTerminalTelegram, WhatsApp, and 20+ more

References

Note: Compared to Claude Code, OpenClaw may consume more quota because it needs to handle more channels and context requests.


MIT 2026 © Nextra.
加入社群CC Club返回官网