OpenClaw Tutorial
What is OpenClaw?
OpenClaw is a powerful AI programming assistant tool that supports interacting with AI models via Web UI or command line. It provides rich configuration options and a plugin system, and canconnect to various AI model providers, making it a powerful tool for developers to boost programming efficiency.
Web UI Interface
Provides a friendly web interface for easy viewing and managing conversations
Multi-Model Support
Supports various AI models including Claude, GPT, etc.
Plugin System
Rich plugin ecosystem for extending functionality
Highly Configurable
Supports custom contextWindow, maxTokens and other parameters
Installation Steps
Prerequisites
Ensure Node.js ≥ 22 is installed. You can check the version with the following command:
Check Node.js Version
node --versionInstall OpenClaw
Run the following command in the terminal to install OpenClaw globally:
Install Command
npm install -g openclaw@latest
# or use pnpm
pnpm add -g openclaw@latestConfiguration Guide
1. Start Initialization
After installation, run the following command to start the initialization wizard:
Init Command
openclaw onboard --install-daemon2. Configuration Wizard Steps
Follow the wizard prompts to configure. Key steps are as follows:
Install daemon? - Select yes
Onboarding mode - Select the first option
Model/auth provider - Select Custom Provider (Any OpenAI or Anthropic compatible endpoint)
API Base URL - Enter https://aifusion.network/
API KeyEnter the API Key obtained from the console (see notes below)
Endpoint compatibility - Select AnthroEnterc-compatible (Uses /messages)
Model ID - Enter claude-opus-4-6-thinking(or other models)
Endpoint ID - Use default value
Model alias - Optional, e.g., enter opus4.6
Subsequent QuickStart, Skills, Hooks and other options can be selected as needed. For first-time use, you can skip all of them.
How do you want to hatch your bot? - Select Open the Web UI for easy viewing
3. Get API KGo to
前往 SpritNest Tokenpage to create a token:
Click "Add Token"
Enter a name (any), select default for group
Leave the model restriction list and IP whitelist empty, and click Submit directly
Copy the generated Key and paste it into the OpenClaw configuration
4. Optimize Configuration File
After initialization, edit the configuration file ~/.openclaw/openclaw.json,优化以下参数:
Increase contextWindow from 4096 to 200000
Increase maxTokens from 4096 to 8192
Confirm baseUrl is https://aifusion.network/
Configuration File Example
{
"models": {
"providers": {
"custom-api-spritnest-com": {
"baseUrl": "https://aifusion.network/",
"apiKey": "sk-your-api-key",
"api": "anthropic-messages",
"models": [{
"id": "claude-opus-4-6-thinking",
"contextWindow": 200000,
"maxTokens": 8192
}]
}
}
}
}Basic Usage
After configuration, OpenClaw will automatically open the Web UI interface. You can interact with AI in the browser for code writing, Q&A, and other operations.
Usage Tips
For first-time use, it is recommended to test with simple conversations first, and confirm the configuration is correct before proceeding with complex programming tasks.You can also let AI help you configure other toolsInstallnd plugins.
