Skip to content

Integrate GLM Models into OpenClaw: Quick Setup Guide

Ever feel like you’re stuck with one model when you need more variety? Finding a model that fits your specific coding workflow or region can be a headache. If you want to try something different, the GLM family on the Z.AI platform is a solid choice.

GLM is a model family available through the Z.AI platform. In OpenClaw, you access these models via the zai provider and model IDs like zai/glm-5.

To get started, use the onboard command. I recommend picking the option that matches your region and plan to keep things running fast.

Terminal window
# Coding Plan Global, recommended for Coding Plan users
openclaw onboard --auth-choice zai-coding-global
# Coding Plan CN (China region), recommended for Coding Plan users
openclaw onboard --auth-choice zai-coding-cn
# General API
openclaw onboard --auth-choice zai-global
# General API CN (China region)
openclaw onboard --auth-choice zai-cn

If you prefer manual configuration, you can drop this snippet into your config file. It sets your API key and makes GLM the primary model for your agents.

{
env: { ZAI_API_KEY: "sk-..." },
agents: { defaults: { model: { primary: "zai/glm-5" } } },
}

Keep these points in mind when working with GLM:

  • GLM versions and availability can change; check Z.AI’s docs for the latest.
  • Example model IDs include glm-5.1, glm-5, glm-5v-turbo, glm-4.7, and glm-4.6.
  • For provider details, see /providers/zai.

Need help with your configuration? Use the AI Setup Assistant.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.