by millylee
支持 AnyRouter、AgentRouter 的多平台多账号签到,理论兼容所有基于 NewAPI、OneAPI 的平台。
# Add to your Claude Code skills
git clone https://github.com/millylee/anyrouter-check-in多平台多账号自动签到,理论上支持所有 NewAPI、OneAPI 平台,目前内置支持 Any Router 与 Agent Router,其它可根据文档进行摸索配置。
推荐搭配使用Auo,支持任意 Claude Code Token 切换的工具。
维护开源不易,如果本项目帮助到了你,请帮忙点个 Star,谢谢!
用于 Claude Code 中转站 Any Router 网站多账号每日签到,一次 $25,限时注册即送 100 美金,点击这里注册。业界良心,支持 Claude Sonnet 4.5、GPT-5-Codex、Claude Code 百万上下文(使用 /model sonnet[1m] 开启),gemini-2.5-pro 模型。
点击右上角的 "Fork" 按钮,将本仓库 fork 到你的账户。
对于每个需要签到的账号,你需要获取:(可借助 在线 Secrets 配置生成器)
No comments yet. Be the first to share your thoughts!
按照下方图片教程操作获得。
production 的环境production 环境进入环境配置页ANYROUTER_ACCOUNTS支持单个与多个账号配置,可选 name 和 provider 字段:
[
{
"name": "我的主账号",
"cookies": {
"session": "account1_session_value"
},
"api_user": "account1_api_user_id"
},
{
"name": "备用账号",
"provider": "agentrouter",
"cookies": {
"session": "account2_session_value"
},
"api_user": "account2_api_user_id"
}
]
字段说明:
cookies (必需):用于身份验证的 cookies 数据api_user (必需):用于请求头的 new-api-user 参数provider (可选):指定使用的服务商,默认为 anyroutername (可选):自定义账号显示名称,用于通知和日志中标识账号默认值说明:
provider 字段,默认使用 anyrouter(向后兼容)name 字段,会使用 Account 1、Account 2 等默认名称anyrouter 与 agentrouter 配置已内置,无需填写接下来获取 cookies 与 api_user 的值。
通过 F12 工具,切到 Application 面板,拿到 session 的值,最好重新登录下,该值 1 个月有效期,但有可能提前失效,失效后报 401 错误,到时请再重新获取。

通过 F12 工具,切到 Network 面板,可以过滤下,只要 Fetch/XHR,找到带 New-Api-User,这个值正常是 5 位数,如果是负数或者个位数,正常是未登录。

你可以手动触发一次签到来测试:

假设你有两个账号需要签到,不指定 provider 时默认使用 anyrouter:
[
{
"cookies": {
"session": "abc123session"
},
"api_user": "user123"
},
{
"cookies": {
"session": "xyz789session"
},
"api_user": "user456"
}
]
如果你需要同时使用多个服务商(如 anyrouter 和 agentrouter):
[
{
"name": "AnyRouter 主账号",
"provider": "anyrouter",
"cookies": {
"session": "abc123session"
},
"api_user": "user123"
},
{
"name": "AgentRouter 备用",
"provider": "agentrouter",
"cookies": {
"session": "xyz789session"
},
"api_user": "user456"
}
]
默认情况下,anyrouter、agentrouter 已内置配置,无需额外设置。如果你需要使用其他服务商,可以通过环境变量 PROVIDERS 配置:
大多数情况下,只需提供 domain 即可,其他路径会自动使用默认值:
{
"customrouter": {
"domain": "https://custom.example.com"
}
}
如果服务商使用了不同的 API 路径、请求头或需要 WAF 绕过,可以额外指定:
{
"customrouter": {
"domain": "https://custom.example.com",
"login_path": "/auth/login",
"sign_in_path": "/api/checkin",
"user_info_path": "/api/profile",
"api_user_key": "New-Api-User",
"bypass_method": "waf_cookies",
"waf_cookie_names": ["acw_tc", "cdn_sec_tc", "acw_sc__v2"]
}
}
关于 bypass_method:
null:直接使用用户提供的 cookies 进行请求(适合无 WAF 保护的网站)"waf_cookies":使用 Playwright 打开浏览器获取 WAF cookies 后再进行请求(适合有 WAF 保护的网站)注:
anyrouter和agentrouter已内置默认配置,无需在PROVIDERS中配置
PROVIDERS字段说明:
domain (必需):服务商的域名login_path (可选):登录页面路径,默认为 /login(仅在 bypass_method 为 "waf_cookies" 时使用)sign_in_path (可选):签到 API 路径,默认为 /api/user/sign_inuser_info_path (可选):用户信息 API 路径,默认为 /api/user/selfapi_user_key (可选):API 用户标识请求头名称,默认为 new-api-userbypass_method (可选):WAF 绕过方法
"waf_cookies":使用 Playwright 打开浏览器获取 WAF cookies 后再执行签到null:直接使用用户 cookies 执行签到(适合无 WAF 保护的网站)waf_cookie_names (可选):绕过 WAF 所需 cookie 的名称列表,bypass_method 为 waf_cookies 时必须设置配置示例(完整):
{
"customrouter": {
"domain": "https://custom.example.com",
"login_path": "/auth/login",
"sign_in_path": "/api/checkin",
"user_info_path": "/api/profile",
"api_user_key": "x-user-id",
"bypass_method": "waf_cookies"
}
}
内置配置说明:
anyrouter:
bypass_method: "waf_cookies"(需要先获取 WAF cookies,然后执行签到)sign_in_path: "/api/user/sign_in"agentrouter:
bypass_method: null(直接使用用户 cookies 执行签到)sign_in_path: "/api/user/sign_in"重要提示:
PROVIDERS 是可选的,不配置则使用内置的 anyrouter 和 agentrouter脚本支持多种通知方式,可以通过配置以下环境变量开启,如果 webhook 有要求安全设置,例如钉钉,可以在新建机器人时选择自定义关键词,填写 AnyRouter。
EMAIL_USER: 发件人邮箱地址/STMP 登录地址EMAIL_PASS: 发件人邮箱密码/授权码EMAIL_SENDER: 邮件显示的发件人地址(可选,默认: EMAIL_USER)CUSTOM_SMTP_SERVER: 自定义发件人 SMTP 服务器(可选)EMAIL_TO: 收件人邮箱地址DINGDING_WEBHOOK: 钉钉机器人的 Webhook 地址FEISHU_WEBHOOK: 飞书机器人的 Webhook 地址WEIXIN_WEBHOOK: 企业微信机器人的 Webhook 地址PUSHPLUS_TOKEN: PushPlus 的 TokenSERVERPUSHKEY: Server 酱的 SendKeyTELEGRAM_BOT_TOKEN: Telegram Bot 的 TokenTELEGRAM_CHAT_ID: Telegram Chat IDGOTIFY_URL: Gotify 服务的 URL 地址(例如: https://your-gotify-server/message)GOTIFY_TOKEN: Gotify 应用的访问令牌GOTIFY_PRIORITY: Gotify 消息优先级 (1-10, 默认为 9)BARK_KEY: Bark 应用的 Key(APP 打开时即可看到)BARK_SERVER: 自建 Bark 服务器地址 (可选,默认: https://api.day.app)配置步骤:
如果签到失败,请检查:
如果你需要在本地测试或开发,请按照以下步骤设置:
# 安装所有依赖
uv sync --dev
# 安装 Playwright 浏览器
uv run playwright install chromium
# 创建 .env 文件并配置(注意:JSON 必须是单行格式)
# 示例:
# ANYROUTER_ACCOUNTS=[{"name":"账号1","cookies":{"session":"xxx"},"api_user":"12345"}]
# PROVIDERS={"agentrouter":{"domain":"https://agentrouter.org"}}
# 运行签到脚本
uv run checkin.py
uv sync --dev
# 安装 Playwright 浏览器
uv run playwright install chromium
# 运行测试
uv run pytest tests/
# 查看测试覆盖率
uv run pytest tests/ --cov=. --cov-report=html
欢迎贡献代码!在提交 Pull Request 之前,请阅读贡献指南。
本项目使用以下工具确保代码质量:
所有 Pull Request 会自动运行以下检查:
# 安装开发依赖
uv sync --dev
# 安装 pre-commit 钩子
uv run pre-commit install
# 运行代码检查
uv run ruff check .
uv run ruff format .
uv run mypy .
uv run bandit -r . -c pyproject.toml
# 运行测试
uv run pytest tests/ --cov=.
本脚本仅用于学习和研究目的,使用前请确保遵守相关网站的使用条款.