用于批量注册 OpenAI 账号、生成授权文件,并批量检查 auth 目录里的额度。
本项目仅供学习、研究与接口行为测试使用。使用者应自行确保其用途符合目标平台的服务条款、当地法律法规以及所在网络环境的合规要求。
因使用本项目导致的账号风险、访问限制、数据丢失、封禁、法律责任或其他任何损失,均由使用者自行承担,项目作者与维护者不承担任何直接或间接责任。
- Node.js 18+
- 先安装依赖:
npm install - 需要准备
config.json - 需要可用代理,默认读取
config.json.defaultProxyUrl
npm install把 config.example.json 复制为 config.json,至少改这几项:
{
"provider": "proxiedmail",
"defaultProxyUrl": "http://127.0.0.1:10808",
"defaultPassword": "kuaileshifu88",
"loopDelayMs": 120000,
"cliproxyApiAutoUploadAuth": false,
"cliproxyApiBaseUrl": "http://localhost:8317",
"cliproxyApiManagementKey": ""
}直接跑源码:
npm run dev只跑 1 轮:
npm run dev -- --n 1npm run buildnpm run startnpm run check
npm run check:cpa这两个命令参数是一样的:
npm run dev -- [参数]
npm run start -- [参数]--n <次数>- 自动模式最多跑多少轮
--email <邮箱>- 指定单个邮箱执行, 配合
--otp使用
- 指定单个邮箱执行, 配合
--auth- 只登录并生成授权文件,必须配合
--email
- 只登录并生成授权文件,必须配合
--otp- 手动输入邮箱验证码
--sign- 直接注册并授权
--at- 只注册 ChatGPT,不走 Codex OAuth 授权;注册成功后读取 ChatGPT
accessToken - token 会保存到
./auth/at/日期-邮箱.json,文件名规则与./auth授权文件一致
- 只注册 ChatGPT,不走 Codex OAuth 授权;注册成功后读取 ChatGPT
--st- Sentinel 使用浏览器模式
npm run dev -- --n 1npm run dev -- --email your_mail@example.comnpm run dev -- --email your_mail@example.com --authnpm run dev -- --email your_mail@example.com --otpnpm run dev -- --email your_mail@example.com --signnpm run dev -- --at指定邮箱:
npm run dev -- --email your_mail@example.com --at输出文件位于:
./auth/at/日期-邮箱.json
如果要启用短信验证,见教程:
批量检查 auth 目录里的授权文件额度。
npm run check -- [参数]
npm run check:cpa -- [参数]--dir <目录>- 指定 auth 目录,默认
./auth
- 指定 auth 目录,默认
--limit <数量>- 只检查前 N 个文件
--proxy <代理地址>- 指定代理,不传就用
config.json.defaultProxyUrl
- 指定代理,不传就用
--refresh- 检查前先尝试刷新 token
--verbose- 输出原始状态码和原始响应体
--table- 最后输出表格
--concurrency <数量>或-c <数量>- 并发检查数量
--cpa- 从 CLIProxyAPI 的
auth-files里读取并检查 auth(npm run check:cpa已内置)
- 从 CLIProxyAPI 的
npm run check
npm run check -- --limit 20
npm run check -- --concurrency 8
npm run check -- --limit 50 -c 10
npm run check -- --refresh --table
npm run check -- --proxy http://127.0.0.1:7890 --table
npm run check:cpa
npm run check:cpa -- --refresh --limit 20 -c 8单个账号输出示例:
[✅️][free][100.00%]someone@example.com-2026-04-21 15:33:10
[❌️]someone@example.com-Encountered invalidated oauth token for user, failing request
汇总输出示例:
总数 10 | 可用 8 | 限额 1 | 移除 1 | 可用额度 6.42
含义:
总数:检查的账号总数可用:请求成功的账号数限额:剩余额度为0%的账号数移除:被移除的账号数(本地模式移动到auth/401/,CPA 模式通过 API 删除)可用额度:所有可用账号剩余额度之和,按小数累计
npm run check:cpa 会:
- 从 CLIProxyAPI 的
auth-files拉取 auth 列表 - 下载其中可识别的 codex 授权文件
- 执行和本地
check相同的额度检查 - 如果检查过程中 refresh 成功,会把更新后的 token 回写到 CPA 对应 auth 文件
- 如果命中需要移除的 401 凭证,会直接通过 CPA 的
auth-filesAPI 删除 - 会根据剩余额度自动调整 CPA auth 状态:
剩余额度 ≤ 5%:如果当前是启用状态,则调用 API 停用剩余额度 > 5%:如果当前是停用状态,则调用 API 启用- 如果当前状态本来就符合条件,则不会重复调用 API
说明:
check:cpa依赖以下配置:cliproxyApiBaseUrlcliproxyApiManagementKey
- CPA 模式下的“移除”表示通过 API 删除远端 auth 文件,不会移动到本地
auth/401/
config.json 里的 provider 可选:
proxiedmailgmailgptmailhotmail2925cloudflare
最省事,适合自动化。[已不可用]
{
"provider": "proxiedmail"
}需要配置 Gmail API token 和主邮箱:
{
"provider": "gmail",
"gmailAccessToken": "your_gmail_access_token",
"gmailEmailAddress": "your_gmail@gmail.com"
}临时 token 获取教程见:GMAIL_OAUTH_PLAYGROUND.md
{
"provider": "hotmail"
}邮箱账号放 hotmail/tokens.txt 文件里:
tokens.txt 格式为:
邮箱----密码----client_id----refresh_token
一行一个账号,例如:
someone@hotmail.com----YourPassword123----a016c639-6112-4efe-b2cd-8ef74231bb97----M.Cxxxx...
说明:
- 第 1 段:邮箱
- 第 2 段:密码
- 第 3 段:
client_id - 第 4 段:
refresh_token
程序会:
- 从
tokens.txt随机取账号生成别名邮箱 - 用
refresh_token刷新访问令牌 - 根据刷新后返回的
scope自动选择:- 包含
outlook.office.com:走 Outlook REST API - 其他情况:走 Microsoft Graph
- 包含
- 读取收件箱和垃圾箱中的验证码邮件
- 刷新后的
refresh_token会回写到tokens.txt
{
"provider": "gptmail",
"gptMailApiKey": "your_gptmail_api_key",
"gptMailDomain": ""
}说明:
gptMailApiKey- GPTMail API Key
gptMailDomain- 可选,指定生成邮箱时使用的域名;留空则由服务端随机分配
程序会:
- 调用 GPTMail 的生成邮箱接口获取邮箱
- 轮询邮件列表并读取邮件详情
- 提取验证码
- 命中后自动删除该邮件
文档:
{
"provider": "2925",
"2925EmailAddress": "your_2925@2925.com",
"2925Password": "your_2925_password"
}{
"provider": "cloudflare",
"cloudflareEmailDomain": "54782.xyz",
"cloudflareApiBaseUrl": "https://mail-d1-api.xxx.workers.dev",
"cloudflareApiKey": "your_api_key"
}适合自有域名的邮箱注册。 Cloudflare Worker 部署说明见:MAIL_WORKER_DEPLOY.md
provider- 验证码邮箱提供方
defaultProxyUrl- 默认代理地址
defaultPassword- 注册默认密码
loopDelayMs- 自动模式每轮间隔时间,单位毫秒
gmailAccessToken- Gmail API access token
gmailEmailAddress- Gmail 主邮箱地址
gptMailApiKey- GPTMail API Key
gptMailDomain- GPTMail 指定生成邮箱时使用的域名,可留空
hotmail- 使用
./hotmail/tokens.txt作为 Hotmail/Outlook 账号来源
- 使用
2925EmailAddress- 2925 邮箱账号
2925Password- 2925 邮箱密码
cloudflareEmailDomain- Cloudflare Email Routing 的域名
cloudflareApiBaseUrl- Cloudflare 邮件 Worker 地址
cloudflareApiKey- Cloudflare 邮件 Worker 的
x-api-key
- Cloudflare 邮件 Worker 的
cliproxyApiAutoUploadAuth- 授权成功后是否自动上传 auth 文件到 CLIProxyAPI
cliproxyApiBaseUrl- CLIProxyAPI 管理地址,例如
http://localhost:8317
- CLIProxyAPI 管理地址,例如
cliproxyApiManagementKey- CLIProxyAPI 的
MANAGEMENT_KEY
- CLIProxyAPI 的
如果你希望授权成功后,把新生成的 auth/*.json 自动上传到 CLIProxyAPI,可在 config.json 中开启:
{
"cliproxyApiAutoUploadAuth": true,
"cliproxyApiBaseUrl": "http://localhost:8317",
"cliproxyApiManagementKey": "your_management_key"
}行为说明:
- auth 文件仍然会先保存到本地
./auth - 然后再调用 CLIProxyAPI 管理接口上传
- 上传失败不会中断主流程,只会输出警告日志
- 新增主程序参数
--at:- 注册成功后直接获取 ChatGPT
accessToken可用于聊天和生成图片 - 自动保存到
./auth/at/日期-邮箱.json
- 注册成功后直接获取 ChatGPT