Skip to main content

Z.AI

Z.AI is the API platform for GLM models developed by ZhipuAI. It provides a REST API for GLM model access using API key authentication. WednesdayAI uses the zai provider to connect to Z.AI.

Prerequisites

Quick setup

1. Get an API key

Sign in to the Z.AI console and create an API key. Keys typically start with sk-. Store it on the gateway host:
echo 'ZAI_API_KEY=sk-...' >> ~/.openclaw/.env

2. Run onboarding

openclaw onboard --auth-choice zai-api-key
Or non-interactive:
openclaw onboard --zai-api-key "$ZAI_API_KEY"

3. Configure

{
  models: {
    providers: {
      zai: {
        apiKey: "ZAI_API_KEY", // references the env var
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "zai/glm-5" },
    },
  },
}
apiKey is the name of the environment variable, not the key value itself. Keep secrets in .env, not in committed config files.

Provider settings

SettingValue
Provider IDzai
Auth env varZAI_API_KEY
Auth methodBearer token
Tool streamingEnabled by default

Available models

GLM models are referenced as zai/<model-id>:
Model IDNotes
zai/glm-5Current flagship
zai/glm-4.7GLM 4.7
zai/glm-4.6GLM 4.6
zai/glm-4-flashFaster, lower-cost variant
Check the Z.AI platform for the current model catalog — GLM versions are updated regularly.
To disable tool-call streaming for a specific model:
{
  agents: {
    defaults: {
      models: {
        "zai/glm-5": {
          params: { tool_stream: false },
        },
      },
    },
  },
}

Verification

openclaw models status --probe-provider zai

Troubleshooting

Verify ZAI_API_KEY is set correctly in ~/.openclaw/.env and the key is active in the Z.AI console.
GLM model IDs are versioned. Check the Z.AI console for the current list and update your config accordingly.