AnyRouter+Claude 免费使用

dawn_r1sing Lv4

本文记录了claude的环境部署过程,过程非常简单。

本地环境

1. nodejs
1
2
3
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash -
sudo apt-get install -y nodejs
node --version

再次出现dpkg: error processing package xxx问题,执行下面的脚本

1
2
3
4
5
6
7
#!/bin/bash

sudo mv /var/lib/dpkg/info /var/lib/dpkg/info_old
sudo mkdir /var/lib/dpkg/info
sudo apt-get update

echo "success, you can continute to run 'sudo apt-get install xxx'."
1
bash dpkg.sh
2. 安装 Claude Code
1
2
npm install -g @anthropic-ai/claude-code
claude --version

注册AnyRouter

可以通过邀请链接进入网站进行注册:https://anyrouter.top/register?aff=QOG0

注册账号(使用edu.cn邮箱进行注册)

点击“API令牌-添加令牌”,名称随意设置,额度设置可以设为“无限额度”,点击提交

复制令牌

设置环境变量

我是用的是zsh,就执行以下命令

1
2
echo -e '\nexport ANTHROPIC_AUTH_TOKEN=复制的令牌' >> ~/.zshrc
echo -e '\nexport ANTHROPIC_BASE_URL=https://anyrouter.top' >> ~/.zshrc

使用

进入项目目录,执行:

1
claude

第一次使用需要勾选一些确认,一路回车即可。

然后就可以使用啦啦

  • Author: dawn_r1sing
  • Created at : 2025-11-09 21:27:35
  • License: This work is licensed under CC BY-NC-SA 4.0.(转载请注明出处)
On this page