Home / Integrations / OpenRouter

How to use OpenRouter in DeepSeek Harness

OpenRouter is the fastest way to try many models without opening accounts everywhere. It is OpenAI-compatible, so DSH treats it as a Custom model API speaking OpenAI Chat Completions.

Before you start

You need a partially funded OpenRouter account, an API key, and Node.js installed. If DSH itself is not running yet, do the install guide first.

Step 1 — create an API key

Sign in to OpenRouter and create a key in its console. Copy it once — most providers never show it again.

Open OpenRouter →

Step 2 — start the harness

npx @deepseek-ai/dsh web

Web UI comes up at http://127.0.0.1:3080.

Step 3 — Add model provider → Custom model API

In Settings → Models, choose Add model provider, then switch the card to Custom model API — that is the route for a relay, a company gateway, or any provider absent from the installed catalog. Fill in:

FieldValue
Provider IDopenrouter
Base URLhttps://openrouter.ai/api/v1
API protocolOpenAI Chat Completions
API keyyour key

The Provider ID is permanent — requests, saved sessions, model defaults and credential references all use it. To rename a provider you add a new one and delete the old one; everything except the ID stays editable.

A provider speaks exactly one protocol. A gateway that serves both OpenAI and Anthropic formats needs two separate provider entries.

Step 4 — add at least one model

Use Fetch available models to ask the endpoint what it serves — the request uses the base URL, protocol and key currently in the form. It reads the listing formats common gateways publish, but not every endpoint answers in one of them, so when it fails or lists nothing, add the ids by hand and they work the same.

Known-good ids:

Step 5 — verify

Save, then select the model in the composer. Model changes apply on the next request; no restart.

Or: configure it in YAML

The Web UI writes the same document you can edit directly. The profile for a standard dsh web launch is web, so the file is $DSH_HOME/profiles/web/cordis.patch.yml. Adapters re-read it on the next request — no restart needed.

# $DSH_HOME/profiles/web/cordis.patch.yml
- id: llm-pi-ai
  config:
    providers:
      openrouter:
        apiKeyEnv: DSH_API_KEY
        api: openai-completions
        baseURL: https://openrouter.ai/api/v1
        models:
          - id: deepseek/deepseek-chat

A Cordis config override replaces the complete entry config — when editing an existing override, preserve your other providers and fields or they vanish.

Export the variable referenced above in the shell that starts DSH:

export DSH_API_KEY="sk-..."

Troubleshooting

Cost and caveats

Per token at the underlying provider's price, plus a small fee on credit top-ups. No monthly minimum.

Plugins that pair well with this provider

DSH 插件:设置页配置 OpenRouter 提供商列表,注入 provider.only / provider.order 路由参数;状态持久化

★ 4MIT

Other providers

Source for every field above: the official DSH provider docs. If DSH changes a field name, that document wins over this page.