目录
Claude Code 使用KIMI的k2模型
/        

Claude Code 使用KIMI的k2模型

Claude Code 使用 KIMI 的 k2 模型

1. 申请 KIMI api key

2. 安装 Claude Code

  • 执行命令安装,window 建议使用 wsl2

    node 版本最好 18+, 20+

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

3. Claude Code 配置

  • 用户目录下/.claude/settings.json

    window 为:C:\Users\username\\.claude\settings.json

    linux/macOS: ~/.claude/settings.json

  • 配置内容

    {
      "env": {
        "ANTHROPIC_AUTH_TOKEN": "sk-xx",
        "ANTHROPIC_BASE_URL": "https://api.moonshot.cn/anthropic"
      }
    }
    

4. 运行 Claude Code

打开命令终端,执行 claude

╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code!                         │
│                                                   │
│   /help for help, /status for your current setup  │
│                                                   │
│   cwd: /Users/gitsilence/api-proxy                │
│                                                   │
│   ─────────────────────────────────────────────── │
│                                                   │
│   Overrides (via env):                            │
│                                                   │
│   • API Base URL:                                 │
│   https://api.moonshot.cn/anthropic               │
╰───────────────────────────────────────────────────╯

 Tips for getting started:

 1. Run /init to create a CLAUDE.md file with instructions for Claude
 2. Use Claude to help with file analysis, editing, bash commands and git
 3. Be as specific as you would with another engineer for the best results
 4. ✔ Run /terminal-setup to set up terminal integration

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ > 

标题:Claude Code 使用KIMI的k2模型
作者:gitsilence
地址:https://blog.lacknb.cn/articles/2025/07/18/1752803559287.html