Skip to content

aBung87/GPTSession2CPAandSub2API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT Session to CPA / sub2api / Cockpit / 9router / AxonHub / Codex-Manager

纯前端单页面工具,用来把 ChatGPT Web 登录 session JSON 转换成 CPA、sub2api、Cockpit Tools、9router、AxonHub 或 Codex-Manager 可导入 JSON。

在线使用

使用提示

Plus 号可以用此方式导入中转站使用;Free 号的 access token 不能用于调用接口。

本工具可用来解决 Codex OAuth 登录需要绑定手机的问题。Plus 账号通过 Web 登录后的 session 就能生成可导入中转站的账号 JSON 数据;这类数据没有 refresh_token,但 access_token 有效期通常足够长。

解释一下: plus激活前(free状态)或激活后(plus状态)获取的session在使用上没有区别(free时拿到的session, 激活plus后就可以调模型了),只是账号级别标识有点区别(标识为free or plus),不影响调模型。 换句话讲,不管你啥时候拿到的session, 用本项目转换导入中转站,只要账号当前激活了plus, 就能正常调模型接口。

本工具主要针对 Plus 账号适用,Free 账号即使转换了也没有权限调用 GPT 模型。GoPay 拉闸了,没法每天发 Plus 了;加入 Discord 频道免费获取 GPT 撸羊毛信息,然后配合本工具导入 CPA or Sub2API 使用。

GOAPY 拉闸了, Party is OVER ~

加入 Discord 频道免费获取 GPT 撸羊毛信息:

邀请链接:https://discord.gg/GFmHY2TZNy

支持输入

支持粘贴或拖入 ChatGPT Web session JSON,例如包含:

  • user.email
  • accessToken
  • sessionToken
  • expires
  • account.id
  • account.planType

也支持粘贴或拖入 9router Codex OAuth JSON,例如包含 accessTokenrefreshTokenexpiresAtproviderSpecificData.chatgptAccountIdproviderSpecificData.chatgptPlanType

也支持粘贴或拖入 AxonHub Codex auth.json,例如包含 tokens.access_tokentokens.refresh_tokentokens.id_tokenlast_refresh

也支持粘贴或拖入 Codex-Manager 批量导入 JSON,例如包含 tokens.access_tokentokens.refresh_tokentokens.id_tokenmeta.label

页面也会尝试从 accessToken 的 JWT payload 中补充邮箱、账号 ID、用户 ID、计划类型和过期时间。

输出格式

  • CPA:生成 Codex CPA auth JSON,包含 type: "codex"access_tokensession_tokenid_tokenemailaccount_id、套餐和过期时间等字段;缺少真实 id_token 时会根据 session 与 access token claims 构造 Codex 可解析的占位 JWT claims。
  • sub2api:生成参考 CPA2sub2API 项目的 exported_at/proxies/accounts 结构,账号平台为 openai,类型为 oauth;每个账号对象包含 expires_atauto_pause_on_expired,其中 expires_at 来自该账号 access token 的 JWT exp 秒级时间戳。
  • Cockpit:生成 Cockpit Tools Codex JSON 导入可识别的扁平 token 格式,包含 id_tokenaccess_tokenrefresh_tokenaccount_idemailexpired 等字段。
  • 9router:生成 9router Codex OAuth JSON,包含 accessTokenrefreshTokenexpiresAtproviderSpecificDataproviderauthTypepriorityisActivecreatedAtupdatedAt 等字段。
  • AxonHub:生成 AxonHub Codex auth.json,包含 auth_mode: "chatgpt"last_refreshtokens.access_token/refresh_token/id_token。缺少真实 refresh_token 时会写入 __missing_refresh_token__ 占位值,方便在 access token 过期前试用;过期后不能自动刷新。
  • Codex-Manager:生成 Codex-Manager 批量导入 JSON,包含 tokens.access_token/refresh_token/id_tokenmeta.label/workspace_id/chatgpt_account_id/note。缺少真实 refresh_token 时保留空字符串,避免被 Codex-Manager 误判为可刷新账号。 ChatGPT Web session 通常不包含 OAuth 文件里常见的 refresh_token,因此 access token 过期后不能自动刷新。

本地使用

直接打开:

docs/index.html

所有解析和转换都在浏览器本地完成,不上传 token,不写入本地存储。

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%