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

# Z.AI

# Z.AI

Z.AI 是 **GLM** 模型的 API 平台。它为 GLM 提供 REST API，并使用 API key
进行认证。请在 Z.AI 控制台中创建你的 API key。OpenClaw 使用 `zai` 提供商
配合 Z.AI API key。

## CLI 设置

```bash theme={"theme":{"light":"min-light","dark":"min-dark"}}
# Coding Plan Global，推荐给 Coding Plan 用户
openclaw onboard --auth-choice zai-coding-global

# Coding Plan CN（中国区域），推荐给 Coding Plan 用户
openclaw onboard --auth-choice zai-coding-cn

# 通用 API
openclaw onboard --auth-choice zai-global

# 通用 API CN（中国区域）
openclaw onboard --auth-choice zai-cn
```

## 配置片段

```json5 theme={"theme":{"light":"min-light","dark":"min-dark"}}
{
  env: { ZAI_API_KEY: "sk-..." },
  agents: { defaults: { model: { primary: "zai/glm-5" } } },
}
```

## 说明

* GLM 模型可用作 `zai/<model>`（例如：`zai/glm-5`）。
* `tool_stream` 默认启用，用于 Z.AI 工具调用流式传输。若要禁用，请设置
  `agents.defaults.models["zai/<model>"].params.tool_stream` 为 `false`。
* 关于模型家族概览，请参阅 [/providers/glm](/providers/glm)。
* Z.AI 使用带有你的 API key 的 Bearer 认证。
