Skip to content

Kimi2接入CluadeCode

环境:

node v20.11.0 (cluadecode 官网说明需要 node18+)

安装CluadeCode

bash
npm install -g @anthropic-ai/claude-code

安装完可以验证一下:

bash
claude -h

image-20250718105959541

申请KimiApi

链接:https://platform.moonshot.cn/console/api-keys

image-20250718110148813

申请完保存密钥

配置ClaudeCode

Windows

setx ANTHROPIC_BASE_URL "https://api.moonshot.cn/anthropic"
setx ANTHROPIC_AUTH_TOKEN "API 密钥"

MacOS / Linux

根据所用终端类型,编辑对应配置文件:

  • Bash 用户:~/.bashrc
  • Zsh 用户:~/.zshrc
bash
bash export ANTHROPIC_AUTH_TOKEN= API密钥
export ANTHROPIC_BASE_URL=https://api.moonshot.cn/anthropic

保存后记得重启终端

验证

随便找个项目目录进去

输入:

claude

image-20250718110512401

Api地址已经变成Kimi了

最近更新