API 文档
查询 ChatGPT AC token 是否 401 失效,以及该账号是否符合优惠活动资格。
认证状态加载中 ...
POST /api/v1/check
POST
/api/v1/check
提交一个或多个 AC token,返回每个 token 的有效性 + 优惠资格。
请求体
| 字段 | 类型 | 说明 |
|---|---|---|
| token | string | 单个 AC token (与 tokens 二选一) |
| tokens | string[] | 批量 AC token 列表 (与 token 二选一) |
| promoId | string? | 优惠活动 id, 默认 plus-1-month-free |
| proxyUrl | string? | 覆盖默认出站代理 (一般留空) |
响应字段 (单个)
| 字段 | 类型 | 说明 |
|---|---|---|
| token_ok | boolean | AC 是否仍然有效 (false = 401 / 已过期) |
| eligible | boolean | 是否享有优惠 (token_ok && coupon 状态可用) |
| reason | string | 详细原因, 见下方枚举表 |
| coupon_state | string? | OpenAI 返回的 state 原值 (eligible / not_eligible / ...) |
| promo_id | string | 本次检查的优惠活动 id |
| status | number? | OpenAI 返回的 HTTP 状态码 |
| string? | 从 JWT 解出的账号邮箱 | |
| account_id | string? | 从 JWT 解出的 chatgpt account_id |
| plan_type | string? | JWT 中的 plan_type 快照, 仅参考 |
| jwt_expired | boolean | 本地解 JWT exp 是否已过期 |
| jwt_exp_ms | number | JWT 过期时间戳(ms) |
| jwt_exp_in_sec | number | 距离过期的秒数 (负数 = 已过期) |
示例
curl -X POST -H 'content-type: application/json' \
-d '{"token":"eyJhbGciOi...","promoId":"plus-1-month-free"}' \
http://YOUR_HOST:8787/api/v1/check
curl -X POST -H 'content-type: application/json' \
-d '{"tokens":["eyJ...","eyJ..."]}' \
http://YOUR_HOST:8787/api/v1/check
{
"token_ok": true,
"eligible": true,
"reason": "eligible",
"coupon_state": "eligible",
"promo_id": "plus-1-month-free",
"status": 200,
"email": "user@example.com",
"account_id": "acct-...",
"plan_type": "free",
"jwt_expired": false,
"jwt_exp_ms": 1779194976000,
"jwt_exp_in_sec": 86234
}
{
"count": 2,
"promo_id": "plus-1-month-free",
"results": [
{ "token_ok": true, "eligible": true, "reason": "eligible", "email": "a@x.com", "...": "..." },
{ "token_ok": false, "eligible": false, "reason": "token-401", "email": "b@x.com", "...": "..." }
]
}
const r = await fetch("http://YOUR_HOST:8787/api/v1/check", {
method: "POST",
headers: {
"content-type": "application/json",
// "authorization": "Bearer YOUR_AUTH_TOKEN", // 服务端开了鉴权再加
},
body: JSON.stringify({ token: "eyJ..." }),
});
const data = await r.json();
console.log(data.eligible, data.reason);
import requests
r = requests.post(
"http://YOUR_HOST:8787/api/v1/check",
json={"token": "eyJ..."},
# headers={"authorization": "Bearer YOUR_AUTH_TOKEN"},
timeout=30,
)
data = r.json()
print(data["eligible"], data["reason"])
GET /api/v1/check
GET
/api/v1/check?token=...&promoId=...
curl 友好的简写,等价于 POST 单查。
curl 'http://YOUR_HOST:8787/api/v1/check?token=eyJ...'
reason 枚举
eligible
符合优惠资格
not-eligible
账号无优惠资格(已用过 / 不符合 SKU)
token-401
AC token 已失效或被吊销
jwt-expired
JWT exp 已过(本地判断,免一次远端调用)
empty-token
未提供 token
fetch-error
网络异常,无法到达 OpenAI
http-error
OpenAI 返回非 200 (CF 拦截 / 限流)
unknown-coupon-state
200 但 state 字段缺失
unauthorized
服务端鉴权失败
其它端点
GET/healthz
探活,返回
{ ok: true, brand: "Nerver", promo_id: "..." }GET/api/v1/docs
机器可读的接口契约 (JSON),适合自动化对接。