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.
CLI setup
Section titled “CLI setup”To get started, use the onboard command. I recommend picking the option that matches your region and plan to keep things running fast.
# Coding Plan Global, recommended for Coding Plan usersopenclaw onboard --auth-choice zai-coding-global
# Coding Plan CN (China region), recommended for Coding Plan usersopenclaw onboard --auth-choice zai-coding-cn
# General APIopenclaw onboard --auth-choice zai-global
# General API CN (China region)openclaw onboard --auth-choice zai-cnConfig snippet
Section titled “Config snippet”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, andglm-4.6. - For provider details, see /providers/zai.
Next steps
Section titled “Next steps”- Check out the Z.AI provider details for more context.
- Learn how to customize your Agent configuration.
Need help with your configuration? Use the AI Setup Assistant.
OpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.