Connect Agent Tools

DeepSeek Harness

DeepSeek Harness (dsh) is DeepSeek's open-source Agent runtime for building AI Agents with tool calling, multi-turn conversations, and plugins. The official dsh-llm-autorouter plugin routes Harness model calls through AutoRouter for intelligent routing, channel failover, billing, and observability. This guide explains how to connect DeepSeek Harness to AutoRouter.

📦 Prerequisites

What you'll need

  • A working DeepSeek Harness installation (the Web profile is recommended; verified with 0.1.0-rc.5, while Harness remains in Developer Preview)
  • A valid AutoRouter API Key (generated in the console)
  • The model ID you want to use (such as deepseek-v4-flash or gpt-5-nano), exactly matching the model ID in the AutoRouter console

How it works

  • DeepSeek Harness runs the Agent; AutoRouter selects the model and channel.
  • The plugin registers the autorouter provider in Harness. Models available in chat come from the allowlist created by fetching and importing selected models; the gateway is not discovered automatically.

🔑 Step 1: Get an API Key

  1. Open the AutoRouter API keys page and click Create API Key. See Quick Start for details.
  2. After creating it, copy and securely store the API Key. You will configure it later on the DeepSeek Harness Plugins page.

🔌 Step 2: Install the AutoRouter integration plugin

In an environment where dsh / @deepseek-ai/dsh is installed, add the plugin to the Web profile (recommended):

npx @deepseek-ai/dsh plugin --profile web add dsh-llm-autorouter

You can also install it from git:

npx @deepseek-ai/dsh plugin --profile web add github:autorouter0-ai/dsh-llm-autorouter

The git installation downloads the source and runs the build. If it fails on the first attempt, follow the allowBuilds instructions shown in the command output.

⚙️ Step 3: Configure AutoRouter in Plugins

  1. Start DeepSeek Harness Web, open the Plugins page, and expand the AutoRouter card.

  2. Enter the connection details and click Save:

FieldWhat to enter
EndpointThe gateway origin, with no trailing slash or /v1. Public cloud default: https://api.autorouter.top
API KeyThe AutoRouter API Key created in the previous step. It is stored by the credentials service and is not written to settings.yaml

Enter the endpoint and API Key

  1. After saving successfully, click Fetch models to retrieve the importable catalog from the gateway, grouped by capability such as chat or image generation.

Fetch the model list

  1. Select the models you need (for example, deepseek-v4-flash) and click Import selected models. Only imported models appear in the chat model selector.

Import selected models

🧭 Step 4: Select an AutoRouter model in chat

In the Web chat model selector, choose an imported AutoRouter model to test it.

Select an imported AutoRouter model

✅ Step 5: Verify the integration

  1. Start a conversation or Agent task in DeepSeek Harness.
  2. Confirm that content streams back normally.
  3. Optionally, review the request's usage and routing records in the AutoRouter console to confirm that traffic reached the gateway.

Verify a successful chat response

A normal response confirms that the setup is complete. Harness model calls will now pass through AutoRouter, where the gateway handles intelligent routing and channel management.

❓ FAQ

IssueSolution
Connection failed / invalid API KeyCheck that the endpoint is https://api.autorouter.top (not a full path ending in /v1/chat/completions), verify the API Key, and make sure you clicked Save
Fetching models failsSave the endpoint and API Key before clicking Fetch models, and confirm that your machine can reach the gateway
Models do not appear in chatYou must first Fetch models and Import selected models; the chat selector only reads the imported allowlist
Model not foundConfirm that the Agent's model, the imported model ID, and the model ID in the AutoRouter console match exactly
Incorrect endpointEnter the gateway origin in the Harness plugin (for example, https://api.autorouter.top), not the full Chat Completions URL
API Key locked by an environment variableIf AUTOROUTER_API_KEY is already set in the launch environment, the Plugins page may be unable to overwrite it. Remove the variable and restart dsh web, or use the page to store the key
No UI / CLI profileSet the AUTOROUTER_API_KEY environment variable or store the key through the credentials service; prepare the model allowlist through the configuration/import workflow

On this page