Kimi-k2实测体感比gemini 2.5 pro还舒服。配合Claude code cli, 几乎能完美兼容,直接冒充anthropic自己的模型。下面是使用方法

1. 安装Node.js (如果已经安装请跳过)

确保 Node.js 版本 > 18.0

#For Ubuntu / Debian users
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash - sudo apt-get install -y nodejs
node --version

#For macOS users
sudo xcode-select --install
/bin/bash -c "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)
" brew install node
node --version

2. 安装Claude Code

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

# 验证安装
claude --version

如果要自定义模型使用建议先不使用claude 命令启动,如果已经使用google账号或anthropic api, 建议先退出登录

# run claude
claude

# within claude cli
/logout

3. 开始集成

在项目目录运行:

export ANTHROPIC_API_KEY=sk-... 
export ANTHROPIC_BASE_URL=https://api.moonshot.ai/anthropic
claude

如果运行成功应该会显示: ![[Pasted image 20250713112556.png]]

尝试对话时如果碰到 invalid url问题,建议尝试:

  • 检查baseurl和api key是否正确

  • 在kimi平台充值金额(根据官方说明,累计充值<50元的账号为free级别,可能会有一些限制)

Continue Reading
All Articles
2025年3月13日
2025年7月16日
Shadcn UI doc llms.txt
constructed shadcnui docs llms.txt version , free to copy and feed to your llms :D
© 2025 Tylergg