> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wednesdayai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# GLM Models

> Use ZhipuAI's GLM model family in WednesdayAI via the Z.AI platform.

# GLM Models

GLM is a model family developed by ZhipuAI, available through the [Z.AI](https://z.ai) platform. In WednesdayAI, GLM models are accessed via the `zai` provider using model IDs like `zai/glm-5`.

<Note>
  GLM is a model family, not a separate provider. All GLM access goes through the Z.AI provider. See the [Z.AI provider page](/admin/providers/zai) for full setup instructions.
</Note>

## Quick setup

### 1. Get a Z.AI API key

Create an API key in the [Z.AI console](https://z.ai) and store it:

```bash theme={"dark"}
echo 'ZAI_API_KEY=sk-...' >> ~/.openclaw/.env
```

### 2. Run onboarding

```bash theme={"dark"}
openclaw onboard --auth-choice zai-api-key
```

### 3. Configure

```json5 theme={"dark"}
{
  models: {
    providers: {
      zai: {
        apiKey: "ZAI_API_KEY", // references the env var
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "zai/glm-5" },
    },
  },
}
```

<Note>
  `apiKey` is the name of the environment variable, not the key value itself. Keep secrets in `.env`, not in committed config files.
</Note>

## Provider settings

| Setting      | Value         |
| ------------ | ------------- |
| Provider ID  | `zai`         |
| Auth env var | `ZAI_API_KEY` |
| Auth method  | Bearer token  |

## Available models

GLM model IDs use the `zai/<model-id>` prefix:

| Model ID          | Notes                      |
| ----------------- | -------------------------- |
| `zai/glm-5`       | Current flagship GLM model |
| `zai/glm-4.7`     | GLM 4.7                    |
| `zai/glm-4.6`     | GLM 4.6                    |
| `zai/glm-4-flash` | Faster, lower-cost variant |

<Note>
  GLM versions and availability change over time. Check Z.AI's documentation for the current model catalog.
</Note>

## Verification

```bash theme={"dark"}
openclaw models status --probe-provider zai
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    Verify `ZAI_API_KEY` is set correctly in `~/.openclaw/.env`. Re-run `openclaw onboard --auth-choice zai-api-key` to refresh the stored credential.
  </Accordion>

  <Accordion title="Model not found">
    Check the current GLM model catalog in the Z.AI console — model IDs are versioned and may change.
  </Accordion>
</AccordionGroup>

## Related

* [Z.AI provider](/admin/providers/zai)
* [AI providers overview](/admin/providers/index)
* [Reference: config](/reference/config)
