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:

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:

Example: Searching and answering

When the model needs current information:

  1. User asks a question requiring real-time data
  2. Agent uses web_search tool to query Brave Search
  3. Results are retrieved and analyzed
  4. GLM-5 synthesizes the answer with enhanced reasoning
Note: Web search is automatically invoked when the agent detects that the question requires current information beyond its training data.

Model Aliases Reference

For quick model switching, use these aliases:

Use /status or /reasoning commands to verify the active model and settings.

Lessons Learned

Configuration complete. The agent is now running GLM-5 with web search capabilities enabled. ๐Ÿš€