[经验分享] Kimi K2 发布,我用 Kimi K2 替换了 Claude Code 默认模型

9 天前
 jonssonyan

完整内容请移步阅读: https://mp.weixin.qq.com/s/J4J5bcW0XgSGH5UTxGmRZw

感谢 Kimi K2 ,让穷人也用上了 Claude Code 。

体验还不错,页面画的还行,能用

优点:相比较,token 费用低一点

缺点:得首冲¥50 不然并发更不上,还有响应慢一点

以 MacOS M4 系统为例

1. 先去月之暗面的开发者后台申请 API Key ,注册默认送 ¥15

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

2. 安装 Node.js

版本 >= 18

# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash

# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"

# Download and install Node.js:
nvm install 18

# Verify the Node.js version:
node -v # Should print "v18.20.8".
nvm current # Should print "v18.20.8".

# Verify npm version:
npm -v # Should print "10.8.2".

3. 安装 Claude Code

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

4. 添加环境变量

cat << 'EOF' >> ~/.zshrc

# claude code
export ANTHROPIC_BASE_URL=https://api.moonshot.cn/anthropic/
export ANTHROPIC_API_KEY=$YOUR_API_KEY
EOF

$YOUR_API_KEY 就是我们第 1 步在月之暗面后台申请的 API Key

这样我们就把 Claude Code 默认的模型替换为 Kimi K2

5. 绕过 Claude Code 认证

打开项目文件夹,终端启动 Claude Code

cd your_project
claude

这时候就会弹出登录认证网页。

我们只需要编辑 $HOME/.claude.json 添加新字段"hasCompletedOnboarding": true即可

最后我们在终端启动 claude 就可以开始对话了。

6. V50 看看实力

月之暗面 Free 账户默认“并发 1”,至少累计冲 50 解锁“并发 50” 才能完全发挥 Claude Code 的实力。

https://platform.moonshot.cn/docs/pricing/limits

总结

唯一槽点就是需要累积冲 50 提高并发能力才能丝滑使用 Claude Code 。另外体验和编程能力肯定是没有原生 Claude 4 好,但是国内不会封号啊,这点很重要,而且价格还便宜。

只是把“决策大脑”从 Claude AI 替换成了 Kimi K2 ,其他的都还是用 Clade Code 自己的。如果想要了解 AI Agent ,可以看我写的 一文读懂 AI 应用核心:Agent 、LLM 、RAG 、MCP 、Function Call

3794 次点击
所在节点    程序员
24 条回复
xingheng
6 天前
直接 429 了,完全不能用的状态。

API Error (429 {"error":{"message":"Organization Rate limit exceeded, please try again after 1 seconds","type":"rate_limit_reached_error"}}) · Retrying in 1 seconds… (attempt 1/10)
xingheng
6 天前
真有必要盲充 50 体验吗?等其他人测评吧
joey9696
3 天前
在等等 我觉得豆包也会出的,目前国内挺看好豆包的.
jethroX
3 天前
> hi
⎿ API Error (401 {"error":{"message":"Incorrect API key provided","type":"incorrect_api_key_error"}}) · Retrying in 1 seconds… (attempt 1/10)
⎿ API Error (401 {"error":{"message":"Incorrect API key provided","type":"incorrect_api_key_error"}}) · Retrying in 1 seconds… (attempt 2/10)
⎿ API Error (401 {"error":{"message":"Incorrect API key provided","type":"incorrect_api_key_error"}}) · Retrying in 2 seconds… (attempt 3/10)
⎿ API Error (401 {"error":{"message":"Incorrect API key provided","type":"incorrect_api_key_error"}}) · Retrying in 4 seconds… (attempt 4/10)

报错 401 ,api-key 都是对的,换了几个都不行

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://ex.noerr.eu.org/t/1144831

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX