Preface¶
When integrating OpenAI-family models into DeepSeek Harness (DSH), the common approach is to fill in an API Key and pay per token. If you already have a ChatGPT subscription, the more natural expectation is: after logging into the account, the model list matches the subscription plan, and inference uses the account quota rather than requiring a separately purchased Key.
Below is an introduction to the community plugin dsh-plugin-chatgpt (maintainer ckanner). It adds a provider route named chatgpt in DSH (not openai, because the built-in pi-ai already occupies that name). It completes login via OpenAI’s public Sign in with ChatGPT OAuth without requiring an API Key; the models, context windows, and reasoning tiers under the account are derived from the account-side listing rather than a hardcoded model table.
What is this¶
dsh-plugin-chatgpt is a DSH plugin published on npm (MIT license), categorized as a model inference capability. After installation, a ChatGPT row appears under Settings → Models; completing login on that row’s card allows you to select subscription-available models by the ChatGPT group in the model selector.
The plugin runs with the permissions of the current DSH process; before installation, it is recommended to review the GitHub repository source code and license. Community directory page: skillhub.cn plugin entry (an independent site with no official affiliation with DeepSeek / High-Flyer).
Core Features¶
-
OAuth Login, No API Key
Uses the Sign in with ChatGPT flow; credentials are saved in the configuredstateDir(defaulting tochatgpt-subscriptionunder the DSH state directory) in an owner-only manner. The settings page displays the authorization URL and supports copying; if the browser cannot access the loopback, you can paste the final redirect URL back onto the card to complete authorization. Logging out revokes the renewable session with the authorization endpoint (it will also prompt if the server does not confirm). -
A Provider Route
chatgpt
Model metadata comes primarily from the account’sGET /v1/modelslisting; after selecting models in Settings → Models, they enter the DSH model selector with no separate picker. -
Optional Context Budgeting
By default, it follows the context window published by each model in the catalog. You can set a global limit usingcontextWindowLimitin the plugin configuration, or override individually by exact model ID (case-sensitive) usingmodelContextWindowLimits; priority is single model → global → account default. These settings are independent of Codex, and DSH still reserves compaction headroom. -
Headless Environment
You can use the same session flow in scenarios without a browser viaChatGptAuth(seesrc/auth/manager.tsin the repository): print the authorization URL, optionallyattempt.submit(full redirect URL), and thenauth.adopt(credential). -
Implementation Constraints (Consistent with Subscription Routing)
Requests will not carry fields rejected by subscription routing (such astemperature,max_output_tokens,top_p, etc.); streaming responses must treatresponse.completedas the sole successful termination, otherwise it is considered an error.
Installation and Activation¶
The plugin is installed via npm and requires no local build. The full installation is a single command (from the source material):
dsh plugin --profile <name> add dsh-plugin-chatgpt
A harness restart is required after installation: profiles are assembled at startup. To pin a version, the source example is:
dsh plugin --profile <name> add dsh-plugin-chatgpt@0.1.9 # pin a version, or omit it for the latest
Uninstallation:
dsh plugin --profile <name> remove dsh-plugin-chatgpt
The package declares dsh.bundle, which, upon addition, writes to the profile’s dsh.profile.bundles and inserts a composition layer. You can verify if it has taken effect without starting the process:
dsh --profile <name> --dump-config # shows a "# == dsh-plugin-chatgpt" layer
Note: Directly using add with a GitHub URL will trigger a source build, and pnpm may fail because git dependency build scripts are not listed in onlyBuiltDependencies (referring to the ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED error in the materials); the standard usage is installation via the npm package name.
Runtime environment requirements (package.json): Node ^22.19.0 || >=24.0.0.
Typical Usage¶
Login and Select Models in the UI¶
- Open Settings → Models and locate the ChatGPT row.
- Click Sign in with ChatGPT and follow the card prompts to complete authorization in the browser; if localhost loopback is unavailable, paste the final redirect URL from the browser.
- The card will display the account plan, next token refresh time, and the number of available models; check to enable models on this page.
- Select enabled models under the ChatGPT group in the DSH model selector.
On the subscription side, you can restrict the plan share available to this installation by application in ChatGPT settings (the plugin README contains screenshots explaining this).
Configure Context Limits (Optional)¶
Example of a global default budget:
contextWindowLimit: 1000000
Example of limits per model ID (keys must match the IDs in the listing exactly):
contextWindowLimit: 500000
modelContextWindowLimits:
gpt-6-astra: 1000000
gpt-6.1-sol: 800000
Changes take effect the next time DSH resolves models; deleting a model entry falls back to the global or account default.
Headless Login (Script)¶
import { ChatGptAuth } from 'dsh-plugin-chatgpt/src/auth/manager.ts'
const auth = new ChatGptAuth({
stateDir: `${process.env.DSH_HOME ?? `${process.env.HOME}/.dsh`}/chatgpt-subscription`,
agentNameHint: 'DeepSeek Harness',
})
const attempt = await auth.begin()
console.log('Open this URL in your browser:\n' + attempt.authorizationUrl)
// If redirect cannot reach loopback, paste the full URL:
// await attempt.submit('<the full redirect URL from your browser>')
const credential = await attempt.result
auth.adopt(credential)
Scenarios and Notes¶
Who it is for: Users who already have a ChatGPT subscription, wish to use the same account model roster for agent development or daily inference in DSH, and accept the constraints of OAuth and subscription routing parameters (you cannot expect to pass all sampling fields of the OpenAI API arbitrarily).
Points to note:
- Costs and quotas are governed by the ChatGPT account and plan on the ChatGPT side; the plugin README also lists known limitations and deferred work, so it is worth skimming the repository documentation before upgrading.
- The plugin process has the same permissions as DSH; OAuth credentials are stored locally in
stateDir, so consider directory permissions and backup strategies when deploying on shared machines. - The DSH ecosystem is “everything is a plugin”; this package is a community-maintained npm plugin. The installation command is strictly
dsh plugin --profile … add dsh-plugin-chatgpt. Do not invent formats likegithub:owner/repothat do not appear in the materials based solely on the repository name.
Conclusion¶
dsh-plugin-chatgpt integrates ChatGPT subscriptions into DSH’s model stack: a chatgpt route, login in Settings, and a model list driven by the account. If you want to reuse your subscription rather than an API Key in the harness, follow the installation steps above, restart, and complete Sign in on the Models page.
- Community Directory: https://www.skillhub.cn/plugins/ckanner/dsh-plugin-chatgpt
- Source Code and Documentation: https://github.com/ckanner/dsh-plugin-chatgpt