
yoke233/dsh-openai-codex-auth
30Last commit Aug 14, 2026
dsh-openai-codex-auth DSH plugin
This plugin enables OpenAI OAuth login (ChatGPT Plus/Pro/Team/Enterprise) directly from DSH Web settings. It provides a usage panel showing short-cycle and weekly usage, remaining quota, and reset time. Credentials are automatically refreshed and injected into the openai-codex model provider via DSH credentials.
How to install the dsh-openai-codex-auth DSH plugin
dsh plugin --profile web add github:yoke233/dsh-openai-codex-authCopying does not run this command. Review the repository and version before installing the dsh-openai-codex-auth DSH plugin.
dsh-openai-codex-auth DSH plugin data source
dsh-openai-codex-auth DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-openai-codex-auth DSH plugin can do
- OpenAI subscription login via OAuth with PKCE and state validation
- Codex usage panel showing short-cycle and weekly usage, remaining quota, and reset time
- Automatic token refresh near expiry and local credential update
- Inject valid token into DSH's openai-codex model provider via DSH_OPENAI_CODEX_TOKEN environment variable
- Settings page management: view status, refresh usage, re-login, and logout with CSRF protection
Where the dsh-openai-codex-auth DSH plugin fits
- Connect a ChatGPT Plus/Pro/Team/Enterprise subscription to DSH for Codex access
- Monitor Codex usage quota and reset timings from DSH Web interface
- Automatically renew credentials and keep the openai-codex model provider functional
- Securely handle OAuth tokens without exposing them to the web frontend
Who the dsh-openai-codex-auth DSH plugin is for
- DSH users who have a paid OpenAI Codex subscription and want to use it via the openai-codex model provider
- Developers who need to manage OpenAI Codex credentials and usage within DSH's Web profile
dsh-openai-codex-auth DSH plugin limitations
- Only works with the DSH web profile; the admin OAuth listener only listens on 127.0.0.1, so login must be done on the same machine running the web profile
- Requires an active OpenAI ChatGPT Plus, Pro, Team, or Enterprise subscription – not compatible with free-tier accounts
- The plugin does not bypass any OpenAI account risk controls; it only handles local credential storage and OAuth flow
dsh-openai-codex-auth DSH plugin: from the repository README
Quoted from the yoke233/dsh-openai-codex-auth README, the upstream source of the dsh-openai-codex-auth DSH plugin. Copyright remains with the original authors.
在 DSH 设置页完成 OpenAI OAuth 登录、查看 Codex 用量,并自动向 <code>openai-codex</code> 模型提供方提供有效凭据。 </p> <p align="center"> <a href="#快速开始">快速开始</a> · <a href="#功能一览">功能一览</a> · <a href="#工作方式">工作方式</a> · <a href="#配置">配置</a> · <a href="#凭据处理边界">凭据处理边界</a> </p> ## 快速开始 将插件安装到 DSH 的 `web` profile: ```sh dsh plugin --profile web add github:yoke233/dsh-openai-codex-auth ``` 启动或重启该 profile: ```sh dsh --profile web ``` 然后完成首次连接: 1. 打开 DSH Web,进入 **设置 → OpenAI Codex**。 2. 点击 **登录 OpenAI**,在弹出的 OpenAI 官方授权页完成登录。 3. 返回 DSH,在 **设置 → 模型提供方** 中选择 `openai-codex`。 > [!IMPORTANT] > 登录管理接口只监听 `127.0.0.1`。请在运行 DSH Web profile 的同一台电脑上打开设置页并完成授权。 ## 功能一览 | 能力 | 说明 | | --- | --- | | OpenAI 订阅登录 | 通过 OAuth 连接 ChatGPT Plus、Pro、Team 或 Enterprise 账号 | | Codex 用量面板 | 展示短周期与周用量、剩余额度和重置时间 | | 自动凭据续期 | 在令牌接近过期时刷新,并更新本地凭据 | | DSH 模型接入 | 将有效令牌提供给 `openai-codex` 模型提供方 | | 设置页管理 | 支持查看状态、刷新用量、重新登录和退出登录 | ## 工作方式 <p align="center"> <img src="./assets/readme/workflow.svg" width="100%" alt="OpenAI OAuth 授权经本机回调写入受保护凭据,再供 openai-codex 提供方和 DSH 用量面板使用"> </p> 1. 插件生成 PKCE verifier、challenge 和随机 `state`,再打开 OpenAI 授权页。 2. OpenAI 将授权结果返回到本机 `localhost:1455`;插件校验 `state` 并交换令牌。 3. 凭据原子写入本地文件,访问令牌通过 DSH credenti
Read the full READMERepository license: MIT
dsh-openai-codex-auth DSH plugin questions
How do I install the OpenAI Codex Auth plugin?
Run the command `dsh plugin --profile web add github:yoke233/dsh-openai-codex-auth` in your terminal, then restart the web profile with `dsh --profile web`. After that, open the DSH Web settings and navigate to the OpenAI Codex section to complete the login.
Why do I see 'Unable to connect to local Codex plugin service'?
Make sure the web profile is running and you are opening the DSH Web interface on the same machine where the profile is started. If you have just installed or updated the plugin, restart the profile. The admin service only listens on 127.0.0.1, so remote connections are not allowed.
Can I use this plugin with a free OpenAI account?
No, this plugin only works with ChatGPT Plus, Pro, Team, or Enterprise subscriptions. Free accounts do not have access to Codex, and the OAuth flow will likely fail or provide insufficient permissions. You need a paid subscription to use the openai-codex model provider.
How do I set up an HTTP proxy for the plugin?
Set the environment variables `HTTP_PROXY`, `HTTPS_PROXY`, and optionally `NO_PROXY` before starting DSH. Also set `NODE_USE_ENV_PROXY=1` to enable Node.js environment proxy support. For example: `NODE_USE_ENV_PROXY=1 HTTP_PROXY=http://127.0.0.1:7890 HTTPS_PROXY=http://127.0.0.1:7890 dsh --profile web`.
The login button doesn't open an authorization page. What should I do?
Your browser may be blocking pop-ups. Allow pop-ups from the DSH Web origin, then click the 'Login OpenAI' button again. If the issue persists, check that the web profile is running and you are on the same machine as the DSH server.