Skip to content
All posts

Use AnyRouter in DeepSeek Harness

DeepSeek Harness is DeepSeek's open-source agent app, now in preview. Add AnyRouter as a custom model API with one base URL and one key, then pick an anyrouter/* router model for each kind of work.


What DeepSeek Harness is

DeepSeek Harness (dsh) is an open-source agent harness from DeepSeek, released under the MIT license. Its product page describes it as a tool for everyday tasks, coding, or building your own harness. Every part of it is a plugin, and you can ask the agent to write new plugins.

It runs as a desktop app on macOS (Apple silicon) and Windows (64-bit). You can also start the Web UI with npx @deepseek-ai/dsh web. Harness is a preview. DeepSeek says its core plugins and APIs still change, and the README warns of compatibility-breaking changes.

DeepSeek Harness home screen titled Into the Unknown with a Preview badge. The sidebar lists New Session, Plugins, Automation tasks and Workspaces. The composer shows a Default workspace, Standard mode, a Workspace Write permission selector and a Select model dropdown.
The Harness home screen. Pick a workspace, a mode and a permission level, then pick a model.

The app shows workspaces, sessions, plugins, automation tasks and agent presets. You pick the model for a session from the Select model dropdown in the composer.

Add AnyRouter as a custom model API

Harness lists built-in providers under Third-party model provider. Any other endpoint goes under Custom model API, which accepts OpenAI-compatible and Anthropic-compatible endpoints. AnyRouter is one of those.

  1. Create an AnyRouter API key at anyrouter.dev/keys. It starts with sk-ar-.
  2. In Harness, open Settings, then Models, choose Add model provider, and switch to the Custom model API tab.
  3. Set Provider ID to anyrouter. Harness uses this id in requests, saved sessions and the credential name, so you cannot rename it later.
  4. Set Base URL to https://anyrouter.dev/api/v1 and API protocol to OpenAI Chat Completions.
  5. Paste your sk-ar- key into API key.
  6. Choose Fetch available models, tick the anyrouter/* models you want, and save.
DeepSeek Harness Settings, Models, Custom model API tab. Provider ID is anyrouter, Base URL is https://anyrouter.dev/api/v1, API protocol is OpenAI Chat Completions and the API key is masked. The model list shows anyrouter/byok, anyrouter/coding, anyrouter/agent and anyrouter/hermes.
The finished custom model API form. The key field is masked, and the model list came from Fetch available models.

Harness says discovery is a convenience, not a guarantee. If Fetch available models lists nothing, type the model ids by hand. They work the same way.

Harness stores the key in $DSH_HOME/.credentials.yaml and writes the rest to the profile's cordis.patch.yml. Choose Open configuration file in the Settings header to edit it directly. This entry is the same provider, reading the key from the ANYROUTER_API_KEY environment variable:

yaml
- id: llm-pi-ai
  config:
    providers:
      anyrouter:
        apiKeyEnv: ANYROUTER_API_KEY
        api: openai-completions
        baseURL: https://anyrouter.dev/api/v1
        models:
          - id: anyrouter/coding
          - id: anyrouter/agent
          - id: anyrouter/hermes
          - id: anyrouter/auto

Harness replaces the whole entry config when it applies an override. Keep your other providers in the block when you edit it.

Anthropic Messages works too

The API protocol picker offers OpenAI Chat Completions, OpenAI Responses and Anthropic Messages. One Harness provider speaks one protocol. If you want Anthropic Messages, add a second provider, for example anyrouter-messages, with protocol Anthropic Messages and Base URL https://anyrouter.dev/api.

Leave /v1 off that base URL. Anthropic clients add /v1/messages themselves, and AnyRouter serves Messages at https://anyrouter.dev/api/v1/messages. The same sk-ar- key works on both protocols. Chat Completions is the simpler default, so start there.

Which anyrouter/* model to pick

In this setup, Fetch available models pulled in every AnyRouter router model. anyrouter/byok, anyrouter/coding and anyrouter/agent appear only once your account has a provider key at anyrouter.dev/byok. Each one is a routing rule, not a single model. AnyRouter picks a real model per request and falls back to the next one when an upstream fails.

The DeepSeek Harness model picker open under the anyrouter provider, listing AnyRouter BYOK, Coding, Agent, Hermes, Cowork, Free, Auto (checked), Decision and Latest. The composer shows Full access and AnyRouter Auto. The footer reads 1 turns 7 steps, 198 tok/s, 146K tok, Cache hit 69%.
The Harness model picker after a fetch. This session ran on AnyRouter Auto.
ModelRoutes acrossBilled to
anyrouter/codingTool-calling models your own keys reach, best for coding firstYour provider
anyrouter/agentTool-calling models your own keys reach, best model firstYour provider
anyrouter/byokEvery model your own keys reach, with no tool-calling filterYour provider
anyrouter/hermesTop tool-calling models, one per upstream providerAnyRouter credits
anyrouter/coworkTool-calling models for assistant work, with vision, one per providerAnyRouter credits
anyrouter/autoTop used, stable models, free and paid mixed, health-awareEach hop's rate, $0 on free hops
anyrouter/latestThe latest stable chat model that is serving trafficEach hop's rate
anyrouter/freeModels AnyRouter serves at $0Nothing

For coding sessions, pick anyrouter/coding if you have your own provider keys, and anyrouter/hermes if you do not. A Harness agent calls tools on almost every step, and both of these only route to models that accept tools.

anyrouter/auto is a good general default. When a request carries tools, as Harness agent steps do, AnyRouter routes it only to models that accept tools. Pick anyrouter/coding or anyrouter/hermes when you want the ranking tuned for coding or tool calling.

Skip anyrouter/decision. It is for the Decisions API (/api/v1/decisions), which returns typed yes or no, choice and score answers. It is not a chat model for an agent loop.

Footer numbers are per session. In the session above, Harness reported 1 turn, 7 steps, 198 tok/s, 146K tokens and a 69% cache hit. That is one session, not a benchmark.

Run on your own keys with BYOK

anyrouter/byok, anyrouter/coding and anyrouter/agent route only across your own provider keys. Your provider bills you, and AnyRouter never takes credits for these requests. Add keys once at anyrouter.dev/byok. They become available to these models right away.

With no provider keys saved, these three models are not listed and have nothing to route to. Use anyrouter/hermes or anyrouter/auto until you add a key.

Add your provider keys once and use them from Harness.

Add a key

Get a key and pick a plan

Sign up at anyrouter.dev and create a key at anyrouter.dev/keys. The Free plan gives you a 5-request trial on free and decision models, paid models with purchased credit, and your own BYOK keys as normal. The Go plan is $2 a month, or free when you donate one valid, unique provider key that the shared pool can use. It opens every model and adds $4 of credit each month.

Every request Harness sends shows up in your AnyRouter request logs.

Step-by-step setup with the same screenshots.

Open the use case

Route your first request in 2 minutes

Start free with your own keys, or top up and pay per token. Get $4/mo in credits and free models on Go — $2/mo, or free when you donate a provider key.

Start free