Khellendros97/dsh-subscription-auth

Plugin插件 Native原生 ⭐ 4 BSD-3-Clause Models & Routing模型与路由

dsh对接OpenAI、Grok、Anthropic、Kimi订阅渠道

Project Overview项目介绍

dsh-subscription-auth is a purpose-built plugin for DeepSeek Harness (DSH) that enables OAuth login for personal LLM subscription accounts. It eliminates the need for separate paid API keys by letting users access models through their existing consumer subscriptions to four major providers: OpenAI ChatGPT, Anthropic Claude, xAI Grok, and Moonshot AI Kimi. It uses the standard PKCE authorization code flow for ChatGPT and Claude, and the RFC 8628 device authorization flow for Grok and Kimi, matching each provider’s official OAuth requirements. It ships with a valid DSH bundle manifest and can be installed in one command via the DSH CLI, with automatic registration after a restart and browser hard refresh.

This plugin is designed for DSH users who already hold active consumer subscriptions to any of the supported providers and want to avoid paying for separate API quota. After installation, you will need to restart your DSH instance and perform a hard browser refresh to load the plugin’s settings UI. Once loaded, you can navigate to the subscription services panel in DSH settings, click login for your desired provider, complete the OAuth flow as prompted, and the plugin will automatically pull available models and add them to DSH’s model selector. It also supports custom reasoning effort settings for supported models, letting users adjust thinking budget to match their specific task needs.

The plugin is released under the permissive open-source BSD-3-Clause license, and requires a working DSH installation, Node.js version 20 or newer, and a working pnpm installation to install correctly. Key known limitations include that Anthropic’s OAuth access tokens expire after roughly 30 days, and refresh tokens cannot extend the authorization period, so users must re-login after expiration. The plugin stores all login tokens in DSH’s local credential service, so it only works with locally hosted DSH instances, and users should never share their local credential data with third parties. It also supports manual configuration of custom base URLs and fixed model lists for advanced users to override defaults.

这是专为 DeepSeek Harness (DSH) 开发的原生插件,为 DSH 增加了 LLM 订阅账号的 OAuth 登录能力,允许用户使用个人订阅账号而非 API 密钥调用对应模型服务。插件内置四个主流订阅渠道:ChatGPT Plus/Pro、Claude Pro/Max、Grok SuperGrok/X Premium+、Kimi Code,分别适配 PKCE 授权码流和设备授权流两种标准 OAuth 流程,自带 DSH 捆绑清单,支持 DSH CLI 一键安装挂载。

该插件面向已有对应大模型订阅、不想额外购买官方 API 额度的 DSH 用户使用。安装完成后需要重启 DSH 并硬刷新浏览器,之后即可在设置页的「订阅服务」面板看到所有支持的渠道,点击对应渠道的登录按钮,跟随页面指引完成授权即可,登录成功后会自动拉取该渠道下的可用模型列表,注册到 DSH 的模型选择器供调用。

该项目采用 BSD-3-Clause 开源许可证,使用要求已有可正常运行的 DSH 环境、Node.js 20 以上版本,同时需要 pnpm 可用。已知限制包括 Anthropic 订阅的授权有效期约 30 天,刷新令牌无法延长有效期,过期后需重新登录;授权回调绑定本地端口,仅支持在本地运行的 DSH 实例使用;令牌存储在本机凭证服务,请勿外传。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 4 stars - very few users, little community feedback星标只有 4,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-subscription-auth

把 Khellendros97/dsh-subscription-auth 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-subscription-auth

npm version

给 dsh 增加订阅会员 OAuth 登录支持(模型提供商按订阅账号登录,而不是 API key)。内置四个订阅渠道:

渠道 登录方式 推理 API
ChatGPT 订阅(Plus/Pro) 授权码 + PKCE + localhost 回调 codex Responses API
Claude(Pro/Max) 授权码 + PKCE + localhost 回调 Anthropic Messages API
Grok(SuperGrok / X Premium+) RFC 8628 设备授权流 xAI Responses API
Kimi(Kimi Code) RFC 8628 设备授权流 Kimi Anthropic Messages API

每个渠道是一个自包含模块(src/channels/<id>.ts,实现 ChannelDefinition 契约),src/index.ts 是薄的通用驱动(遍历渠道定义注册 settings / provider / adapter / 路由)。OAuth 常量与 wire 格式以 omp(@oh-my-pi/pi-ai、@oh-my-pi/pi-catalog)源码为准。对接方法见内置 skill:subscription-channel-migration。

渠道详情

环节 ChatGPT Claude Grok Kimi
授权端点 https://auth.openai.com/oauth/authorize https://claude.ai/oauth/authorize https://auth.x.ai/oauth2/device/code https://auth.kimi.com/api/oauth/device_authorization
令牌端点 https://auth.openai.com/oauth/token https://api.anthropic.com/v1/oauth/token (OIDC 发现 https://auth.x.ai/.well-known/openid-configuration) https://auth.kimi.com/api/oauth/token
client_id app_EMoamEEZ73f0CkXaXp7hrann 9d1c250a-e61b-44d9-88ed-5944d1962f5e b1a00492-073a-47ea-816f-4c329264a828 17e5f671-d194-4dfb-9706-5516cb48c098
scope openid profile email offline_access api.connectors.read api.connectors.invoke org:create_api_key user:profile user:inference user:sessions:claude_code user:mcp_servers user:file_upload openid profile email offline_access grok-cli:access api:access (设备流,无 scope)
回调 http://localhost:1455/auth/callback http://localhost:54545/callback 设备流(无回调) 设备流(无回调)
调用端点 https://chatgpt.com/backend-api/codex/responses https://api.anthropic.com/v1/messages https://api.x.ai/v1/responses https://api.kimi.com/coding/v1/messages

登录时:授权码渠道(ChatGPT / Claude)生成 PKCE 挑战 → 用 rundll32 打开浏览器(不能用 cmd /c start:URL 里的 & 会被截断)→ 本地一次性 HTTP 服务器收 code+state(10 分钟超时)→ 换令牌 → 存进 credential 服务。设备流渠道(Grok / Kimi)请求设备码 → 打开验证页并展示授权码 → 后台轮询直到用户完成授权 → 存令牌。之后每次请求前检查 access token 快过期则静默续期。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-mario-pixel-skin 下一个 Next dsh-recover-context →