2026-01-11 02:27:30 +01:00
|
|
|
---
|
2026-01-30 03:15:10 +01:00
|
|
|
summary: "Use Z.AI (GLM models) with OpenClaw"
|
2026-01-11 02:27:30 +01:00
|
|
|
read_when:
|
2026-01-30 03:15:10 +01:00
|
|
|
- You want Z.AI / GLM models in OpenClaw
|
2026-01-11 02:27:30 +01:00
|
|
|
- You need a simple ZAI_API_KEY setup
|
2026-01-31 16:04:03 -05:00
|
|
|
title: "Z.AI"
|
2026-01-11 02:27:30 +01:00
|
|
|
---
|
2026-01-31 21:13:13 +09:00
|
|
|
|
2026-01-11 02:27:30 +01:00
|
|
|
# Z.AI
|
|
|
|
|
|
|
|
|
|
Z.AI is the API platform for **GLM** models. It provides REST APIs for GLM and uses API keys
|
2026-01-30 03:15:10 +01:00
|
|
|
for authentication. Create your API key in the Z.AI console. OpenClaw uses the `zai` provider
|
2026-01-11 02:27:30 +01:00
|
|
|
with a Z.AI API key.
|
|
|
|
|
|
|
|
|
|
## CLI setup
|
|
|
|
|
|
|
|
|
|
```bash
|
2026-01-30 03:15:10 +01:00
|
|
|
openclaw onboard --auth-choice zai-api-key
|
2026-01-11 02:27:30 +01:00
|
|
|
# or non-interactive
|
2026-01-30 03:15:10 +01:00
|
|
|
openclaw onboard --zai-api-key "$ZAI_API_KEY"
|
2026-01-11 02:27:30 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Config snippet
|
|
|
|
|
|
|
|
|
|
```json5
|
|
|
|
|
{
|
|
|
|
|
env: { ZAI_API_KEY: "sk-..." },
|
2026-02-12 19:16:04 +01:00
|
|
|
agents: { defaults: { model: { primary: "zai/glm-5" } } },
|
2026-01-11 02:27:30 +01:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Notes
|
|
|
|
|
|
2026-02-12 19:16:04 +01:00
|
|
|
- GLM models are available as `zai/<model>` (example: `zai/glm-5`).
|
2026-02-17 09:22:26 -05:00
|
|
|
- `tool_stream` is enabled by default for Z.AI tool-call streaming. Set
|
|
|
|
|
`agents.defaults.models["zai/<model>"].params.tool_stream` to `false` to disable it.
|
2026-01-11 02:27:30 +01:00
|
|
|
- See [/providers/glm](/providers/glm) for the model family overview.
|
|
|
|
|
- Z.AI uses Bearer auth with your API key.
|