Skip to content

OpenClaw Configuration

What is OpenClaw

OpenClaw is an open-source personal AI assistant framework that supports chatting with AI through Telegram, Discord, WhatsApp, and other platforms.

Installation

macOS / Linux

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

Windows (PowerShell)

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

npm Installation

bash
npm install -g openclaw@latest

Initialize Configuration

Run the onboard command to initialize:

bash
openclaw onboard --install-daemon

Configure ai.TokenHub

OpenClaw supports OpenAI-compatible protocol and can directly configure ai.TokenHub as an API provider.

Method 1: Using onboard Wizard

? Select your AI provider:
> Custom (Third-party/Aggregation Platform)

? Enter the base URL:
https://ai-tokenhub.com/v1

? Enter your API Key:
your_api_key_here

Method 2: Manual Configuration

Edit the config file ~/.openclaw/openclaw.json:

json
{
  "model": "anthropic/claude-sonnet-4-20250514",
  "models": {
    "providers": {
      "openai": {
        "apiKey": "your_api_key_here",
        "baseURL": "https://ai-tokenhub.com/v1"
      }
    }
  }
}

Model Configuration

Using Claude Models

json
{
  "models": {
    "providers": {
      "anthropic": {
        "apiKey": "your_api_key_here",
        "baseURL": "https://ai-tokenhub.com/v1"
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4-20250514"
      }
    }
  }
}

Using GPT Models

json
{
  "models": {
    "providers": {
      "openai": {
        "apiKey": "your_api_key_here",
        "baseURL": "https://ai-tokenhub.com/v1"
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "openai/gpt-4o"
      }
    }
  }
}

Configure Multiple Models

json
{
  "models": {
    "mode": "merge",
    "providers": {
      "anthropic": {
        "apiKey": "your_api_key_here",
        "baseURL": "https://ai-tokenhub.com/v1"
      },
      "openai": {
        "apiKey": "your_api_key_here",
        "baseURL": "https://ai-tokenhub.com/v1"
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "anthropic/claude-sonnet-4-20250514",
        "fallbacks": [
          "openai/gpt-4o",
          "openai/gpt-4o-mini"
        ]
      }
    }
  }
}

Common Commands

View Configuration

bash
openclaw config show

Check Status

bash
openclaw gateway status

Open Dashboard

bash
openclaw dashboard

Switch Models

Use the /model command in chat to switch models:

/model openai/gpt-4o

FAQ

API Error

Check if the API Key is correct and the account has sufficient balance.

Connection Timeout

Check network connectivity and ensure you can access https://ai-tokenhub.com.

Model Not Found

Ensure the model name is spelled correctly, use /model to select from the list.