Preface¶
When routing through OpenAI Codex in DeepSeek Harness (DSH), the common practice is to configure an OpenAI API Key or environment variable. If you actually hold a ChatGPT account-side Codex OAuth authorization instead of an API Key, you need to complete browser or device code login in the Web model settings, hand the grant over to the DSH credential service for management, and see usage in the interface instead of exposing the access token to the frontend.
Below we introduce the community plugin dsh-chatgpt-oauth (maintainer zhangnan, categorized under admin-security). It is not an official OpenAI or DeepSeek plugin; available models and quotas are determined by your account and the server side.
What Is This¶
dsh-chatgpt-oauth targets environments that have DSH installed and use a web profile with a “Model Settings” page. The plugin provides a login entry point in the “Settings → Models → ChatGPT (openai-codex)” detail card, and parses the ChatGPT usage endpoint on the server side to display the 5-hour, weekly and additional limits, reset times, and Credits on the card. The page only receives login status and parsed usage, not access/refresh tokens.
Source code and documentation: GitHub repo zhangnan/dsh-chatgpt-oauth; community catalog page: skillhub plugin page. The current npm package version is 0.1.2, license MIT.
Core Features¶
- OAuth Login: Perform browser or device code login within the ChatGPT (
openai-codex) card, with no extra settings tab. Browser OAuth uses PKCE, with the callback address being the locallocalhost:1455/auth/callback; the successful callback page uses DSH messaging. When the callback is unavailable, you can paste the authorization code or full callback URL in the card. - Credential Hosting: The OAuth grant is stored in the DSH credential record
llm-pi-ai/openai-codex, and refreshed serially on the server side when expired. - Usage Display: Following pi-web’s parsing approach, it displays quotas and reset information from the ChatGPT usage endpoint; usage is requested by the plugin server at
https://chatgpt.com/backend-api/wham/usage, and the access token is never returned to the browser. - Profile Bundle: On installation, the
authorizationservice and this plugin are added automatically, without manual modification ofcordis.patch.yml.
Installation and Activation¶
Environment requirements: Node.js 22.19+, DSH installed, and using the web profile. The README notes it has been verified on DSH 0.1.6-alpha.2.
Install from npm:
dsh plugin --profile web add -w dsh-chatgpt-oauth
Install from GitHub Release (example for v0.1.2):
dsh plugin --profile web add -w 'github:zhangnan/dsh-chatgpt-oauth#v0.1.2'
After installation, restart dsh web and open “Settings → Models → ChatGPT”. If the profile already contains manually added authorization or dsh-chatgpt-oauth entries, remove the old entries before installing to avoid duplicate mounting; saved account credentials do not need to be deleted.
Typical Usage¶
- Open “Settings → Models” in DSH Web and locate the ChatGPT (
openai-codex) card. - Click “Browser Login” and complete authorization on the OpenAI page; the local callback port must be available. For environments without a browser, choose “Device Code Login”.
- After login completes, the card reads usage; click “Refresh” to manually re-query. Logging out of the account only deletes the DSH credential record used by this plugin.
If the account authorization succeeds but the model is unavailable, first check whether the openai-codex route has apiKeyEnv configured: this field overrides the account OAuth credentials and needs to be removed. If port 1455 is occupied by another application, close the other login flow and retry.
To explicitly list gpt-6-sol and gpt-6-luna from the new pi-ai built-in catalog in DSH model settings, only write id in models; do not repeat the declarations of supportsOpenAIGrammarTools, supportsAdditionalTools, or supportsToolSearch in the route’s or model’s compat. If models already exists, keep the existing entries and append the two IDs, because this list replaces the entire available catalog.
Applicable Scenarios and Notes¶
Who It’s For: Users running DSH Web locally or in a controlled environment who want to drive the openai-codex route with a ChatGPT account OAuth and view Codex usage in model settings, rather than storing API Keys long-term in the frontend or config files.
Security and Limitations: The plugin runs with the permissions of the current DSH process; read the source code and the MIT license before installing, and only use it on trusted local DSH services. Do not commit DSH credential files or authorization callback URLs to public repositories. The usage endpoint or fields may change; query failures do not affect saved login credentials. The plugin will not purchase subscriptions for you, nor can it bypass account permissions or quotas.
Conclusion¶
dsh-chatgpt-oauth consolidates ChatGPT OAuth login, DSH credential refresh, and Codex usage display into a single card in the Web model settings, making it suitable for developers already using the DSH web profile. For more information, see the community catalog page and the GitHub repository.