As the title says,
Prerequisites:
- A CT8 or serv00 (I appealed and got mine unbanned later)
- A domain (I used the forum's loc.cc) PS: suggest not using community domains for now, because the cert wouldn't issue and I got stuck there for a while
- A Muse (pros don't need it, only noobs like me do)
- An OpenAI account (any plan works, all require phone verification) PS: when browsing card sites today I saw a $0 one that hadn't passed phone verification; I have a phone number so I grabbed one to try. Not recommended, I was just messing around
Below is Muse's summary and walkthrough
Full Process of Setting Up Sub2API on CT8 Free Hosting (Redacted Version)
Organized: 2026-11-28
Goal: reverse proxy a free ChatGPT account into an OpenAI-compatible API, public address [entry redacted]
Result: working, account connected and tested, balance topped up (virtual), only need to generate an API Key to call it.
Redaction note: all passwords, keys, Tokens, OAuth auth codes, personal emails, account names, entry addresses, port numbers and database names have been removed. Passwords are written as
[密码已脱敏], personal emails as[邮箱已脱敏], account names as[账号已脱敏]/[管理员账号已脱敏]/[账号名已脱敏], entry addresses and domains as[入口已脱敏]/[域名已脱敏], port numbers as[端口已脱敏], database names as[数据库名已脱敏]; authorization links keep only the structure, not the parameter values. Version numbers and other operational info are kept, otherwise the steps can't be reproduced.
I. Overview
| Item | Content |
|---|---|
| Host | CT8 (ct8.pl), DevilWEB 2.2 free shared hosting, not a VPS |
| System | FreeBSD 14.3-RELEASE-p19 (amd64) |
| Sub2API | v0.2.24, FreeBSD build, source KiritoXDone/Sub2API-Freebsd |
| Entry | [entry redacted] (plain HTTP, no cert) |
| Backend | PostgreSQL + Redis |
| Upstream account | 1 free ChatGPT account, OAuth, named [account name redacted] |
| Admin | [admin account redacted] (local account, not a real email) |
| Keepalive | start.sh / restart.sh + cron every 5 minutes |
Chain: 用户 / 客户端 → [入口已脱敏] → CT8 反向代理 → 127.0.0.1:[端口已脱敏](Sub2API)→ ChatGPT 账号 → OpenAI
II. Starting Point: This Is Not a VPS
At first I tried to reproduce a LINUX DO post, "Idle Serv00 Deploy Sub2API Tutorial". On Serv00 it was a Redis + PostgreSQL setup with about 200M RAM.
The CT8 I actually got is not a VPS:
- The panel is DevilWEB 2.2 (MyDevil free hosting), no server list, no boot / shutdown / reinstall.
- Plan FREE, valid until 2027-02-26, home directory
/usr/home/[账号已脱敏]/, hostname s1. - Quota: 3GB disk (only about 17MB used at the time), 512MB RAM, 100% CPU, 20 processes, 500 emails/day.
- Panel sections: Dashboard, Websites, DNS Zones, Mail, FTP, Databases, Repositories, Cron Jobs, Port reservation, File manager, SSH terminal.
Conclusion: same class as Serv00, with a web SSH terminal + port reservation. Sub2API can run, but it has to be deployed within shared hosting limits, not treated like a VPS.
III. Prep: Port + Database (19:38–19:40)
All done in the CT8 panel, account [account redacted].
1. Reserve a port
- Port reservation -> reserve TCP port [port redacted], description Sub2API.
- Pitfall: I tried one port first and got
This port is already taken; changed to [port redacted] and it worked, panel showedPort has been reserved.
2. Create PostgreSQL
- Databases -> PostgreSQL, create:
- Database name / username:
[数据库名已脱敏] - Password:
[密码已脱敏] - Host:
pgsql.ct8.pl, port [port redacted] - Charset: C.UTF-8
- Database name / username:
- Panel showed
The database has been added, initial size about 7.44 MB.
IV. Install Sub2API + Redis (19:40–20:00)
Done in the panel SSH terminal, prompt was [[账号已脱敏]@s1]:~$.
1. Enable Binexec first
The Binexec (custom software) switch in the panel was off by default. Running your own binary requires it. After enabling it, reconnect the SSH session for it to take effect.
2. Download Sub2API
Download v0.2.24 from KiritoXDone/Sub2API-Freebsd:
- Package:
sub2api_0.2.24_freebsd_amd64.tar.gz - Extract to
~/sub2api/, add execute permission. ./sub2api --versionshows0.2.24.
redis-server 8.0.3 and other tools are already preinstalled, no need to install them separately.
3. Run the setup wizard
Run ./sub2api -setup, config is written to ~/sub2api/config.yaml:
- Sub2API listen:
0.0.0.0:[端口已脱敏] - PostgreSQL:
pgsql.ct8.pl:[端口已脱敏], database / user[数据库名已脱敏], SSL disable, connection test OK. - Redis:
localhost:[端口已脱敏], DB 0, TLS off, connection test OK.
4. Two forced changes
(1) Redis can't use [port redacted]
The host only allows binding reserved ports. Reserving [port redacted] was rejected; a Python bind test confirmed [port redacted] and random ports both return Operation not permitted, and only reserved ports can be bound.
Fix: reserved another port [port redacted] for Redis. Redis actually runs on 127.0.0.1:[端口已脱敏], and the Sub2API config was also changed to [port redacted].
(2) Admin username must be in email format
The wizard requires the login name to be in email format; entering admin gives Invalid email format.
Fix: created [管理员账号已脱敏], password [密码已脱敏]. This is not a real email, just a local login name.
Other non-fatal messages: JWT secret auto-generated; Sub2API log initialization failed (tried to create /app/data/logs without permission), fell back to stdout, nohup writes to ~/sub2api/sub2api.log.
5. Verified
Final checks:
- Redis is running,
redis-server 127.0.0.1:[端口已脱敏], password auth returns PONG, version 8.0.3. - Sub2API is running, log shows
Server started on 0.0.0.0:[端口已脱敏]. - curl checks:
http://127.0.0.1:[端口已脱敏]/200,/health200,/login200. - Admin login API
POST /api/v1/auth/loginreturns code 0 and issues access_token.
V. Keepalive: Prevent the Process from Being Killed
Shared hosting doesn't guarantee background processes stay alive, so I added two layers of keepalive:
~/sub2api/start.shand~/sub2api/restart.sh, both executable.restart.shtested: after stopping Redis and Sub2API, both came back with new PIDs, Redis PONG, Sub2API homepage HTTP 200.- Panel Cron Jobs: run
start.shevery 5 minutes. - The existing ct8-keepalive cron job was left untouched.
Credentials are stored on the server in ~/.sub2api-creds, permission 600, values not recorded here.
VI. Bind Domain [domain redacted] (20:01–20:38, Plain HTTP)
1. CT8 panel: add reverse proxy site
- Websites -> add site
[域名已脱敏], type Proxy (Reverse Proxy). - Target:
http://127.0.0.1:[端口已脱敏]. - Site directory:
/usr/home/[账号已脱敏]/domains/[域名已脱敏], create the default DNS zone at the same time. - SSL force off.
- Existing site
[账号已脱敏].ct8.pl(PHP 8.3) untouched, Sub2API itself untouched.
2. Yunamo: DNS resolution
Domain [域名已脱敏] was registered at Yunamo that day, account [account redacted], status normal.
- DNS record: 1,
A @ → 136.243.156.120, TTL 1 hour, DNS only. - Authoritative NS:
cat.ns.yunamo.com/dog.ns.yunamo.com.
3. Pitfall: the IP was wrong at first
The IP I used initially, 198.18.3.147, was not the real IP of [账号已脱敏].ct8.pl. Testing showed both HTTP/HTTPS got ERR_CONNECTION_RESET and couldn't reach CT8.
After checking, public DNS showed [账号已脱敏].ct8.pl actually resolves to 136.243.156.120.
- Tried changing CNAME to
[账号已脱敏].ct8.pl, but the Yunamo UI stayed at "pending sync" for a long time and didn't publish. - Changed back to an A record pointing directly to the verified correct IP
136.243.156.120. - dnschecker.org checked about 26 global nodes and they were consistent, all resolving to the correct IP, proving the record was live (Yunamo UI still showed "pending sync", just UI lag).
4. Certificate: tried 3 times, decided not to issue
- Refreshed CT8's WWW Certificates list and confirmed 0 certificates.
- The previous 3 Let's Encrypt issuance attempts produced no certificate, with no panel error and no cert generated.
- The user decided not to sign a certificate, stopped immediately, and went plain HTTP only.
- Current state:
[入口已脱敏]serves CT8's shared wildcard cert (CN=*.ct8.pl), which doesn't match the domain, so browsers will show a cert error. The currently usable access method is HTTP.
5. Verify it opens
- On the server:
curl [入口已脱敏]/returns 200, page titleSub2API - AI API Gateway; local127.0.0.1:[端口已脱敏]also returns 200, proving the whole reverse proxy chain works. - External: check-host.net checks from multiple locations all return HTTP 200 (3389 bytes); dnschecker global resolution is consistent.
- Exception: the cloud browser machine still showed
ERR_CONNECTION_RESETbecause its local DNS cache still had the old A record (TTL 3600). Not a site issue; it opens normally after the cache expires.
Other: CT8 sessions expire after about 15 minutes; I had to log in again once during the process.
6. Yunamo warning
There's a warning at the top of the Yunamo page: "Due to long-term health check failures, this domain will be automatically deleted within 30 days". This was generated during the period when the domain was unreachable. It should clear once the site recovers and health checks pass, but keep an eye on it.
VII. Connect a Free ChatGPT Account (20:43–20:56, Environment 2)
The core use of Sub2API is reverse proxying ChatGPT membership / free accounts into an API. It doesn't use an API Key, but account OAuth.
1. Create a group
The backend originally only had one group, default (Anthropic, rate 1x), with no OpenAI group.
Create a group: platform OpenAI, name ChatGPT, rate 1, everything else default.
2. Add account
Account management -> add account:
- Platform: OpenAI
- Type: OAuth (ChatGPT OAuth)
- Name: [account name redacted]
- Models: clicked "clear all models", model list became 0 (supports all models, auto-compatible later)
- Concurrency: default 10
- Group: check the newly created ChatGPT group
Then click "Generate Authorization URL".
3. OAuth authorization (must be done by the user in their own browser)
The generated authorization link structure is roughly:
https://auth.openai.com/oauth/authorize?client_id=[已脱敏]&redirect_uri=http://localhost:[端口已脱敏]/auth/callback&response_type=code&scope=openid+profile+email+offline_access&state=[已脱敏]
Flow:
- Send the link to the user, open it in a browser already logged into that free ChatGPT account.
- Log in / click authorize.
- After authorization it jumps to
http://localhost:[端口已脱敏]/auth/callback?code=...; the page not opening is normal. - Copy the full redirect URL from the address bar back.
- Paste it back into the Code input in the Sub2API add account dialog; the system parses the code automatically, click "Complete Authorization".
- The page first shows "Verifying authorization code, please wait...", then "Account added successfully!".
Note: the ChatGPT password was never given out; the password was only used in the user's own browser.
4. Account status and test
After adding successfully, the account appears in the list (created 2026-11-28 20:56, ID #1):
- Name: [account name redacted]
- Account email:
[邮箱已脱敏] - Platform / Type: OpenAI / OAuth
- Subscription: Free, Private, Compact Auto, training data sharing off
- Status: normal; scheduling: on; group: ChatGPT; capacity 0 / 10; priority 1
- Usage window: 5h 0%, 7d 0%; quota sampled at 2026-11-28 20:56:04; last used: never; expires: -
Test: account "More -> Test connection", default model GPT-Reserve, test message hi, click "Start test", shows "Test complete!", returned:
Hi! What can I help you with?
Available models, 12 total (confirmed by scrolling the test dialog dropdown to the bottom, no more):
GPT-Reserve, GPT-6-Luna, GPT-5.6-Terra, GPT-5.6-Luna, Codex Auto Review, GPT Image 1, GPT Image 1.5, GPT Image 2, GPT Image 2.5 Flare, GPT Image 2.5 Sunburst, GPT Image 2.6 Flare, GPT Image 2.6 Sunburst
GPT-Reserve has been tested and works normally.
VIII. Balance: Two Separate Accounts
1. The ChatGPT account itself
Sub2API doesn't show exactly how many messages / tokens are left, only the usage window:
- 5 hours: 0%
- 7 days: 0%, with
29d 23hnext to it - Count: 0; points: 0
- The "Reset" button says "No resets available" and isn't clickable
Meaning it hasn't been used yet and the quota is full. Free account quota is calculated by time window, not by money.
2. Sub2API account balance
In user management, the admin account:
- Before top-up: $0.00, total top-up $0.00, no change records.
- 2026-11-28 21:03 topped up $9999 (virtual balance, not real payment), note left blank, page said "Success".
- After top-up, refreshing the user list shows $9999.00.
- Minor issue: the top bar balance still shows $0.00 and hasn't synced, but the list confirms $9999.00, doesn't affect use.
IX. Current Status (as of 2026-11-28 21:03)
- CT8 panel confirmed: shared hosting, not a VPS
- Port [port redacted] reserved, PostgreSQL created
- Redis running on [port redacted], Sub2API v0.2.24 running on [port redacted], verified
- Keepalive scripts + cron every 5 minutes
- [domain redacted] reverse proxy + DNS resolution, HTTP 200 opens
- Free ChatGPT account OAuth connected, tested
- Admin balance topped up to $9999
- API Key not generated yet; after generating it can be used by clients
- HTTPS cert not issued, HTTP only
Next step: go to Sub2API backend API Keys, generate a Key, configure it in Codex / Claude Code / OpenClaw etc clients, and fill in [入口已脱敏] as the address.
X. Pitfall Summary
- Don't treat CT8 as a VPS: no server list, no power on/off, only the DevilWEB panel + SSH terminal + port reservation + Cron.
- Ports must be reserved before binding: an unreserved port like [port redacted] directly gives
Operation not permitted; Redis can only use the reserved [port redacted]. - Admin login name must be email format:
adminwon't work, write it as[管理员账号已脱敏]. - Binexec must be enabled first: without it your own binary won't run; after enabling, reconnect SSH for it to take effect.
- Verify the IP by testing: the IP given at first was wrong and caused
ERR_CONNECTION_RESET; use public DNS queries as the source of truth, don't just trust the IP in the task. - DNS sync has delay: Yunamo UI "pending sync" may be lagging; rely on dnschecker / check-host external checks.
- Don't force the cert: Let's Encrypt failed 3 times and no cert came out; the user decided to stop, and plain HTTP works. Only HTTPS browser access will show a cert mismatch.
- CT8 sessions expire in 15 minutes: during long operations you'll need to log in again once.
- OAuth callback page not opening is normal: it jumps to localhost:[port redacted], don't panic, just copy the full URL from the address bar back.
- Balance has two layers: ChatGPT account quota is the usage window percentage; Sub2API calls use the admin account balance. At $0 you can't call it, top up virtual balance first.
- Yunamo has a 30-day deletion warning: triggered by the domain being unreachable for a long time; it should clear after the site recovers, but still keep an eye on it.
- Free account quota is limited: fewer models, limited daily messages, throttling at peak. When it's not enough, switch to a Plus / Pro / Team account, same process.
RT,
准备条件:
1.一个ct8或serv00(我之前申诉后面解封了)
2.一个域名(我用的是论坛的loc.cc) PS:建议现在先不用社区的域名,因为证书下不来我在这卡了一会
3.一个muse(有能力的大佬不需要,我这种小白才需要)
4.一个openai的账号(什么版都可以,都是要过手机号验证的)PS:今天逛卡网的时候看到一个0元的都是没有过手机号,我有手机号所以就搞了一个试试,不建议,我只是玩玩
下面是muse的总结和操作流程
CT8 免费主机搭建 Sub2API 全过程(脱敏版)
整理时间:2026-11-28
目标:把一个免费 ChatGPT 账号反代成 OpenAI 兼容 API,对外地址为 [入口已脱敏]
结果:已跑通,账号已挂上并测试通过,余额已充值(虚拟),只差生成 API Key 就能调用。
脱敏说明:本文已去掉所有密码、密钥、Token、OAuth 授权码、个人邮箱,以及账号名、入口地址、端口号和数据库名。密码类信息统一写为
[密码已脱敏],个人邮箱写为[邮箱已脱敏],账号名写为[账号已脱敏]/[管理员账号已脱敏]/[账号名已脱敏],入口地址和域名写为[入口已脱敏]/[域名已脱敏],端口号写为[端口已脱敏],数据库名写为[数据库名已脱敏],授权链接只保留结构不保留参数值。版本号等操作信息保留,否则步骤无法复现。
一、总览
| 项目 | 内容 |
|---|---|
| 宿主 | CT8(ct8.pl),DevilWEB 2.2 免费虚拟主机,不是 VPS |
| 系统 | FreeBSD 14.3-RELEASE-p19(amd64) |
| Sub2API | v0.2.24,FreeBSD 版,来源 KiritoXDone/Sub2API-Freebsd |
| 入口 | [入口已脱敏](纯 HTTP,未签证书) |
| 后端 | PostgreSQL + Redis |
| 上游账号 | 1 个免费 ChatGPT 账号,OAuth 接入,名为 [账号名已脱敏] |
| 管理员 | [管理员账号已脱敏](本地账号,非真实邮箱) |
| 保活 | start.sh / restart.sh + 每 5 分钟 cron |
链路:用户 / 客户端 → [入口已脱敏] → CT8 反向代理 → 127.0.0.1:[端口已脱敏](Sub2API)→ ChatGPT 账号 → OpenAI
二、起点:这不是 VPS
最初是照着一篇 LINUX DO 帖子《闲置 Serv00 部署 Sub2API 教程》想复现,Serv00 上是 Redis + PostgreSQL、内存约 200M 的方案。
实际拿到的 CT8 并不是 VPS:
- 面板是 DevilWEB 2.2(MyDevil 系免费托管),没有服务器列表,没有开机 / 关机 / 重装。
- 套餐 FREE,有效期至 2027-02-26,主目录
/usr/home/[账号已脱敏]/,主机名 s1。 - 配额:磁盘 3GB(当时只用了约 17MB)、内存 512MB、CPU 100%、进程 20 个、邮件 500 封/天。
- 面板栏目:Dashboard、Websites、DNS Zones、Mail、FTP、Databases、Repositories、Cron Jobs、Port reservation、File manager、SSH terminal。
结论:跟 Serv00 同类,有网页 SSH 终端 + 端口预留功能,Sub2API 能跑,但要按共享主机的限制来部署,不能当 VPS 用。
三、前期准备:端口 + 数据库(19:38–19:40)
都在 CT8 面板里做,账号为 [账号已脱敏]。
1. 预留端口
- Port reservation → 预留 TCP 端口 [端口已脱敏],描述 Sub2API。
- 坑:先试了一个端口,提示
This port is already taken,改 [端口已脱敏] 才成功,面板显示Port has been reserved。
2. 建 PostgreSQL
- Databases → PostgreSQL,新建:
- 数据库名 / 用户名:
[数据库名已脱敏] - 密码:
[密码已脱敏] - 主机:
pgsql.ct8.pl,端口 [端口已脱敏] - 字符集:C.UTF-8
- 数据库名 / 用户名:
- 面板显示
The database has been added,初始大小约 7.44 MB。
四、安装 Sub2API + Redis(19:40–20:00)
在面板 SSH 终端里完成,提示符为 [[账号已脱敏]@s1]:~$。
1. 先开 Binexec
面板里 Binexec(自定义软件)开关原本是关的,跑自有二进制必须开。开了之后重新连接 SSH 会话才生效。
2. 下载 Sub2API
从 KiritoXDone/Sub2API-Freebsd 下载 v0.2.24:
- 包名:
sub2api_0.2.24_freebsd_amd64.tar.gz - 解压到
~/sub2api/,加执行权限。 ./sub2api --version显示0.2.24。
系统里 redis-server 8.0.3 等工具已预装,不用另装。
3. 跑安装向导
执行 ./sub2api -setup,配置写入 ~/sub2api/config.yaml:
- Sub2API 监听:
0.0.0.0:[端口已脱敏] - PostgreSQL:
pgsql.ct8.pl:[端口已脱敏],库 / 用户[数据库名已脱敏],SSL disable,连接测试 OK。 - Redis:
localhost:[端口已脱敏],DB 0,TLS 关闭,连接测试 OK。
4. 两个被迫改动的点
(1)Redis 不能用 [端口已脱敏]
主机只允许绑定已预留端口。[端口已脱敏] 预留被拒绝,用 Python 绑定测试证实 [端口已脱敏] 和随机端口都返回 Operation not permitted,只有已预留端口能绑。
解决:又预留了一个端口 [端口已脱敏] 给 Redis,Redis 实际跑在 127.0.0.1:[端口已脱敏],Sub2API 配置里也改成 [端口已脱敏]。
(2)管理员用户名必须是邮箱格式
向导要求登录名为邮箱格式,输 admin 会报 Invalid email format。
解决:建为 [管理员账号已脱敏],密码 [密码已脱敏]。这不是真实邮箱,只是本地登录名。
其他非致命提示:JWT 密钥自动生成;Sub2API 日志初始化失败(想建 /app/data/logs 无权限),降级为标准输出,由 nohup 写到 ~/sub2api/sub2api.log。
5. 验证通过
最后核查时:
- Redis 在跑,
redis-server 127.0.0.1:[端口已脱敏],密码验证返回 PONG,版本 8.0.3。 - Sub2API 在跑,日志显示
Server started on 0.0.0.0:[端口已脱敏]。 - curl 验证:
http://127.0.0.1:[端口已脱敏]/200,/health200,/login200。 - 管理员登录接口
POST /api/v1/auth/login返回 code 0,并签发 access_token。
五、保活:防止进程被杀
共享主机不保证后台进程常驻,所以加了两层保活:
~/sub2api/start.sh与~/sub2api/restart.sh,均可执行。restart.sh已实测:停掉 Redis 和 Sub2API 后,两者都以新 PID 恢复,Redis PONG、Sub2API 首页 HTTP 200。- 面板 Cron Jobs:每 5 分钟跑一次
start.sh。 - 原有的 ct8-keepalive 定时任务未动。
凭证统一存在服务器 ~/.sub2api-creds,权限 600,本文不记录具体值。
六、绑域名 [域名已脱敏](20:01–20:38,纯 HTTP)
1. CT8 面板:加反向代理网站
- Websites → 添加网站
[域名已脱敏],类型 Proxy(Reverse Proxy)。 - 目标:
http://127.0.0.1:[端口已脱敏]。 - 网站目录:
/usr/home/[账号已脱敏]/domains/[域名已脱敏],添加时同时创建默认 DNS 区域。 - SSL 强制关闭。
- 原有网站
[账号已脱敏].ct8.pl(PHP 8.3)未动,Sub2API 本身未动。
2. Yunamo:DNS 解析
域名 [域名已脱敏] 当天在 Yunamo 注册,账号为 [账号已脱敏],状态正常。
- DNS 记录:1 条,
A @ → 136.243.156.120,TTL 1 小时,仅 DNS。 - 权威 NS:
cat.ns.yunamo.com/dog.ns.yunamo.com。
3. 踩坑:IP 一开始是错的
最初用的 IP 198.18.3.147 并不是 [账号已脱敏].ct8.pl 的真实 IP,实测 HTTP/HTTPS 都 ERR_CONNECTION_RESET,到不了 CT8。
排查后发现公开 DNS 显示 [账号已脱敏].ct8.pl 实际解析到 136.243.156.120。
- 试过改 CNAME 指向
[账号已脱敏].ct8.pl,但在 Yunamo 界面长时间停在“待同步”未发布。 - 最后改回 A 记录,直接指向核实后的正确 IP
136.243.156.120。 - dnschecker.org 全球约 26 个节点检查一致,都解析到正确 IP,证明记录已生效(Yunamo 界面仍显示“待同步”,是界面状态滞后)。
4. 证书:试了 3 次,最后决定不签
- CT8 的 WWW Certificates 列表刷新后确认是 0 张证书。
- 此前 3 次 Let's Encrypt 签发尝试都没生成证书,面板无报错、无证书产生。
- 用户决定不签证书了,立即停止尝试,只走纯 HTTP。
- 现状:
[入口已脱敏]提供的是 CT8 共享通配符证书(CN=*.ct8.pl),与域名不匹配,浏览器会报证书错误。当前可用访问方式为 HTTP。
5. 验证能打开
- 服务器内:
curl [入口已脱敏]/返回 200,页面标题Sub2API - AI API Gateway;本地127.0.0.1:[端口已脱敏]同样 200,证明反向代理整条链路正常。 - 外部:check-host.net 多地检查均返回 HTTP 200(3389 字节);dnschecker 全球解析一致。
- 例外:当时云端浏览器那台机子仍显示
ERR_CONNECTION_RESET,是因为它本地解析缓存里还是旧 A 记录(TTL 3600),并非站点问题,缓存过期后即可正常打开。
其他:CT8 会话约 15 分钟过期,执行期间重新登录过一次。
6. Yunamo 的警告
Yunamo 页面顶部有一条警告:“由于长期健康检查失败,此域名将在 30 天内被自动删除”。这是域名此前不可达期间产生的,随着站点恢复、健康检查通过应会解除,需要留意。
七、挂免费 ChatGPT 账号(20:43–20:56,环境 2)
Sub2API 的核心用法就是把 ChatGPT 会员 / 免费账号反代成 API,用的不是 API Key,而是账号 OAuth。
1. 建分组
后台本来只有一个分组 default(Anthropic,费率 1x),没有 OpenAI 分组。
新建分组:平台 OpenAI,名称 ChatGPT,费率 1,其他默认。
2. 添加账号
账号管理 → 添加账号:
- 平台:OpenAI
- 类型:OAuth(ChatGPT OAuth)
- 名称:[账号名已脱敏]
- 模型:点了“清除所有模型”,模型列表变为 0 个(支持所有模型,后续自动兼容)
- 并发:默认 10
- 所属分组:勾选刚建的 ChatGPT 分组
然后点“生成授权链接(Generate Authorization URL)”。
3. OAuth 授权(必须用户自己在浏览器里做)
生成的授权链接结构大致为:
https://auth.openai.com/oauth/authorize?client_id=[已脱敏]&redirect_uri=http://localhost:[端口已脱敏]/auth/callback&response_type=code&scope=openid+profile+email+offline_access&state=[已脱敏]
流程:
- 把链接发给用户,在已登录该免费 ChatGPT 账号的浏览器里打开。
- 登录 / 点授权。
- 授权完会跳到
http://localhost:[端口已脱敏]/auth/callback?code=...,页面打不开是正常的。 - 把地址栏里完整的跳转链接复制回来。
- 粘贴回 Sub2API 添加账号对话框的 Code 输入框,系统自动解析出 code,点“完成授权”。
- 页面先显示“正在验证授权码,请稍候...”,随后提示“账号添加成功!”。
注意:全程没给过 ChatGPT 密码,密码只在用户自己的浏览器里用。
4. 账号状态与测试
添加成功后账号出现在列表中(2026-11-28 20:56 创建,ID #1):
- 名称:[账号名已脱敏]
- 账号邮箱:
[邮箱已脱敏] - 平台 / 类型:OpenAI / OAuth
- 订阅:Free,Private,Compact Auto,训练数据共享已关闭
- 状态:正常;调度:已开启;分组:ChatGPT;容量 0 / 10;优先级 1
- 用量窗口:5h 0%、7d 0%;额度采样时间 2026-11-28 20:56:04;最近使用:从未;过期时间:-
测试:账号“更多 → 测试连接”,默认模型 GPT-Reserve,测试消息 hi,点“开始测试”,显示“测试完成!”,返回:
Hi! What can I help you with?
可用模型共 12 个(测试对话框下拉确认到底,无更多):
GPT-Reserve、GPT-6-Luna、GPT-5.6-Terra、GPT-5.6-Luna、Codex Auto Review、GPT Image 1、GPT Image 1.5、GPT Image 2、GPT Image 2.5 Flare、GPT Image 2.5 Sunburst、GPT Image 2.6 Flare、GPT Image 2.6 Sunburst
其中 GPT-Reserve 已实测可正常调用。
八、余额:两笔账要分开
1. ChatGPT 账号本身
Sub2API 里不显示具体剩多少条消息 / token,只显示用量窗口:
- 5 小时:0%
- 7 天:0%,旁边写
29d 23h - 次数:0;点数:0
- “重置”按钮显示“没有可用的重置次数”,不可点击
意思就是还没用过,额度是满的。免费号的额度是按时间窗口算的,不是按钱算的。
2. Sub2API 账户余额
用户管理里 admin 账号:
- 充值前:$0.00,总充值 $0.00,暂无变动记录。
- 2026-11-28 21:03 充值 $9999(虚拟余额,非真实付款),备注留空,页面提示“成功”。
- 充值后用户列表刷新显示 $9999.00。
- 小异常:页面顶栏余额仍显示 $0.00 未同步更新,但列表里已确认是 $9999.00,不影响使用。
九、当前状态(截至 2026-11-28 21:03)
- CT8 面板确认:虚拟主机,非 VPS
- 端口 [端口已脱敏] 预留,PostgreSQL 建好
- Redis 跑在 [端口已脱敏],Sub2API v0.2.24 跑在 [端口已脱敏],验证通过
- 保活脚本 + 每 5 分钟 cron
- [域名已脱敏] 反向代理 + DNS 解析,HTTP 200 能打开
- 免费 ChatGPT 账号 OAuth 挂上,测试通过
- 管理员余额充到 $9999
- API Key 还没生成,生成后才能给客户端调用
- 未签 HTTPS 证书,只能用 HTTP
下一步:去 Sub2API 后台 API 密钥里生成一个 Key,配到 Codex / Claude Code / OpenClaw 等客户端就能用,地址填 [入口已脱敏]。
十、踩坑总结
- 别把 CT8 当 VPS:没有服务器列表、没有开关机,只有 DevilWEB 面板 + SSH 终端 + 端口预留 + Cron。
- 端口必须先预留才能绑:[端口已脱敏] 这种没预留的端口直接
Operation not permitted,Redis 只能用已预留的 [端口已脱敏]。 - 管理员登录名必须是邮箱格式:
admin不行,要写成[管理员账号已脱敏]这种形式。 - Binexec 要先开:不开跑不了自有二进制,开了要重连 SSH 才生效。
- IP 要实测核对:一开始给的 IP 是错的,导致
ERR_CONNECTION_RESET,以公开 DNS 查询为准,别只信任务里给的 IP。 - DNS 同步有延迟:Yunamo 界面“待同步”可能是滞后,以 dnschecker / check-host 的外部检查为准。
- 证书别硬签:Let's Encrypt 3 次都没出证书,用户决定不签就停,纯 HTTP 也能用,只是浏览器访问 HTTPS 会报证书不匹配。
- CT8 会话 15 分钟过期:长时间操作中途要重新登录一次。
- OAuth 回调页打不开是正常的:跳到 localhost:[端口已脱敏] 不用慌,复制地址栏完整链接回来就行。
- 余额分两层:ChatGPT 账号额度看用量窗口百分比,Sub2API 调用看管理员账户余额,$0 时调不了,先充虚拟余额。
- Yunamo 有 30 天删除警告:域名此前长期不可达触发的,站点恢复后应解除,仍需留意。
- 免费号额度有限:模型少、每天消息数有限、高峰会限流,不够用时再换 Plus / Pro / Team 号,流程一样。
Translated by AI from 简体中文Original (简体中文)
快银 VPN,一键连接全球节点,线路稳定、延迟低。支持 Windows、macOS 等多平台,TUN 全局模式覆盖全部应用流量。无需复杂配置,下载即用。
10 replies
Sort order