方法一:一键安装及配置脚本

  1. 在终端中运行以下命令:
bash -c "$(curl -fsSL https://static01.siliconflow.cn/cdn/assets/install_and_use_claude_code_with_sf.sh)"
  1. 提示输入 API Key 时,粘贴你的 SiliconCloud API Key
  1. 提示选择模型时,使用方向键选择要在 Claude Code 中使用的模型:
  • ⚠️ 注:目前仅支持下列非思考模型
    • Pro/moonshotai/Kimi-K2-Instruct
    • moonshotai/Kimi-K2-Instruct
    • Pro/deepseek-ai/DeepSeek-V3
    • deepseek-ai/DeepSeek-V3
    • moonshotai/Kimi-Dev-72B
    • baidu/ERNIE-4.5-300B-A47B
  1. 根据提示,复制相应命令并重启终端运行,应用配置:
  1. 执行 claude 命令,进入 Cluade Code 并使用

方法二:手动配置

如果你想手动配置 Claude Code 的环境变量,可以在终端中运行下列命令:

export ANTHROPIC_BASE_URL="https://api.siliconflow.cn/"
export ANTHROPIC_MODEL="moonshotai/Kimi-K2-Instruct"    # 可以自行修改所需模型,目前仅支持非思考模型
export ANTHROPIC_API_KEY="YOUR_SILICONCLOUD_API_KEY"    # 请替换 API Key