ai-zero-token 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.8 - 2026-04-29
4
+
5
+ - Removed local Free-plan blocking for image generation and editing; upstream account limits now decide availability.
6
+ - Switched image request orchestration to `gpt-5.4-mini` while keeping the requested image model on the `image_generation` tool.
7
+ - Increased the default gateway request body limit to 32 MiB and added `AZT_BODY_LIMIT_MB` for large JSON base64 image inputs.
8
+ - Updated the management-page update command to `npm install -g ai-zero-token`.
9
+ - Reworked the README into a cleaner open-source project format and added `README.zh-CN.md` for Simplified Chinese.
10
+
11
+ ## 1.0.7 - 2026-04-29
12
+
13
+ - Added JSON `POST /v1/images/edits` support for image-to-image workflows with URL, base64 data URL, or raw base64 image references.
14
+ - Added management-page Edits test examples and documented the JSON image editing request format.
15
+ - Added `id_token` persistence for login, refresh, import, export, and account transfer JSON.
16
+ - Added "Apply to Codex" account action to back up and update local `~/.codex/auth.json` for new Codex sessions.
17
+ - Updated the local AI-Zero-Token skill documentation package with image editing and Codex account switching guidance.
18
+
3
19
  ## 1.0.6 - 2026-04-28
4
20
 
5
21
  - Added account JSON import/export support in the management page.
package/README.md CHANGED
@@ -1,463 +1,248 @@
1
1
  # AI Zero Token
2
2
 
3
- > 实验工具,不建议直接作为生产环境网关使用。
3
+ [English](README.md) | [简体中文](README.zh-CN.md)
4
4
 
5
- AI Zero Token 是一个本地优先的单用户 AI CLI 和本地网关。
5
+ Local-first OpenAI-compatible gateway for ChatGPT/Codex OAuth accounts.
6
6
 
7
- 它把账号授权能力整理成 OpenAI 风格接口,重点是把图片生成能力也代理出来:
7
+ AI Zero Token provides a local CLI, web console, and HTTP gateway that expose saved ChatGPT/Codex account capabilities through OpenAI-style endpoints. It is designed for local single-user workflows, prototyping, automation, and OpenAI-compatible clients.
8
8
 
9
- - `POST /v1/images/generations`
10
- - `POST /v1/responses`
11
- - `POST /v1/chat/completions`
12
- - `GET /v1/models`
9
+ > This is an experimental local tool. It is not an official OpenAI product and is not recommended as a production multi-tenant gateway.
13
10
 
14
- 很多用户已经有 ChatGPT 之类产品的账号、订阅或可用授权能力,但缺少一个统一、可脚本化、可本地集成的入口。AI Zero Token 要做的,就是把这类已有授权能力整理成一个可直接使用的命令行工具和本地接口。
11
+ ## Features
15
12
 
16
- ## 这次迭代亮点
17
-
18
- - 直接代理 `gpt-image-2`,把图片生成能力暴露成 OpenAI 风格 `images.generations` 接口
19
- - 启动 `azt start` 后即可获得本地管理页和本地网关,适合脚本、前端和自动化流程接入
20
- - 支持多账号保存、切换当前账号、查看账号套餐 plan,以及当前账号是否支持生图
21
- - 模型列表会优先同步本机 `~/.codex/models_cache.json`,不需要每次为新模型重新 build
22
- - 管理页会每 10 分钟自动同步额度快照和版本状态,并提示当前版本是否可更新
23
- - `free` 账号会在管理页直接预警,并在网关层明确拦截生图请求
24
-
25
- 如果你只关心一句话,可以把这个项目理解为:
26
-
27
- > 一个把账号授权能力代理成本地 OpenAI 风格接口的实验工具,这次重点补齐了 `gpt-image-2` 生图接口。
13
+ - OpenAI-compatible local API:
14
+ - `GET /v1/models`
15
+ - `POST /v1/responses`
16
+ - `POST /v1/chat/completions`
17
+ - `POST /v1/images/generations`
18
+ - `POST /v1/images/edits`
19
+ - ChatGPT/Codex OAuth login with local token refresh.
20
+ - Multi-account management in the web console.
21
+ - Account JSON import/export, including selected batch export.
22
+ - Apply a saved account to local Codex by backing up and updating `~/.codex/auth.json`.
23
+ - `gpt-image-2` image generation and JSON image editing through the ChatGPT internal Responses path.
24
+ - Optional upstream proxy configuration for OAuth, model refresh, and gateway forwarding.
25
+ - Local model discovery from the Codex model cache with manual refresh support.
28
26
 
29
- ## 一条命令开始
27
+ ## Quick Start
30
28
 
31
29
  ```bash
32
30
  npm install -g ai-zero-token
33
31
  azt start
34
32
  ```
35
33
 
36
- 启动后会打开本地管理页,并暴露 OpenAI 风格接口:
34
+ The command starts the local web console and gateway:
37
35
 
38
36
  ```text
37
+ http://127.0.0.1:8787
39
38
  http://127.0.0.1:8787/v1
40
39
  ```
41
40
 
42
- ## 界面预览
43
-
44
- ![AI Zero Token 管理页预览](docs/images/admin-dashboard.jpg)
45
-
46
- ## 生图结果预览
47
-
48
- 下图通过 AI Zero Token 本地网关调用 `POST /v1/images/generations` 生成,模型为 `gpt-image-2`。
49
-
50
- ![AI Zero Token gpt-image-2 生图结果预览](docs/images/gpt-image-2-preview.png)
51
-
52
- ## 为什么做这个项目
53
-
54
- 如果你只是想在自己的电脑上更低门槛地接入主流 LLM,现实里通常会遇到这几个问题:
55
-
56
- - 已经有产品订阅,但还没有开发者 API 方案
57
- - 想把能力接入自己的脚本、前端、本地工作流,但不想每次都手工操作网页
58
- - 想统一本地调用方式,而不是每家产品各写一套接入逻辑
59
- - 想学习 OAuth、CLI、网关、npm CLI、桌面端这类真实工程能力
60
-
61
- AI Zero Token 就是围绕这些问题设计的。
62
-
63
- ## 它能解决什么
64
-
65
- - 想把 ChatGPT 的图片生成能力接到自己的前端、小工具或脚本里
66
- - 想先用本地网关验证产品原型,而不是一上来就重做整套后端
67
- - 想统一成 OpenAI 风格接口,减少接入成本
68
- - 想研究一条完整的 OAuth -> token -> 本地状态 -> 网关 -> 上游请求链路
69
-
70
- ## 架构概览
41
+ Use any non-empty API key value when a client requires one. Authentication is handled by the local gateway.
71
42
 
72
- ![AI Zero Token 实验工具架构图](docs/images/architecture-diagram.png)
43
+ ## Web Console
73
44
 
74
- ## 当前能做什么
45
+ The web console is the recommended entry point:
75
46
 
76
- - 通过 `POST /v1/images/generations` 代理 `gpt-image-2` 生图请求
77
- - 通过 OpenAI Codex OAuth 登录
78
- - 在本地保存 `access_token` `refresh_token`
79
- - 支持保存多个账号 profile,并手动切换当前生效账号
80
- - token 过期时自动刷新
81
- - 通过 `azt start` 一键启动本地 HTTP 网关和管理页面
82
- - 在管理页面里完成多账号登录、查看账号状态、切换当前账号、切换默认模型、测试接口
83
- - 模型列表优先读取本机 Codex 最新缓存,并支持在 CLI / 管理页手动同步
84
- - 暴露 OpenAI 风格接口:
85
- - `GET /v1/models`
86
- - `POST /v1/responses`
87
- - `POST /v1/chat/completions`
88
- - `POST /v1/images/generations`
89
-
90
- ## 适合谁用
47
+ - Log in with OpenAI Codex OAuth.
48
+ - Import one or more account JSON files.
49
+ - Switch the active account.
50
+ - Export one account or selected accounts.
51
+ - Apply a saved account to local Codex.
52
+ - Configure the default text model and upstream proxy.
53
+ - Test `models`, `responses`, `chat.completions`, `images.generations`, and `images.edits`.
91
54
 
92
- - 想把账号授权能力包装成本地工具的人
93
- - 想把 `gpt-image-2` 生图接口直接接给脚本、前端或自动化流程的人
94
- - 想做自己的 AI 网关、AI CLI、AI 桌面端的人
95
- - 想学习一条完整 OAuth -> token -> CLI -> HTTP API 链路的人
96
- - 想把 AI 能力接入脚本、前端或自动化流程的人
55
+ ![AI Zero Token admin dashboard](docs/images/admin-dashboard.jpg)
97
56
 
57
+ ## API Usage
98
58
 
99
- ## 环境要求
100
-
101
- - Node.js 22+ 推荐
102
- - Bun 可用于开发和直接运行源码
103
- - 终端网络需要可访问:
104
- - `https://auth.openai.com`
105
- - `https://chatgpt.com`
106
-
107
- ## 安装与运行
108
-
109
- ### 从源码运行
110
-
111
- 克隆仓库并安装依赖:
59
+ ### Models
112
60
 
113
61
  ```bash
114
- git clone https://github.com/fchangjun/AI-Zero-Token.git
115
- cd AI-Zero-Token
116
- npm install
62
+ curl http://127.0.0.1:8787/v1/models
117
63
  ```
118
64
 
119
- 直接运行源码:
65
+ ### Responses
120
66
 
121
67
  ```bash
122
- bun src/cli.ts start
68
+ curl http://127.0.0.1:8787/v1/responses \
69
+ -H "content-type: application/json" \
70
+ -d '{"model":"gpt-5.4","input":"Reply with OK only."}'
123
71
  ```
124
72
 
125
- ### npm 安装 CLI
126
-
127
- 如果你只是想把它当作本地 CLI 和本地网关使用,可以直接全局安装:
73
+ ### Chat Completions
128
74
 
129
75
  ```bash
130
- npm install -g ai-zero-token
76
+ curl http://127.0.0.1:8787/v1/chat/completions \
77
+ -H "content-type: application/json" \
78
+ -d '{
79
+ "model": "gpt-5.4",
80
+ "messages": [
81
+ {
82
+ "role": "user",
83
+ "content": "Reply with OK only."
84
+ }
85
+ ]
86
+ }'
131
87
  ```
132
88
 
133
- 安装后验证:
89
+ ### Image Generation
134
90
 
135
91
  ```bash
136
- azt start
137
- azt models --refresh
92
+ curl http://127.0.0.1:8787/v1/images/generations \
93
+ -H "content-type: application/json" \
94
+ -d '{
95
+ "model": "gpt-image-2",
96
+ "prompt": "A clean product photo of a red apple on a white background.",
97
+ "size": "1024x1024",
98
+ "quality": "low",
99
+ "response_format": "b64_json"
100
+ }'
138
101
  ```
139
102
 
140
- 如果你是为了开发、构建、`npm link`、`npm pack` 或准备发布,单独看:
103
+ The gateway returns an OpenAI-style response with `data[].b64_json`.
141
104
 
142
- - `BUILD_CLI.md`
105
+ ![AI Zero Token gpt-image-2 output preview](docs/images/gpt-image-2-preview.png)
143
106
 
144
- ## 快速开始
107
+ ### Image Editing
145
108
 
146
- 启动本地网关和管理页面:
109
+ `/v1/images/edits` currently supports JSON requests with URL, data URL, or raw base64 image references:
147
110
 
148
111
  ```bash
149
- azt start
150
- ```
151
-
152
- 执行后会自动打开管理页,默认地址:
153
-
154
- ```text
155
- http://127.0.0.1:8787
156
- ```
157
-
158
- 默认会监听:
159
-
160
- ```text
161
- 0.0.0.0:8787
112
+ curl http://127.0.0.1:8787/v1/images/edits \
113
+ -H "content-type: application/json" \
114
+ -d '{
115
+ "model": "gpt-image-2",
116
+ "prompt": "Use this reference image and create a cleaner product advertisement version.",
117
+ "images": [
118
+ {
119
+ "image_url": "data:image/png;base64,REPLACE_WITH_IMAGE_BASE64"
120
+ }
121
+ ],
122
+ "size": "1024x1024",
123
+ "quality": "low",
124
+ "response_format": "b64_json"
125
+ }'
162
126
  ```
163
127
 
164
- 这表示本机可以用 `127.0.0.1:8787` 访问,局域网内其他设备也可以用你的机器 IP 访问,比如 `http://172.26.66.132:8787`。
165
-
166
- 接下来在管理页里完成这几件事:
128
+ More examples are available in [docs/API_USAGE.md](docs/API_USAGE.md).
167
129
 
168
- - 登录一个或多个 OpenAI Codex 账号
169
- - 查看当前账号状态和过期时间
170
- - 在已保存账号之间切换当前使用账号
171
- - 切换默认模型
172
- - 直接测试 `models`、`responses`、`chat.completions`
173
- - 直接测试 `images.generations` 生图接口
130
+ ## Account Management
174
131
 
175
- 如果你要把它接到自己的客户端,只需要把 Base URL 指向:
132
+ AI Zero Token stores account state locally under:
176
133
 
177
134
  ```text
178
- http://127.0.0.1:8787/v1
179
- ```
180
-
181
- Vibe Coding、OpenAI-compatible SDK 和脚本接入可以参考:
182
-
183
- - [API 使用说明](docs/API_USAGE.md)
184
-
185
- 如果你要让本地网页直接从浏览器请求这个网关,现在已经默认开启 CORS。
186
-
187
- 如需限制来源,可以在启动前指定:
188
-
189
- ```bash
190
- AZT_CORS_ORIGIN=http://127.0.0.1:8124 azt start
191
- ```
192
-
193
- 多个来源可用英文逗号分隔:
194
-
195
- ```bash
196
- AZT_CORS_ORIGIN=http://127.0.0.1:8124,http://localhost:3000 azt start
197
- ```
198
-
199
- 如果你当前还没有全局命令,也可以把上面的 `azt` 临时替换成:
200
-
201
- ```bash
202
- bun src/cli.ts
203
- ```
204
-
205
- 例如:`bun src/cli.ts start`
206
-
207
- ## 网关使用说明
208
-
209
- 如果你主要把 AI Zero Token 当作本地网关来使用,推荐只记住一个命令:
210
-
211
- ### 1. 启动
212
-
213
- ```bash
214
- azt start
135
+ ~/.ai-zero-token/.state
215
136
  ```
216
137
 
217
- 启动后会自动打开管理页。管理页就是默认工作入口,你可以在里面直接:
218
-
219
- - 触发 OpenAI Codex OAuth 登录并新增账号
220
- - 查看当前账号、已保存账号列表、过期时间、token 摘要
221
- - 查看账号套餐 plan 和当前账号是否支持生图
222
- - 在多个已保存账号之间切换当前使用账号
223
- - 在“新增账号”里选择 OAuth 登录,或粘贴外部账号 JSON 批量导入
224
- - 导出单个账号,或勾选多个账号后批量导出所选账号 JSON
225
- - 删除单个本地账号,或一键清空全部本地账号
226
- - 切换默认模型
227
- - 测试 `models` / `responses` / `chat.completions`
228
- - 测试 `images.generations`
138
+ The web console supports:
229
139
 
230
- 管理页里邮箱默认脱敏显示,需要手动点击“查看邮箱”才会显示明文。
140
+ - OAuth login.
141
+ - JSON import from a single profile, an array, or a `profiles` bundle.
142
+ - Single-account export.
143
+ - Selected batch export using checkboxes.
144
+ - Account deletion and active-account switching.
231
145
 
232
- 导出的账号 JSON 包含完整 `access_token` `refresh_token`,等同于账号登录凭据,只适合在可信环境中传递。
146
+ Exported account JSON includes authentication tokens and should be treated as a secret.
233
147
 
234
- 如果当前网络访问海外上游不稳定,可以在管理页的“接口测试 / 系统设置”区域启用“上游代理”,并填写你自己的代理地址。保存后,OAuth 换取 token、模型刷新和接口转发都会通过该代理访问上游;本地管理页和 `127.0.0.1` 默认保持直连。
148
+ ### Apply to Codex
235
149
 
236
- 默认监听地址:
150
+ The `Apply to Codex` action writes the selected account to:
237
151
 
238
152
  ```text
239
- http://0.0.0.0:8787
153
+ ~/.codex/auth.json
240
154
  ```
241
155
 
242
- 本机浏览器访问:
156
+ Before writing, the existing file is backed up as `auth.json.azt-backup-*`. New Codex sessions will use the applied account.
243
157
 
244
- ```text
245
- http://127.0.0.1:8787
246
- ```
158
+ ## Configuration
247
159
 
248
- 默认 CORS 来源:
160
+ Default listener:
249
161
 
250
162
  ```text
251
- *
163
+ 0.0.0.0:8787
252
164
  ```
253
165
 
254
- ### 2. 把它接到你的客户端
255
-
256
- 客户端或 SDK 里把 Base URL 改成:
166
+ Local gateway base URL:
257
167
 
258
168
  ```text
259
169
  http://127.0.0.1:8787/v1
260
170
  ```
261
171
 
262
- 如果客户端必须填写 API Key,可以填任意非空占位值;真正起作用的是本地网关地址。
263
-
264
- ### 3. 查看模型列表
265
-
266
- OpenAI 风格模型接口:
172
+ Restrict browser CORS origins:
267
173
 
268
174
  ```bash
269
- curl http://127.0.0.1:8787/v1/models
175
+ AZT_CORS_ORIGIN=http://127.0.0.1:8124 azt start
270
176
  ```
271
177
 
272
- ### 4. 调用对话接口
273
-
274
- 最小请求示例:
178
+ Multiple origins can be separated by commas:
275
179
 
276
180
  ```bash
277
- curl http://127.0.0.1:8787/v1/responses \
278
- -H "content-type: application/json" \
279
- -d '{"model":"gpt-5.4","input":"请只回复 OK"}'
181
+ AZT_CORS_ORIGIN=http://127.0.0.1:8124,http://localhost:3000 azt start
280
182
  ```
281
183
 
282
- `instructions` 的请求示例:
184
+ The persistent state directory can be overridden with:
283
185
 
284
186
  ```bash
285
- curl http://127.0.0.1:8787/v1/responses \
286
- -H "content-type: application/json" \
287
- -d '{"model":"gpt-5.4","instructions":"你是一个简洁助手","input":"请只回复 OK"}'
187
+ AI_ZERO_TOKEN_HOME=/path/to/home azt start
288
188
  ```
289
189
 
290
- 兼容 `chat.completions` 的最小请求示例:
190
+ The default request body limit is `32 MiB`, which is intended to make JSON base64 image references practical for local image editing. You can override it with:
291
191
 
292
192
  ```bash
293
- curl http://127.0.0.1:8787/v1/chat/completions \
294
- -H "content-type: application/json" \
295
- -d '{
296
- "model": "gpt-5.4",
297
- "messages": [
298
- {
299
- "role": "user",
300
- "content": "请只回复 OK"
301
- }
302
- ]
303
- }'
193
+ AZT_BODY_LIMIT_MB=64 azt start
304
194
  ```
305
195
 
306
- ### 5. 调用生图接口
196
+ ## Image Limits
307
197
 
308
- OpenAI 风格 `images.generations` 示例:
198
+ ChatGPT Images availability and limits are controlled by the upstream account. Free accounts can attempt image generation, but rate limits and feature availability are stricter than paid plans and are not published as fixed public numbers. The gateway forwards image requests and surfaces the upstream response, for example `usage_limit_reached` with reset information.
309
199
 
310
- ```bash
311
- curl http://127.0.0.1:8787/v1/images/generations \
312
- -H "content-type: application/json" \
313
- -d '{
314
- "model": "gpt-image-2",
315
- "prompt": "生成一张白底红苹果商品图,构图简洁,光线干净。",
316
- "size": "1024x1024",
317
- "quality": "low",
318
- "response_format": "b64_json"
319
- }'
320
- ```
200
+ Image requests use `gpt-5.4-mini` as the internal orchestration model and pass the requested image model, such as `gpt-image-2`, to the `image_generation` tool.
321
201
 
322
- 响应会返回 OpenAI 同类型结构的 `data[].b64_json`。如果你在管理页里测试,这张图片会直接显示预览。
323
- 如果请求里不显式传 `model`,当前默认会使用 `gpt-image-2`。
324
-
325
- 生图能力和账号套餐有关:
326
-
327
- - `plus` 或更高套餐账号可正常调用 `images.generations`
328
- - `free` 账号不支持生图,网关会直接返回明确错误,而不是继续请求上游
329
- - 管理页会显示当前账号的 `plan` 和“生图能力”状态
330
- - 当当前账号是 `free` 且你选中 `Images` 测试时,“发送请求”按钮会被直接禁用
331
-
332
- ### 6. 当前支持的接口
333
-
334
- - `GET /_gateway/health`
335
- - `GET /_gateway/status`
336
- - `GET /_gateway/models`
337
- - `POST /_gateway/models/refresh`
338
- - `GET /_gateway/admin/config`
339
- - `POST /_gateway/admin/login`
340
- - `POST /_gateway/admin/logout`
341
- - `POST /_gateway/admin/profiles/activate`
342
- - `POST /_gateway/admin/profiles/remove`
343
- - `PUT /_gateway/admin/settings`
344
- - `GET /v1/models`
345
- - `POST /v1/responses`
346
- - `POST /v1/chat/completions`
347
- - `POST /v1/images/generations`
348
-
349
- ### 7. 当前支持的主要参数
350
-
351
- `POST /v1/responses` 当前主要支持:
352
-
353
- - `model`
354
- - `input`
355
- - `instructions`
356
- - `stream`
357
- - `tools`
358
- - `tool_choice`
359
- - `include`
360
- - `text`
361
- - `store`
362
- - `parallel_tool_calls`
363
- - `experimental_codex.body`
364
- - `experimental_codex.allow_unknown_model`
365
- - `experimental_codex.include_raw`
366
-
367
- `POST /v1/chat/completions` 当前主要支持:
368
-
369
- - `model`
370
- - `messages`
371
- - `tools`
372
- - `tool_choice`
373
- - `response_format`
374
- - `temperature`
375
- - `top_p`
376
- - `presence_penalty`
377
- - `frequency_penalty`
378
- - `metadata`
379
- - `stop`
380
- - `store`
381
- - `parallel_tool_calls`
382
-
383
- `POST /v1/images/generations` 当前主要支持:
384
-
385
- - `prompt`
386
- - `model`
387
- - `n`
388
- - `size`
389
- - `quality`
390
- - `background`
391
- - `output_format`
392
- - `output_compression`
393
- - `moderation`
394
- - `response_format`
395
- - `user`
396
-
397
- ### 8. 当前限制
398
-
399
- - `stream=true` 目前只识别,不返回真实流式结果
400
- - 还没有完整覆盖 OpenAI Responses API 的全部字段
401
- - `chat.completions` 暂不支持 `n > 1`
402
- - `images.generations` 暂不支持 `n > 1`
403
- - `images.generations` 当前只返回 `b64_json`,暂不支持托管图片 `url`
404
- - `images.generations` 当前只透传 GPT Image 路径,不兼容 DALL·E 专有参数
405
- - `images.generations` 对账号套餐有要求;`free` 账号会被网关直接拦截并返回“不支持图片生成”
406
- - 网关当前默认面向本地单用户使用
407
-
408
- ## 兼容说明
409
-
410
- 代码里仍然保留了 `login`、`status`、`models`、`profiles`、`ask`、`serve`、`clear` 等 CLI 命令,主要用于调试、兼容和后续扩展。
411
-
412
- 账号 JSON 也可以通过 CLI 导入/导出:
202
+ For JSON image editing, base64 payloads are about 33% larger than the original image. With the default `32 MiB` body limit, a raw image around `24 MiB` is the practical upper bound before JSON overhead. For larger images or batch workflows, prefer a reachable image URL.
413
203
 
414
- ```bash
415
- azt profiles import ./profile.json
416
- azt profiles export active ./profile.json
417
- azt profiles export all ./profiles.json
418
- azt profiles export "openai-codex:<accountId>" ./profile.json
419
- ```
204
+ ## Limitations
420
205
 
421
- README 不再把这些命令作为推荐使用方式。默认使用路径就是:
206
+ - This project is intended for local single-user use.
207
+ - Streaming request fields are recognized, but full streaming parity is not implemented for every endpoint.
208
+ - `/v1/images/generations` currently returns `b64_json`; hosted image URLs are not supported.
209
+ - `/v1/images/generations` does not support `n > 1`.
210
+ - `/v1/images/edits` currently supports JSON only. `multipart/form-data`, `mask`, and `file_id` are not yet supported.
211
+ - Very large base64 JSON requests are constrained by `AZT_BODY_LIMIT_MB` and local memory.
212
+ - OpenAI Responses API compatibility is partial and focused on common local client workflows.
422
213
 
423
- ```bash
424
- azt start
425
- ```
214
+ ## Security
426
215
 
427
- ## 交流与反馈
216
+ - Access tokens, refresh tokens, and ID tokens are equivalent to login credentials.
217
+ - Do not expose the gateway to untrusted networks.
218
+ - Do not share exported account JSON outside trusted environments.
219
+ - Review files under `~/.ai-zero-token/.state` and `~/.codex/auth.json` before copying or publishing local data.
428
220
 
429
- 如果你在使用过程中遇到安装问题、账号切换问题、生图异常,或者想交流自己的接入场景,可以通过下面两种方式联系我:
221
+ ## Development
430
222
 
431
- - GitHub Issues: [https://github.com/fchangjun/AI-Zero-Token/issues](https://github.com/fchangjun/AI-Zero-Token/issues)
432
- - 微信交流:先加我微信,备注 `AI Zero Token`,我会再拉你进交流群
223
+ Install dependencies:
433
224
 
434
- 如果你已经把二维码放到仓库里,可以直接查看:
225
+ ```bash
226
+ npm install
227
+ ```
435
228
 
436
- ![AI Zero Token 微信联系二维码](docs/images/wechat-contact.png)
229
+ Run from source:
437
230
 
438
- ## 本地状态
231
+ ```bash
232
+ bun src/cli.ts start
233
+ ```
439
234
 
440
- 项目会在仓库目录下写入:
235
+ Validate:
441
236
 
442
- - `.state/store.json`
443
- - `.state/settings.json`
237
+ ```bash
238
+ npm run typecheck
239
+ npm run build
240
+ ```
444
241
 
445
- 它们分别用于保存:
242
+ CLI packaging and release notes are documented in [BUILD_CLI.md](BUILD_CLI.md). User-facing changes are tracked in [CHANGELOG.md](CHANGELOG.md).
446
243
 
447
- - OAuth 认证信息和多个本地账号 profile
448
- - 默认模型和服务配置
244
+ ## Project Status
449
245
 
450
- ## 项目结构
246
+ AI Zero Token is evolving quickly. The current focus is a reliable local gateway, account transfer workflows, and image generation/editing compatibility for OpenAI-style clients.
451
247
 
452
- - `src/cli/`
453
- CLI 命令解析和命令分发
454
- - `src/core/`
455
- 核心业务逻辑
456
- - `src/core/services/`
457
- 认证、模型、聊天、配置服务
458
- - `src/core/store/`
459
- 本地状态读写
460
- - `src/core/providers/openai-codex/`
461
- OpenAI Codex provider 实现
462
- - `src/server/`
463
- 本地 HTTP 网关
248
+ Issues and feature requests: [GitHub Issues](https://github.com/fchangjun/AI-Zero-Token/issues)