-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
248 lines (230 loc) · 11.8 KB
/
Copy pathindex.html
File metadata and controls
248 lines (230 loc) · 11.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Codex Agent Identity · 无需手机号登录 Codex:无需验证码 / 免短信,纯前端把 ChatGPT Session 转成 auth.json,导入 Cockpit 启动 Codex。Session 仅本机处理。" />
<meta name="keywords" content="Codex Agent Identity,无需手机号登录 Codex,Codex 无需验证码,Codex 免短信,Codex 免接码,Codex 跳过手机验证,ChatGPT Codex 登录,agent_identity,auth.json,Cockpit 导入 Codex,Codex CLI 登录" />
<title>Codex Agent Identity · 无需手机号登录 Codex</title>
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<div class="bg-grid" aria-hidden="true"></div>
<div class="app">
<header class="header">
<div class="brand">
<span class="brand-mark">◇</span>
<div>
<h1>Codex Agent Identity · 无需手机号登录 Codex</h1>
<p class="tagline">无需验证码 / 免短信 · 纯前端生成 auth.json · 导入 Cockpit 启动 Codex</p>
</div>
</div>
<div class="header-badges">
<span class="badge ok">No server</span>
<span class="badge">Ed25519</span>
<a
class="badge github-badge"
id="githubBadge"
href="https://github.com/JeremyPy/codex-agent-identity"
target="_blank"
rel="noopener"
title="GitHub 仓库"
aria-label="GitHub 仓库"
>
<svg class="github-icon" viewBox="0 0 16 16" width="16" height="16" aria-hidden="true">
<path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
</svg>
</a>
</div>
</header>
<nav class="step-nav" aria-label="步骤进度">
<div class="step-nav-item" data-step-nav="1"><span>1</span>登录</div>
<div class="step-nav-item" data-step-nav="2"><span>2</span>复制 Session</div>
<div class="step-nav-item" data-step-nav="3"><span>3</span>生成</div>
<div class="step-nav-item" data-step-nav="4"><span>4</span>Cockpit</div>
</nav>
<section class="notice notice-critical" role="alert">
<strong>重要提醒(截止 2026-07-23)</strong>
该方法<strong>新账号已无法使用</strong>,注册 / 生成时可能出现 <code>403</code> 等错误。
<strong>此前已完成授权(已生成并成功导入使用)的账号不受影响。</strong>
请勿再对新账号依赖本流程。
</section>
<section class="notice compact">
<strong>安全</strong>
密钥在本机浏览器生成;仅请求 <code>auth.openai.com</code>。
<code>accessToken</code> 等同密码,勿发到公开渠道。仅限自有账号,请遵守 OpenAI 服务条款。
</section>
<!-- Step 1 -->
<section class="step-card" id="step1" data-step="1">
<header class="step-head">
<div class="step-num">1</div>
<div>
<h2>登录 ChatGPT</h2>
<p>在浏览器中登录你的 ChatGPT 账号(保持登录状态)。</p>
</div>
</header>
<div class="step-body">
<a class="btn primary" href="https://chatgpt.com" target="_blank" rel="noopener">打开 chatgpt.com 登录</a>
<p class="step-tip">已登录可直接进入下一步。</p>
</div>
</section>
<!-- Step 2 -->
<section class="step-card" id="step2" data-step="2">
<header class="step-head">
<div class="step-num">2</div>
<div>
<h2>复制 Session JSON</h2>
<p>打开下面链接,复制<strong>整页 JSON</strong>(或只复制 <code>accessToken</code> 字段)。</p>
</div>
</header>
<div class="step-body">
<div class="link-row">
<code class="link-box" id="sessionUrl">https://chatgpt.com/api/auth/session</code>
<button type="button" class="btn" id="btnCopySessionUrl">复制链接</button>
<a class="btn primary" href="https://chatgpt.com/api/auth/session" target="_blank" rel="noopener">打开 Session 页</a>
</div>
<ul class="step-list">
<li>必须在<strong>已登录</strong>的同一浏览器里打开该链接。</li>
<li>页面应显示一长段以 <code>{</code> 开头的 JSON;全选复制即可。</li>
<li>若复制时带上了其它页面文字(如支付工具 UI),粘贴后会<strong>自动清理并格式化</strong>。</li>
</ul>
</div>
</section>
<!-- Step 3 -->
<section class="step-card" id="step3" data-step="3">
<header class="step-head">
<div class="step-num">3</div>
<div>
<h2>粘贴并生成 auth.json</h2>
<p>把上一步复制的内容粘贴到下方,点击生成。密钥在本地生成,token 只发给 OpenAI 注册 agent。</p>
</div>
</header>
<div class="step-body">
<label class="field-label" for="input">
粘贴 Session / Access Token
<span class="hint">粘贴后自动格式化</span>
</label>
<textarea
id="input"
spellcheck="false"
placeholder="在此粘贴第 2 步复制的整页 JSON,或纯 accessToken(eyJ…)"
rows="12"
></textarea>
<div class="row options">
<label class="check">
<input type="checkbox" id="verifyTask" checked />
注册后验证 task(可选,失败不影响 auth.json)
</label>
<label class="field-inline">
输出文件名
<input type="text" id="filename" value="auth.json" />
</label>
</div>
<div class="actions">
<button type="button" id="btnGenerate" class="btn primary">生成 auth.json</button>
<button type="button" id="btnClear" class="btn ghost">清空</button>
</div>
<div id="status" class="status" hidden></div>
<section id="result" class="result" hidden>
<div class="result-head">
<h3>生成结果</h3>
<div class="actions tight">
<button type="button" id="btnCopy" class="btn">复制 JSON</button>
<button type="button" id="btnDownload" class="btn primary">下载 auth.json</button>
</div>
</div>
<dl class="meta" id="meta"></dl>
<pre id="output" class="code"></pre>
<p class="step-tip ok-tip">生成成功后,请下载文件,继续<strong>第 4 步</strong>:导入到 API 服务并点击开始。</p>
</section>
</div>
</section>
<!-- Step 4: Cockpit -->
<section class="step-card" id="step4" data-step="4">
<header class="step-head">
<div class="step-num">4</div>
<div>
<h2>用 Cockpit 导入到 API 服务并启动</h2>
<p>下载 Cockpit → 导入 <code>auth.json</code> 到 <strong>API 服务</strong> → 点开始。</p>
</div>
</header>
<div class="step-body">
<ol class="cockpit-steps">
<li class="cockpit-step">
<div class="cockpit-step-title">
<span class="mini-num">1</span>
<strong>下载并安装 Cockpit</strong>
</div>
<p class="step-tip">打开 Releases 页,按系统下载安装(macOS 一般选 <code>.dmg</code>,Windows 选 <code>.msi</code>)。</p>
<div class="actions" style="margin-top:0.65rem">
<a class="btn primary" href="https://github.com/jlcodes99/cockpit-tools/releases" target="_blank" rel="noopener">下载 Cockpit</a>
<a class="btn" href="https://github.com/jlcodes99/cockpit-tools" target="_blank" rel="noopener">项目主页</a>
</div>
<figure class="shot">
<img src="./assets/cockpit-home.png" alt="Cockpit 首页" loading="lazy" />
<figcaption>安装后打开 Cockpit,进入 Codex 相关模块</figcaption>
</figure>
</li>
<li class="cockpit-step">
<div class="cockpit-step-title">
<span class="mini-num">2</span>
<strong>点击「导入」→ 从本地文件导入 auth.json</strong>
</div>
<p class="step-tip">添加 Codex 账号 → 顶部选 <strong>导入</strong> → <strong>从本地文件导入</strong>,选择第 3 步下载的 <code>auth.json</code>。</p>
<figure class="shot">
<img src="./assets/cockpit-import-file.png" alt="Cockpit 从本地文件导入" loading="lazy" />
<figcaption>选中「导入」→「从本地文件导入」</figcaption>
</figure>
</li>
<li class="cockpit-step">
<div class="cockpit-step-title">
<span class="mini-num">3</span>
<strong>直接导入并添加到 API 服务</strong>
</div>
<p class="step-tip">解析成功后确认是 Agent Identity。请点绿色按钮 <strong>「直接导入并添加到 API 服务」</strong>(推荐),把账号写入 API 服务号池;不要只点「不检测,直接导入」。</p>
<figure class="shot">
<img src="./assets/cockpit-import-api.jpg" alt="直接导入并添加到 API 服务" loading="lazy" />
<figcaption>红色框:直接导入并添加到 API 服务</figcaption>
</figure>
</li>
<li class="cockpit-step">
<div class="cockpit-step-title">
<span class="mini-num">4</span>
<strong>在 API 服务卡片点击「开始」</strong>
</div>
<p class="step-tip">切换到 <strong>API 服务</strong> 卡片,确认账号池可用后,点底部工具栏的 <strong>播放 / 开始</strong> 按钮启动服务。</p>
<figure class="shot">
<img src="./assets/cockpit-api-start.png" alt="API 服务点击开始" loading="lazy" />
<figcaption>红色框:API 服务的开始按钮</figcaption>
</figure>
</li>
</ol>
<ul class="step-list">
<li><code>auth.json</code> 含私钥,请勿上传到公开仓库或发给陌生人。</li>
<li>若提示「已存在」,可先删掉旧账号再导入,或直接用已有账号点 API 服务开始。</li>
<li>若导入失败,确认文件是本页生成的 <code>auth_mode: agent_identity</code> 格式,且 Cockpit 版本支持 Agent Identity。</li>
</ul>
</div>
</section>
<section class="howto muted-block">
<h2>原理(可选阅读)</h2>
<p class="muted">
有效 Session JWT → 本地 Ed25519 密钥对 →
<code>POST auth.openai.com/api/accounts/v1/agent/register</code> →
写出 <code>auth_mode: agent_identity</code>。
免的是 Codex OAuth 登录接码,不是「白号免短信注册」。
</p>
</section>
<footer class="footer">
<span>
开源 · 纯静态 ·
<a id="siteLink" href="https://codex.lucoo.net/" target="_blank" rel="noopener">codex.lucoo.net</a>
·
<a id="githubLink" href="https://github.com/JeremyPy/codex-agent-identity" target="_blank" rel="noopener">GitHub</a>
</span>
<a href="./LICENSE" class="muted">MIT License</a>
</footer>
</div>
<script type="module" src="./app.js"></script>
</body>
</html>