Foreword¶
Integrating OpenAI Codex in DeepSeek Harness (DSH) often involves separately configuring API keys and handling search and image tools individually. If you’ve already completed ChatGPT login using the official Codex CLI on your local machine, with the login state stored in ~/.codex/auth.json (or $CODEX_HOME/auth.json), managing another set of credentials becomes redundant.
Below, we introduce the community plugin dsh-codex-auth (maintained by suntianc). It connects the Codex CLI login state to DSH’s openai-codex route and adds web search, image generation, and a native GPT Auth settings section. The plugin is categorized as a “client-side” plugin, with the current npm version being v0.3.0.
What It Is¶
dsh-codex-auth is a self-contained DSH Codex capability pack. In short: it reuses the local Codex CLI’s ChatGPT login to provide DSH with an LLM route, global search provider, image tools, and a GPT Auth settings interface with login and capability cards.
It is not officially produced by DeepSeek or High-Flyer; the community directory SkillHub is an independent site with no official affiliation with upstream. The GitHub repository suntianc/dsh-codex-auth has approximately 13 stars and 4 forks at the time of writing.
Core Features¶
Shared Codex Login State¶
LLM, search, and image tools share a single authentication coordinator that runs only on the Host. Credentials are parsed from version-bound auth.json snapshots, with short-lived in-memory caching and proactive refresh before expiration. Concurrent refreshes are merged within the process, and short cross-process locks are used around OAuth network I/O.
You can initiate the official codex login (browser or device code flow) from the GPT Auth card or run codex login in the terminal beforehand. The settings page displays connection status, as well as best-effort weekly remaining quota and reset time. The plugin’s own /codex-auth Connection RPC only allows loopback access and does not send token values to the browser.
openai-codex LLM Route¶
Registers the openai-codex provider, displayed as OpenAI Codex (chatgpt) in the model selector (modifiable via Host configuration displayName). Default streaming is sse; websocket and auto are also supported.
The GPT Auth settings provide a default-off 1M context toggle, which can increase the context window reported to DSH for gpt-5.6-luna, gpt-5.6-sol, and gpt-5.6-terra from 272,000 Tokens to 1,000,000 Tokens for DSH to calculate token pressure and compression timing. Requests exceeding 272K may consume account quota faster and will not expand compressed history.
Web Search¶
Registers a search provider with ID codex via the codex-search Host line to @deepseek-ai/dsh-web, integrated as a global Search Provider for DSH’s built-in web_search tool. Each search request hits the official endpoint:
https://chatgpt.com/backend-api/codex/alpha/search
If the caller is the openai-codex Agent, search uses that Agent’s current model; otherwise, it uses the fallback model in settings (default gpt-5.4). Network errors and HTTP 5xx responses are retried up to five times with exponential backoff; HTTP 429 returns immediately.
Default configurable options include: enable (true), mode (live), context size (medium), fallback model, and max output tokens (2048).
Image Creation¶
generate_image appears as a single operation to the model, dispatched based on the presence of reference images:
POST https://chatgpt.com/backend-api/codex/images/generations
POST https://chatgpt.com/backend-api/codex/images/edits
Supports a required prompt, up to five reference images, 1–10 outputs, and options for size/quality/background. Reference images must have explicit sources, e.g.:
{ "kind": "session", "handle": "image:<attachmentId>" }
{ "kind": "workspace", "path": "assets/reference.png" }
Generated results are validated and persistently saved via ctx.attachments.saveImage(...), displayed in DSH’s standard image gallery. list_images allows the model to view persistent images in the session after context compression, defaulting to 5 images per page with a maximum of 10.
Image tools are only registered to openai-codex Agents that declare support for image input; marked unavailable when locally identified as the Free plan.
Environment Requirements¶
Confirm the following before installation:
- DeepSeek Harness
0.1.1-rc.1or a compatible later0.1.xversion. - Node.js
^22.19.0or>=24.0.0. codexCLI added toPATH.codex loginhas been executed, or you’re prepared to log in from the GPT Auth card.
If Codex stores credentials only in the system keychain and auth.json has no available token, set cli_auth_credentials_store = "file" in ~/.codex/config.toml and log in again.
Installation and Enabling¶
Installation from npm is recommended. The package includes pre-built Host and browser bundles, requiring no build permissions during installation:
dsh plugin --profile web add dsh-codex-auth
After installation, restart dsh web, open settings, and select GPT Auth.
To upgrade to the current version, first stop the running dsh web, then execute:
dsh plugin --profile web add dsh-codex-auth@0.3.0
dsh plugin --profile web list
Once the list shows dsh-codex-auth@0.3.0, restart dsh web and refresh the browser.
Other installation methods (pre-built Release tarball, GitHub source, local pack) are detailed in the repository README. When installing from GitHub source, pnpm 10+ may require adding the allowBuilds key to ~/.dsh/profiles/web/pnpm-workspace.yaml—only authorize after reviewing and trusting the source code.
Typical Usage¶
1. Login and Status Check¶
- Install the plugin and restart
dsh web. - Go to Settings → GPT Auth.
- If not logged in, start
codex loginfrom the login card; or run beforehand in the terminal:
codex login
- The card displays connection status and weekly usage information (best-effort).
2. Using openai-codex Models¶
Select a model under OpenAI Codex (chatgpt) in the DSH model selector (e.g., gpt-5.6-luna). For longer context, enable the 1M context toggle in the GPT Auth LLM Context card.
3. Enabling Search and Images¶
Web search and image creation are enabled by default. Adjust mode, fallback model, image size, etc., in the corresponding GPT Auth cards; detailed options can be collapsed into compact lines. When an Agent uses openai-codex and supports image input, generate_image and list_images become automatically available.
Host Configuration (Optional)¶
The capability pack enables three Host lines in dependency order:
| Line | Export | Function |
|---|---|---|
llm-codex-auth |
dsh-codex-auth |
Shared authentication coordinator and LLM route |
codex-search |
dsh-codex-auth/search |
Global search provider |
codex-image |
dsh-codex-auth/image |
Agent-scoped image tools |
Do not duplicate openai-codex under llm-pi-ai.providers or install alongside dsh-codex; duplicate route ownership will be explicitly rejected. If only search/images are needed without the LLM route, set llmEnabled: false to retain the shared login coordinator.
Use Cases and Notes¶
Who it’s for: Individual developers who have logged into ChatGPT using Codex CLI locally and want to uniformly use openai-codex models, web search, and image capabilities in the DSH Web Profile.
Important notes:
- The plugin uses private, account-permission-controlled
chatgpt.com/backend-api, which is an unofficial channel that may be revoked, rate-limited, or changed at any time. The README explicitly states “for personal development only”—do not use for production tasks. - DSH plugins run with the current
dshprocess permissions; check the source code and license before installation (repository: GitHub). - Token values do not enter the browser, settings, logs, or tool metadata; only Host-side requests carry authentication headers.
- Do not overlay with
dsh-codexor handwrittenopenai-codexprovider configurations to avoid route conflicts.
Conclusion¶
dsh-codex-auth connects the existing ChatGPT login state from Codex CLI to DSH, covering LLM, search, images, and GPT Auth settings with a single installation, reducing redundant credential configuration. If you’re exploring Codex integration in the DSH ecosystem, check the community directory or GitHub for details:
- Directory: https://www.skillhub.cn/plugins/suntianc/dsh-codex-auth
- GitHub: https://github.com/suntianc/dsh-codex-auth