Skip to content

Z.AI

Z.AI 是 GLM 系列模型的 API 平台,提供 REST API 并通过 API Key 认证。你可以在 Z.AI 控制台创建密钥,OpenClaw 通过 zai 提供商对接 Z.AI。

CLI 配置

bash
# Coding Plan 全球版(推荐 Coding Plan 用户使用)
openclaw onboard --auth-choice zai-coding-global

# Coding Plan 国内版(推荐 Coding Plan 用户使用)
openclaw onboard --auth-choice zai-coding-cn

# 通用 API 全球版
openclaw onboard --auth-choice zai-global

# 通用 API 国内版
openclaw onboard --auth-choice zai-cn

配置示例

json5
{
  env: { ZAI_API_KEY: "sk-..." },
  agents: { defaults: { model: { primary: "zai/glm-5" } } },
}

注意事项

  • GLM 模型通过 zai/<model> 形式引用(例如:zai/glm-5)。
  • Z.AI 默认开启 tool_stream,支持工具调用流式输出。若需关闭,将 agents.defaults.models["zai/<model>"].params.tool_stream 设为 false
  • 参见 /openclaw/providers/glm 了解 GLM 模型系列详情。
  • Z.AI 使用 Bearer 认证,以你的 API Key 作为凭据。

让你的龙虾学会说中文——配上 GLM,国产大模型也能跑得飞起。