主 题:Codex从sub2api转cpa极简小脚本📝
发 布 者:royswift
标签分类: 技术
时 间:2026-08-22 09:35:42
内容预览:Tibo说sub2api分发不合规,不知道后续会有啥动作,索性把sub2api里的gpt free账号转换到cpa里有备无患。kimi k3搓的,简陋风格。实测 sub2api v0.1.178 转换到CLI Proxy API v7.2.131 成功。sub2api_to_cpa_gui.pyimport jsonimport osimport threadingimport tkinter as tkfrom tkinter import ttk, filedialog, messageboxfrom datetime import datetime, timezone, timedeltaCN_TZ = timezone(timedelta(hours=8))def convert_credentials(creds, acc, cfg): target = {} target['access_token'] = creds.get('access_token', '') target['account_id'] = creds.get('chatgpt_account_id', '') target['disabled'] = cfg['disabled'] target['email'] = creds.get('email', '') or acc.get('name', '') expires_at = creds.get('expires_at', '') if isinstance(expires_at, (int, float)): dt = datetime.fromtimestamp(expires_at, tz=CN_TZ) target['expired'] = dt.strf
直达链接: https://www.nodeseek.com/post-887467-1
发 布 者:royswift
标签分类: 技术
时 间:2026-08-22 09:35:42
内容预览:Tibo说sub2api分发不合规,不知道后续会有啥动作,索性把sub2api里的gpt free账号转换到cpa里有备无患。kimi k3搓的,简陋风格。实测 sub2api v0.1.178 转换到CLI Proxy API v7.2.131 成功。sub2api_to_cpa_gui.pyimport jsonimport osimport threadingimport tkinter as tkfrom tkinter import ttk, filedialog, messageboxfrom datetime import datetime, timezone, timedeltaCN_TZ = timezone(timedelta(hours=8))def convert_credentials(creds, acc, cfg): target = {} target['access_token'] = creds.get('access_token', '') target['account_id'] = creds.get('chatgpt_account_id', '') target['disabled'] = cfg['disabled'] target['email'] = creds.get('email', '') or acc.get('name', '') expires_at = creds.get('expires_at', '') if isinstance(expires_at, (int, float)): dt = datetime.fromtimestamp(expires_at, tz=CN_TZ) target['expired'] = dt.strf
直达链接: https://www.nodeseek.com/post-887467-1