Geen omschrijving

husj 3c8b560b99 新增pmail(还不可用) 1 maand geleden
src 3c8b560b99 新增pmail(还不可用) 1 maand geleden
.gitignore 5cd94f879d 提交 1 maand geleden
README.md 9b0f7c3494 first commit 1 maand geleden
pom.xml 3c8b560b99 新增pmail(还不可用) 1 maand geleden

README.md

husj-openai

OpenAI 自动注册服务 — Spring Boot 版(完整复刻 openai_register.py 功能)

功能亮点

  • 支持两种临时邮箱:TempMail.lolGPTMail,可手动指定,也可自动回退。
  • 完整复刻 OpenAI 10 步注册流程(PKCE OAuth + Sentinel Token + OTP 验证 + Workspace 选择 + Token 换取)。
  • 支持 CPA 池管理:token 上传、失效探测(401 / 用量超阈值)、自动清理。
  • 本地存储:tokens/accounts.txt + tokens/token_<email>_<timestamp>.json
  • REST API 对外暴露全部功能,无需命令行。

快速启动

cd husj-openai
mvn clean package -DskipTests
java -jar target/husj-openai-0.0.1-SNAPSHOT.jar

或指定代理与邮箱提供商:

java -jar target/husj-openai-0.0.1-SNAPSHOT.jar \
  --husj.openai.proxy=http://127.0.0.1:7890 \
  --husj.openai.mail-provider=tempmail

配置项(application.yml)

配置项 默认值 说明
husj.openai.proxy "" HTTP 代理,例 http://127.0.0.1:7890
husj.openai.mail-provider auto auto / gptmail / tempmail
husj.openai.output-dir "" Token 输出目录(默认运行目录下 tokens/
husj.openai.cpa.base-url "" CPA 管理端地址(填到 协议+IP+端口
husj.openai.cpa.token "" CPA 登录密码(也可用环境变量 CPA_TOKEN
husj.openai.cpa.workers 20 并发探测数
husj.openai.cpa.timeout 12 请求超时(秒)
husj.openai.cpa.retries 1 清理探测重试次数
husj.openai.cpa.used-threshold 95 用量超此值(%)判定为失效
husj.openai.cpa.target-count 300 CPA 目标有效 token 数

REST API

触发注册

POST /api/register

Query 参数(可选):
  ?cpaUpload=true        注册后上传 CPA
  ?cpaClean=true         注册前/后清理 CPA 失效账号
  ?cpaPruneLocal=true    上传成功后删除本地文件 + accounts.txt 行

CPA 管理

GET  /api/cpa/status     统计有效 token 数
GET  /api/cpa/files      获取 CPA auth-files 列表
POST /api/cpa/clean      手动触发探测 + 清理

服务状态

GET /api/status          返回服务配置概览

输出位置

  • 账号密码:tokens/accounts.txtemail----password 格式)
  • Token JSON:tokens/token_<email>_<timestamp>.json

注意事项

  • 需能访问 https://auth.openai.com;代理地区尽量避开 CN/HK。
  • CPA 地址只填写到 协议 + IP/域名 + 端口,不要带后台页面路径。
  • 如使用 auto 邮箱模式,优先尝试 TempMail.lol,失败后自动回退到 GPTMail。