转载
https://linux.do/t/topic/822607/18
接入 Claude Code
将智谱最新 GLM-4.5 系列模型集成到 Claude Code 的方法
智谱模型 GLM-4.5 可以通过一个兼容 Anthropic API 的端点与 Claude Code 集成。这意味着可以让 Claude Code 与 GLM-4.5 通信,而不需要修改 Claude Code 的任何代码。
1. 前往获取智谱 API key
前往智谱 Bigmodel 开放平台,获取你的 API key :Key创建地址
2. 配置环境变量
完成 Claude code 安装后,有以下 2 种方式设置环境变量方式一:
curl -O "http://bigmodel-us3-prod-marketplace.cn-wlcb.ufileos.com/1753683727739-0b3a4f6e84284f1b9afa951ab7873c29.sh?ufileattname=claude_code_prod.sh"
方式二:手动配置
export ANTHROPIC_BASE_URL=https://open.bigmodel.cn/api/anthropic
export ANTHROPIC_AUTH_TOKEN={YOUR_API_KEY}
export ANTHROPIC_MODEL=glm-4.5