Introduction

DeepSeek Harness (DSH) uses a microkernel architecture, and pluginization is its core feature. When deploying large models locally, managing multi-channel subscriptions (such as Google Antigravity and OpenAI Codex) often requires writing complex proxy scripts. This plugin provides a local visual console based on CLIProxyAPI, an open-source kernel with 52k+ Stars. It reverse-proxies the above channels into standard OpenAI-compatible interfaces and deeply integrates them into the DSH ecosystem.

It provides a complete graphical control hub that integrates environment deployment, multi-channel OAuth authorization, an intelligent multi-account rotation pool, 5-hour and 7-day weekly quota overview, adaptive overseas network proxying, and intelligent context optimization.

Core Features

The plugin mainly addresses three issues: multi-channel subscription management, quota monitoring, and network proxy configuration.

Multi-Channel Model Reverse Proxy

The gateway supports converting multiple upstream channels uniformly into the standard OpenAI protocol interface for DSH and other compatible clients to use.
* Google Antigravity channel: Supports models such as Gemini 3.8 Flash (262k/1M) and Claude Sonnet 4.6/Opus 4.6.
* OpenAI Codex channel: Supports the GPT-5.6 series and o1-series reasoning models.
* ZCode / Zhipu BigModel channel: Built-in driver; automatically decrypts local credential files. Supports models such as GLM-5.3, with streaming reasoning_content and tool_calls. Note: This channel relies on client fingerprints and cannot replicate the free-quota channel on a purely server-side setup.

Multi-Account Rotation and Failover

  • Load balancing: Multiple accounts are rotated in Round-Robin order to expand available concurrency.
  • Seamless relay: When an account reaches the 5-hour rate limit or encounters sporadic 429 errors, the gateway smoothly switches to an available account within milliseconds without interrupting front-end tasks.

Quota Monitoring Dashboard

Provides precise monitoring of the 5-hour rolling window and 7-day weekly quota.
* High-precision metrics: Calculated by calling the official backend API directly.
* Countdown prediction: Shows the time when the quota is fully restored.
* Status capsules: Green (>40%), yellow (15%–40%), red (<15%).

SWR Fast Response and Proxy Optimization

  • SWR mechanism: In-memory caching; the panel renders instantly in 0–1 ms, while the background asynchronously preheats after 45 s.
  • Intelligent proxy: Automatically detects environment variables, registry, and local ports (such as 7890/7892) to resolve long-conversation handshake timeouts in TUN virtual NIC Fake-IP mode.

Installation and Activation

The plugin is installed via the DSH CLI.

  1. Install the plugin
    Run the following command to add the plugin to the specified profile:
    dsh plugin --profile web add dsh-plugin-ai-gateway
Or use the built-in script in the plugin project root directory:
    node tools/install-into-profile.mjs --profile web
  1. Restart the service
    After installation, restart the DSH Web process to load the plugin:
    node tools/restart-web.mjs --yes

Configuration and Usage

After installation and restart, account onboarding must be completed in the browser.

  1. Open the DSH Web interface.
  2. Navigate to the left-side Settings → AI Aggregation Gateway.
  3. Click ➕ Log in with a Google account or ➕ Log in with a Codex account, and complete a one-time OAuth authorization in the resulting link.
  4. After authorization succeeds, click One-Click Onboarding below. The plugin automatically writes the gateway configuration and security keys into DSH.

Security Design

The plugin design emphasizes local usage and security.

  • Local binding: Strictly bound to 127.0.0.1 by default, rejecting LAN exposure.
  • Key separation: The API Key and admin key are generated independently. The API Key is persistently stored in the DSH-dedicated credentials area, while the main configuration keeps only a reference.
  • Same-origin protection: Front-end admin endpoints enforce Origin validation and block cross-site requests (CSRF).
  • Self-healing mechanism: A built-in 60-second watchdog automatically restarts it after unexpected disconnections and cleans up child processes when DSH exits.

Dependencies and Notes

  • Runtime environment: Requires Node.js >= 22.5.
  • ZCode limitation: The ZCode channel depends on client fingerprints (such as User-Agent, X-Title, etc.) and cannot replicate its official free-quota channel on a purely server-side setup. For daily use, rely on the paid channel.
  • Plugin permissions: The plugin runs with the current DSH process permissions. It is recommended to review the source code and license before installation.
  • Plugin directory: https://www.skillhub.cn/plugins/huguangyu666/dsh-plugin-ai-gateway
  • GitHub repository: https://github.com/huguangyu666/dsh-plugin-ai-gateway