{"_id":"@ailuntz/codex-api","_rev":"11-c95d98bfe5057e642661f69bf058e6a2","name":"@ailuntz/codex-api","dist-tags":{"latest":"0.0.10"},"versions":{"0.0.2":{"name":"@ailuntz/codex-api","version":"0.0.2","license":"Apache-2.0","_id":"@ailuntz/codex-api@0.0.2","maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"bin":{"codex-api":"bin/codex-api.mjs"},"dist":{"shasum":"feae49383ad1012a7c34f315fa1e46b47722814a","tarball":"https://registry.npmjs.org/@ailuntz/codex-api/-/codex-api-0.0.2.tgz","fileCount":7,"integrity":"sha512-iu60aXvrK/Kzv2/VFmpwD0gcPfsFPprO3CGTuwwieXCSbBgKG+Wp2i/8qaMs5/kNFBthAzdy2FlDvMfAXnQ0yw==","signatures":[{"sig":"MEQCIHjDXQhuTNtSoU9o3PTFi9Q8/MZXaZkZuuawoI1uE/LEAiB0CTpWo1/pXptZyAA4sxCLALOADDtCeLS5mHoC1oAeaw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29438},"type":"module","engines":{"node":">=20.0.0"},"scripts":{"check":"node --check bin/codex-api.mjs && node --check src/server.mjs && node --check src/codex-client.mjs && node --check src/paths.mjs","probe":"node bin/codex-api.mjs probe","start":"node bin/codex-api.mjs serve"},"_npmUser":{"name":"ailuntz","email":"ailuntz@icloud.com"},"_npmVersion":"11.19.0","description":"A local OpenAI Responses-compatible adapter backed by the official Codex SDK","directories":{},"_nodeVersion":"26.7.0","dependencies":{"@openai/codex-sdk":"0.153.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-api_0.0.2_1788713700832_0.6114773596941194","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@ailuntz/codex-api","version":"0.0.3","license":"Apache-2.0","_id":"@ailuntz/codex-api@0.0.3","maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"bin":{"codex-api":"bin/codex-api.mjs"},"dist":{"shasum":"193855bee68def5418fd5c19211d914679bfd4d0","tarball":"https://registry.npmjs.org/@ailuntz/codex-api/-/codex-api-0.0.3.tgz","fileCount":7,"integrity":"sha512-0E821CMaLmirL7lnzIgjrh7KUVgL2EQFVPI5ZFw8Roekj+i1+SxLJ4s9DjdYelTcv4Q1hq3leHCHA3GB4oR+Ag==","signatures":[{"sig":"MEUCIQCcpEtqknVyf8ARpcKLjW1ywIkci0o/YI9RFPzN5jsnYQIgYmSFFzozqNJEV2TTKG5sTjs0I3lxZBpH0FtWuvxeqqs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33257},"type":"module","engines":{"node":">=20.0.0"},"scripts":{"check":"node --check bin/codex-api.mjs && node --check src/server.mjs && node --check src/codex-exec.mjs && node --check src/paths.mjs","probe":"node bin/codex-api.mjs probe","start":"node bin/codex-api.mjs serve"},"_npmUser":{"name":"ailuntz","email":"ailuntz@icloud.com"},"_npmVersion":"11.19.0","description":"A local OpenAI Responses-compatible adapter backed by an existing Codex CLI","directories":{},"_nodeVersion":"26.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-api_0.0.3_1788714639926_0.6102945038292626","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@ailuntz/codex-api","version":"0.0.4","license":"Apache-2.0","_id":"@ailuntz/codex-api@0.0.4","maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"bin":{"codex-api":"bin/codex-api.mjs"},"dist":{"shasum":"0a48d1b9350c00f0f82076b862cadf604b31c63e","tarball":"https://registry.npmjs.org/@ailuntz/codex-api/-/codex-api-0.0.4.tgz","fileCount":7,"integrity":"sha512-JK7+AODxI5uMym/YgJA2iKAbqWX5zH5PxAVEkXtYNOmdUZ/czBNYMyuMO7mZAPyhjFFREqLCGY0zJ8+TuFL9ng==","signatures":[{"sig":"MEUCIQCGsqxsMfFe8GyE2NcmWCRTa38Tqu5dYRqecEpoUEgH7gIgILUMWzT1ZgsHWlRs0nXhjmQ4kvvRpAe6k70tVFsD5xI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":33385},"type":"module","engines":{"node":">=20.0.0"},"scripts":{"check":"node --check bin/codex-api.mjs && node --check src/server.mjs && node --check src/codex-exec.mjs && node --check src/paths.mjs","probe":"node bin/codex-api.mjs probe","start":"node bin/codex-api.mjs serve"},"_npmUser":{"name":"ailuntz","email":"ailuntz@icloud.com"},"_npmVersion":"11.19.0","description":"A local OpenAI Responses-compatible adapter backed by an existing Codex CLI","directories":{},"_nodeVersion":"26.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-api_0.0.4_1788714878647_0.5217432925164074","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@ailuntz/codex-api","version":"0.0.5","license":"Apache-2.0","_id":"@ailuntz/codex-api@0.0.5","maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"bin":{"codex-api":"bin/codex-api.mjs"},"dist":{"shasum":"560c0c3b7b2759102db5917324b5d194961ed197","tarball":"https://registry.npmjs.org/@ailuntz/codex-api/-/codex-api-0.0.5.tgz","fileCount":8,"integrity":"sha512-XGIAhYroyIWcjvkGd2aMzrUTcytPhCboxDl3HwHXmMUXWX6nUgsafd/wqtSpgG/lQZqV9qqL9P/4vUmHq3NLdw==","signatures":[{"sig":"MEUCIQD770ha0hEE156rqoRmM3LyXY8d/8qPZNtBEYdPHyUF8QIgQBS9GcuM4BC2KppiAidrOXbwMwpcOZz8ZeTWd5/+SNY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34401},"type":"module","engines":{"node":">=20.0.0"},"scripts":{"test":"node --test","check":"node --check bin/codex-api.mjs && node --check src/server.mjs && node --check src/codex-exec.mjs && node --check src/paths.mjs","probe":"node bin/codex-api.mjs probe","start":"node bin/codex-api.mjs serve"},"_npmUser":{"name":"ailuntz","email":"ailuntz@icloud.com"},"_npmVersion":"11.19.0","description":"A local OpenAI Responses-compatible adapter backed by an existing Codex CLI","directories":{},"_nodeVersion":"26.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-api_0.0.5_1788722478514_0.5017395801502804","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@ailuntz/codex-api","version":"0.0.6","license":"Apache-2.0","_id":"@ailuntz/codex-api@0.0.6","maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"bin":{"codex-api":"bin/codex-api.mjs"},"dist":{"shasum":"49bf6c31c381d490430633f7087ebba5895fc999","tarball":"https://registry.npmjs.org/@ailuntz/codex-api/-/codex-api-0.0.6.tgz","fileCount":9,"integrity":"sha512-Nxsz/i5vDRyZvttaw+yIsn0NYl62tNWbyxN1lOMx1hEsRvGw798q+JBBA0cpwDMMi385jDFNRPRao86llo5bDA==","signatures":[{"sig":"MEQCIFkhvwB/VFD8sGVTIEVLeCRuUkke7UT16cDH2vBUmhHnAiBtlalLFY9UCbDOlfpuGh+/YDNiY/Nc5etyzOAGmUn2VA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44844},"type":"module","engines":{"node":">=20.0.0"},"scripts":{"test":"node --test","check":"node --check bin/codex-api.mjs && node --check src/server.mjs && node --check src/codex-exec.mjs && node --check src/paths.mjs && node --check src/text-only-gateway.mjs","probe":"node bin/codex-api.mjs probe","start":"node bin/codex-api.mjs serve"},"_npmUser":{"name":"ailuntz","email":"ailuntz@icloud.com"},"_npmVersion":"11.19.0","description":"A local OpenAI Responses-compatible adapter backed by an existing Codex CLI","directories":{},"_nodeVersion":"26.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-api_0.0.6_1788723887489_0.778917457389509","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@ailuntz/codex-api","version":"0.0.7","license":"Apache-2.0","_id":"@ailuntz/codex-api@0.0.7","maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"bin":{"codex-api":"bin/codex-api.mjs"},"dist":{"shasum":"c750f44e1009e5ca5708a06e51ba552e42e4a47a","tarball":"https://registry.npmjs.org/@ailuntz/codex-api/-/codex-api-0.0.7.tgz","fileCount":9,"integrity":"sha512-WtDTkgn5OAJmh3TuUf2UejvisQFd2Iq7y219uRvytUivJX1dsvdN4AAL1c0dYy5NwC71th4AWBGJuRe3r0QNhQ==","signatures":[{"sig":"MEUCIHffAKDRDvdZM/eiEMeVVuQVbdhhMYFrJzLPg6S6Ihh5AiEAxevi6QujyFDETUasYRPwxr6I342b7Olr7wvQCJY4BVU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47099},"type":"module","engines":{"node":">=20.0.0"},"scripts":{"test":"node --test","check":"node --check bin/codex-api.mjs && node --check src/server.mjs && node --check src/codex-exec.mjs && node --check src/paths.mjs && node --check src/text-only-gateway.mjs","probe":"node bin/codex-api.mjs probe","start":"node bin/codex-api.mjs serve"},"_npmUser":{"name":"ailuntz","email":"ailuntz@icloud.com"},"_npmVersion":"11.19.0","description":"A local OpenAI Responses-compatible adapter backed by an existing Codex CLI","directories":{},"_nodeVersion":"26.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-api_0.0.7_1788724542999_0.2601331230440429","host":"s3://npm-registry-packages-npm-production"}},"0.0.8":{"name":"@ailuntz/codex-api","version":"0.0.8","license":"Apache-2.0","_id":"@ailuntz/codex-api@0.0.8","maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"bin":{"codex-api":"bin/codex-api.mjs"},"dist":{"shasum":"872b41cdf61af6785aa3035ab1aba12524b592c6","tarball":"https://registry.npmjs.org/@ailuntz/codex-api/-/codex-api-0.0.8.tgz","fileCount":9,"integrity":"sha512-LJlOJyhags7tHEsq+0XzHdUJh9iBq/T38Uamj+jcYsTQu2htdNQi6DM6mvBiEaqbFFUgeLif122qDW8gAziNrg==","signatures":[{"sig":"MEQCIFYdAfUgtMBSRHzvkthrhsMP/siQD8KbUn5wjVspqskxAiAKZ+sD9/DtVP0VzLBxH52fFR3H6kcHSia6Z6PvCUCGjg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47380},"type":"module","engines":{"node":">=20.0.0"},"scripts":{"test":"node --test","check":"node --check bin/codex-api.mjs && node --check src/server.mjs && node --check src/codex-exec.mjs && node --check src/paths.mjs && node --check src/text-only-gateway.mjs","probe":"node bin/codex-api.mjs probe","start":"node bin/codex-api.mjs serve"},"_npmUser":{"name":"ailuntz","email":"ailuntz@icloud.com"},"_npmVersion":"11.19.0","description":"A local OpenAI Responses-compatible adapter backed by an existing Codex CLI","directories":{},"_nodeVersion":"26.7.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-api_0.0.8_1788724883162_0.24215892081165413","host":"s3://npm-registry-packages-npm-production"}},"0.0.9":{"name":"@ailuntz/codex-api","version":"0.0.9","license":"Apache-2.0","_id":"@ailuntz/codex-api@0.0.9","maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"bin":{"codex-api":"bin/codex-api.mjs"},"dist":{"shasum":"d0a31a86d7b9b40e46f41a433220f32488142e63","tarball":"https://registry.npmjs.org/@ailuntz/codex-api/-/codex-api-0.0.9.tgz","fileCount":9,"integrity":"sha512-Ol+O7tYOa/OGe9Rql0lWlJzOqP3m2hJ4e62tF4E+fqwcxyxY8wLNEWl7zjAh8BJdRKsoYp2KMooVbYd4bQqDdw==","signatures":[{"sig":"MEYCIQCjgMUgIM/2xcYNm7MAIcWpzdZ1mKy3WfzuIEOAgazzqQIhAPh+9WBkI1wlBegUHI7T45Gv4x93UsK/vyBDAZ09XD+B","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":62537},"type":"module","engines":{"node":">=20.0.0"},"scripts":{"test":"node --test","check":"node --check bin/codex-api.mjs && node --check src/server.mjs && node --check src/codex-exec.mjs && node --check src/paths.mjs && node --check src/text-only-gateway.mjs","probe":"node bin/codex-api.mjs probe","start":"node bin/codex-api.mjs serve"},"_npmUser":{"name":"ailuntz","email":"ailuntz@icloud.com"},"_npmVersion":"11.19.0","description":"A local OpenAI Responses-compatible adapter backed by an existing Codex CLI","directories":{},"_nodeVersion":"26.7.0","dependencies":{"ws":"^8.18.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/codex-api_0.0.9_1788728910711_0.5575666059861728","host":"s3://npm-registry-packages-npm-production"}},"0.0.10":{"name":"@ailuntz/codex-api","version":"0.0.10","description":"A local OpenAI Responses-compatible adapter backed by an existing Codex CLI","type":"module","bin":{"codex-api":"bin/codex-api.mjs"},"scripts":{"start":"node bin/codex-api.mjs serve","probe":"node bin/codex-api.mjs probe","check":"node --check bin/codex-api.mjs && node --check src/server.mjs && node --check src/codex-exec.mjs && node --check src/paths.mjs && node --check src/text-only-gateway.mjs","test":"node --test"},"dependencies":{"ws":"^8.18.3"},"engines":{"node":">=20.0.0"},"license":"Apache-2.0","publishConfig":{"access":"public"},"_id":"@ailuntz/codex-api@0.0.10","_integrity":"sha512-ssHTaQSn3Zq2JpUDydI2hy7tTCdvusxVaO7hyqHqyrRSz6GVcU5/wv1mHIP9d3fvqKw8yr8PlzGUe1h4tcbCgw==","_resolved":"/private/tmp/ailuntz-codex-api-0.0.10.tgz","_from":"file:/private/tmp/ailuntz-codex-api-0.0.10.tgz","_nodeVersion":"26.7.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-ssHTaQSn3Zq2JpUDydI2hy7tTCdvusxVaO7hyqHqyrRSz6GVcU5/wv1mHIP9d3fvqKw8yr8PlzGUe1h4tcbCgw==","shasum":"d70f2e2852ee158fafa395e1b057e1044d59369c","tarball":"https://registry.npmjs.org/@ailuntz/codex-api/-/codex-api-0.0.10.tgz","fileCount":10,"unpackedSize":67899,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD6Nw0wSA5tQ3ErFyeDtFLA8vIFW3/UYmz36Hps0nrxVAIhANM1YCiNeUbyPzg6HcUx1px3F7woo25Zjzb/vEZtikql"}]},"_npmUser":{"name":"ailuntz","email":"ailuntz@icloud.com"},"directories":{},"maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/codex-api_0.0.10_1788876810944_0.957655002955812"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-06T16:41:56.233Z","modified":"2026-09-08T14:13:31.247Z","0.0.1":"2026-09-06T16:41:56.585Z","0.0.2":"2026-09-06T16:55:00.959Z","0.0.3":"2026-09-06T17:10:40.066Z","0.0.4":"2026-09-06T17:14:38.784Z","0.0.5":"2026-09-06T19:21:18.641Z","0.0.6":"2026-09-06T19:44:47.624Z","0.0.7":"2026-09-06T19:55:43.144Z","0.0.8":"2026-09-06T20:01:23.311Z","0.0.9":"2026-09-06T21:08:30.845Z","0.0.10":"2026-09-08T14:13:31.092Z"},"license":"Apache-2.0","description":"A local OpenAI Responses-compatible adapter backed by an existing Codex CLI","maintainers":[{"name":"ailuntz","email":"ailuntz@icloud.com"}],"readme":"# @ailuntz/codex-api\n\n把已登录的 Codex 临时包装成本机 `/v1/responses` HTTP 接口。\n\n```text\ncurl -> localhost adapter -> existing codex exec --json -> loopback text-only gateway -> provider\n```\n\n## 安装\n\n```bash\ncurl -fsSL https://chatgpt.com/codex/install.sh | sh\ncodex login\nnpm install -g @ailuntz/codex-api\ncodex-api install-service\n```\n\n本包不附带 Codex，也不会再安装一份 Codex。它直接使用电脑里已经安装、已经登录的 `codex` 命令；可先运行 `codex --version` 确认。\n\n## 开关\n\n```bash\ncodex-api status\ncodex-api stop\ncodex-api start\ncodex-api restart\ncodex-api uninstall-service\n```\n\n## curl\n\n本地适配器：\n\n```bash\ncurl http://127.0.0.1:8787/v1/responses \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"input\": \"只回复 API_OK\",\n    \"stream\": false\n  }'\n```\n\n连续对话可以把上一轮返回的 `id` 作为下一轮的 `previous_response_id`：\n\n```bash\ncurl http://127.0.0.1:8787/v1/responses \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"previous_response_id\": \"resp_...\",\n    \"input\": \"继续刚才的话题\"\n  }'\n```\n\n官方 OpenAI API：\n\n```bash\ncurl https://api.openai.com/v1/responses \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -H 'Content-Type: application/json' \\\n  -d '{\n    \"model\": \"gpt-5.2\",\n    \"input\": \"只回复 API_OK\"\n  }'\n```\n\n本地适配器默认只监听 `127.0.0.1:8787`，所以默认不需要 Bearer Key。若改为非本机监听地址，必须在配置中设置 `ADAPTER_API_KEY`。\n\n## 配置\n\n```bash\ncodex-api config-path\n```\n\n首次运行会生成适配器自己的服务配置和工作目录，但 Codex 进程直接共用主机的 `CODEX_HOME`。登录态和本地 session 都使用这个目录；适配器不会再创建独立的 Codex home。\n\n适配器会先从主机 `CODEX_HOME/config.toml` 读取模型和上游配置，再把必要配置作为单次调用参数传给 Codex。调用使用 `--ignore-user-config`，避免额外加载主机插件、MCP 和其他用户配置，但认证与 session 落盘仍然使用主 `CODEX_HOME`。\n\nCodex CLI 会在本地组装完整的代理上下文。适配器的回环网关会在请求离开本机前删除 Codex 内建 developer 上下文与工具合同，只把 API 调用者的 instructions 和 input 发给模型，并设置 `tool_choice=none`。网关使用适配器现有端口上的随机隐藏路径，只接受本机回调，不会另开监听端口，也不记录认证信息或请求正文。HTTP 与 Responses WebSocket v2 都经过同一套裁剪逻辑。\n\n适配器会按模型和稳定 developer instructions 生成固定的 `prompt_cache_key`，帮助重复长前缀命中上游缓存。短请求显示 `cached_tokens=0` 是正常现象：缓存有最小可缓存长度，并且首次请求还没有可复用的前缀。\n\n每次请求仍创建一个全新的本地 Codex thread，thread 会正常保存到主机 `CODEX_HOME/sessions`，便于审计和排查。若传入 `previous_response_id`，模型端通过适配器保持的 Responses WebSocket v2 连接续接上下文；不传则创建独立模型响应。\n\n未设置 `CODEX_HOME` 时使用 `~/.codex`。默认配置不会固定保存 home 或 CLI 路径；CLI 自动查找也覆盖 `~/.local/bin/codex`，适用于 launchd 的精简 PATH。已有的显式配置仍保留，迁移到默认安装后可删除旧的 `CODEX_HOME`、`CODEX_BIN` 设置。\n\n未配置模型时由 Codex CLI 选择默认模型，也可通过请求的 `model` 或 `CODEX_MODEL` 指定；此时 `/healthz` 的模型为 `null`，`/v1/models` 返回空列表。\n\n常用可选项：\n\n```dotenv\nADAPTER_HOST=127.0.0.1\nADAPTER_PORT=8787\n# CODEX_HOME=/path/to/codex-home\n# CODEX_BIN=/path/to/codex\n# ADAPTER_API_KEY=replace-with-a-long-random-secret\n# CODEX_BASE_URL=https://your-provider.example\n# CODEX_MODEL=your-model\n```\n\n## 限制\n\n- 仅支持文本、非流式 `stream=false`。\n- 支持同一适配器进程内的 `previous_response_id`；上游要求 WebSocket `store=false`，适配器或上游连接重启后，旧 response ID 可能失效。\n- 不支持 Responses `conversation`、图片、音频和原生工具调用。\n- 每个请求创建独立 Codex thread，并以单并发队列执行。\n- 请求不使用 `--ephemeral`，thread rollout 会保存在主机 `CODEX_HOME`。\n- 请求使用 `--ignore-user-config`，并由本机回环网关在发送前裁掉 Codex 内建代理上下文和工具合同；服务端只收到精简后的对话请求。\n- 这是临时适配器，不是完整的 OpenAI API 实现。\n\n\n## 卸载\n\n先停止后台进程并移除 launchd 服务，再卸载 npm 包：\n\n```bash\ncodex-api uninstall-service\nnpm uninstall -g @ailuntz/codex-api\n```\n\n`uninstall-service` 也会停止由 `codex-api start` 启动的独立后台进程；卸载失败会报错，重复执行不会创建新的配置目录。仅执行 npm 卸载不会移除 launchd 服务。\n\n上述操作保留适配器的配置、日志和工作目录。macOS 默认位于 `~/Library/Application Support/codex-api`；确认不需要后可以删除此目录完成清理（使用 `CODEX_API_HOME` 时清理对应目录）。主机的 `~/.codex`、登录态及 Codex CLI 不属于本包，不应删除。\n","readmeFilename":"README.md"}