一、先上效果

二、食用步骤

1、访问🚀 AnyRouter|Claude Code 免费共享平台

2、点击“通过Github登录”。

3、点击左侧菜单的【数据看板】,就可以看到你目前的余额啦 🎉🎉🎉。

小编这里用了几次,所以显示的是99刀多。

4、安装 Node.js(已安装可跳过)

确保 Node.js 版本 ≥ 18.0

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

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

5、安装 Claude Code

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

6、获取API Key

  • 获取 Auth Token: ANTHROPIC_AUTH_TOKEN :注册后在 API令牌 页面点击 添加令牌 获得(以 sk- 开头)

    • 名称随意,额度建议设为无限额度,其他保持默认设置即可。

  • API地址: ANTHROPIC_BASE_URLhttps://anyrouter.top 是本站的 API 服务地址,与主站地址相同。

7、配置环境变量

在您的项目目录下运行(临时使用):

cd your-project-folder
export ANTHROPIC_AUTH_TOKEN=sk-... 
export ANTHROPIC_BASE_URL=https://anyrouter.top
claude

推荐方式,这样后面就不用来回的配置啦:

echo -e '\n export ANTHROPIC_AUTH_TOKEN=sk-...' >> ~/.bash_profile
echo -e '\n export ANTHROPIC_BASE_URL=https://anyrouter.top' >> ~/.bash_profile
echo -e '\n export ANTHROPIC_AUTH_TOKEN=sk-...' >> ~/.bashrc
echo -e '\n export ANTHROPIC_BASE_URL=https://anyrouter.top' >> ~/.bashrc

8、使用 

cd your-project-folder
claude

 

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐