Introduction

DeepSeek Harness (DSH) extends functionality through its plugin system. sub2api is a gateway that converts subscription quota into OpenAI-compatible endpoints. Each API key is bound to a group, and the group determines the platform (OpenAI/Claude/Grok) and available models.

The godd6366/dsh-sub2api plugin described in this article integrates the sub2api gateway into DSH as a model provider. It unifies OpenAI, Claude, and Grok routing behind a single base URL, and provides model discovery, usage querying, and a settings page.

Core Features

  • Multi-routing support: Supports the sub2api-openai, sub2api-claude, and sub2api-grok provider routes, sharing a single base URL.
  • Streaming conversations: Supports SSE streaming output, tool calls, incremental reasoning, and token usage statistics.
  • Model discovery: Retrieves the model list with one click via GET {baseURL}/v1/models, exactly matching the gateway groups.
  • Reasoning strength adjustment: Allows adjusting reasoning effort (such as none/low/medium/high/xhigh/max). Configuration items are obtained from models.dev.
  • Usage querying: View quota, balance, and subscription window via GET {baseURL}/v1/usage.
  • Image generation: Supports selecting a generation model, saving it to the workspace, and returning inline attachments.
  • Standardized configuration: Configuration is stored in the llm-sub2api: section. Keys are managed through the credential service or environment variables.
  • Provider icons: Built-in LobeHub SVG icons.

Installation

This plugin depends on DeepSeek Harness 0.1.2-rc.1 or later. The installation command is as follows:

dsh plugin --profile web add @godd6366/dsh-sub2api

After installation, routes are served by dsh-llm-pi-ai. The plugin is responsible for converting settings into llm-pi-ai: configuration files. Note: dsh-client-runtime is no longer a required dependency.

Configuration and Usage

Basic Configuration

In DeepSeek Harness, go to Settings → Sub2API Models, or directly edit $DSH_HOME/settings.yaml:

llm-sub2api:
  baseURL: http://localhost:8080
  providers:
    openai:
      apiKeyEnv: SUB2API_OPENAI_API_KEY
      models:
        - id: gpt-5.6-sol
    claude:
      apiKeyEnv: SUB2API_CLAUDE_API_KEY
    grok:
      apiKeyEnv: SUB2API_GROK_API_KEY

Key Management

  • Store API keys in a credential service (written from the Models page in the Web UI) or in environment variables (for example, SUB2API_OPENAI_API_KEY).
  • Route Activation Condition: A route is activated when a key is configured for a platform and at least one model exists; clearing the key or leaving an empty model list deactivates the route.

Advanced Settings: Endpoint Override

If the gateway does not natively support a certain protocol, you can force the api field in the configuration (there is no settings-page control):

llm-sub2api:
  providers:
    openai:
      apiKeyEnv: SUB2API_OPENAI_API_KEY
      api: openai-responses  # 可选: openai-completions / openai-responses / anthropic-messages
      models:
        - id: gpt-5.6-sol

Common Operations

  • Fetch Models: Click the “Fetch Models” button on the settings page to automatically run GET {baseURL}/v1/models.
  • View Usage: Click the “View Usage” button to run GET {baseURL}/v1/usage.
  • Image Generation: Use the generate_image tool to save images to the workspace.

Notes

  1. Version Requirement: DSH 0.1.2-rc.1 or later must be used.
  2. Backend Dependency: Routes are served by dsh-llm-pi-ai. The plugin only performs defensive checks at startup (ensuring that assistant.usage exists).
  3. Input Modalities: If a model does not declare the image input modality, DSH will reject sending images.

Summary

godd6366/dsh-sub2api is a bridge connecting the sub2api gateway and DeepSeek Harness. Through standardized configuration, it unifies and manages multi-provider routing, making it suitable for developers who need to integrate multiple subscription sources in DSH.

  • Source Code: https://github.com/GodD6366/dsh-sub2api
  • Directory: https://www.skillhub.cn/plugins/GodD6366/dsh-sub2api