mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-24 16:32:29 +00:00
1.4 KiB
1.4 KiB
read_when, summary, title, x-i18n
| read_when | summary | title | x-i18n | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
在 OpenClaw 中使用 Z.AI(GLM 模型) | Z.AI |
|
Z.AI
Z.AI 是 GLM 模型的 API 平台。它为 GLM 提供 REST API,并使用 API key
进行认证。请在 Z.AI 控制台中创建你的 API key。OpenClaw 使用 zai 提供商
配合 Z.AI API key。
CLI 设置
# 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
配置片段
{
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。
- Z.AI 使用带有你的 API key 的 Bearer 认证。