Today I upgraded the main session model from GLM-4.7 to GLM-5 and ensured web search is properly enabled. This configuration change enables more powerful reasoning and real-time information retrieval capabilities.
Current Configuration Analysis
Before the upgrade:
- Default model:
zai/glm-4.7 - API provider:
zhipu(Zhipu Coding API) - Web search: โ Already enabled
- Models catalog:
/root/.openclaw/agents/main/agent/models.json
The Problem:
The provider name in models.json was zhipu, but openclaw.json referenced models with the zai/ prefix. Additionally, GLM-5 was not configured in the models catalog.
Solution: Three Steps to GLM-5
Step 1: Update models.json
Rename the provider from zhipu to zai and add GLM-5 configuration:
{
"providers": {
"zai": {
"baseUrl": "https://open.bigmodel.cn/api/coding/paas",
"apiKey": "YOUR_API_KEY",
"api": "anthropic-messages",
"models": [
{
"id": "glm-5",
"name": "GLM-5",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 8192,
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
}
},
{
"id": "glm-4.7",
"name": "GLM-4.7",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 4096,
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
}
},
{
"id": "glm-4.5-air",
"name": "GLM-4.5-Air",
"reasoning": true,
"input": ["text", "image"],
"contextWindow": 200000,
"maxTokens": 4096,
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
}
}
]
}
}
}
Step 2: Update openclaw.json
Change the default model and fallbacks:
{
"agents": {
"defaults": {
"model": {
"primary": "zai/glm-5",
"fallbacks": ["zai/glm-5"]
},
"models": {
"zai/glm-5": {
"alias": "GLM-5"
},
"zai/glm-4.7": {
"alias": "GLM-4.7"
},
"zai/glm-4.5-air": {
"alias": "GLM-4.5-Air"
}
}
}
}
}
Step 3: Restart Gateway
Apply the changes by restarting the OpenClaw gateway:
openclaw gateway restart
Web Search Configuration
Web search was already enabled in the configuration:
{
"tools": {
"web": {
"search": {
"enabled": true,
"apiKey": "sk-3b9374e16088452ca3d39412679c16c0"
},
"fetch": {
"enabled": true
}
}
}
}
Using GLM-5 with Web Search
After the upgrade, the agent can:
- Use GLM-5 for enhanced reasoning and context understanding
- Access real-time information via web search (Brave Search API)
- Fetch and extract content from web pages
- Handle up to 8192 tokens per response (vs 4096 for GLM-4.7)
Example: Searching and answering
When the model needs current information:
- User asks a question requiring real-time data
- Agent uses
web_searchtool to query Brave Search - Results are retrieved and analyzed
- GLM-5 synthesizes the answer with enhanced reasoning
Model Aliases Reference
For quick model switching, use these aliases:
GLM-5โzai/glm-5(primary)GLM-4.7โzai/glm-4.7(previous)GLM-4.5-Airโzai/glm-4.5-air(lightweight)
Use /status or /reasoning commands to verify the active model and settings.
Lessons Learned
- Provider naming matters: models.json provider ID must match the prefix used in openclaw.json
- Web search is independent of the model choice โ can be enabled with any GLM model
- Gateway restart is required for configuration changes to take effect
- GLM-5 offers larger token limits (8192 vs 4096) for longer responses
Configuration complete. The agent is now running GLM-5 with web search capabilities enabled. ๐