> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://respan.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://respan.ai/docs/_mcp/server.

# DeepSeek Harness (gateway)

> Set up DeepSeek Harness (dsh) with the Respan gateway.

Route [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)' LLM calls through the Respan gateway for automatic logging, caching, and model switching. dsh supports custom OpenAI-compatible and Anthropic-compatible providers, so only your `RESPAN_API_KEY` is needed.

## Setup

#### Install dsh

```bash
npm install -g @deepseek-ai/dsh
```

#### Add Respan as a provider

Edit `$DSH_HOME/settings.yaml` (defaults to `~/.dsh/settings.yaml`) and add a provider under the `llm-pi-ai` section:

```yaml
llm-pi-ai:
  providers:
    respan:
      apiKeyEnv: RESPAN_API_KEY
      api: openai-completions
      baseURL: https://api.respan.ai/api
      models:
        - id: gpt-4o
        - id: claude-sonnet-4-5-20250929
```

`apiKeyEnv` is the **name** of the environment variable that holds your key. Export it in your shell profile:

```bash
export RESPAN_API_KEY="YOUR_RESPAN_API_KEY"
```

You can do the same from the web UI: run `dsh web`, open **Settings**, then **Models**, choose **Add a custom provider**, and fill in the provider ID `respan`, the base URL `https://api.respan.ai/api`, the `openai-completions` protocol, your key, and at least one model.

No separate provider key needed. The Respan gateway handles provider authentication.

#### Make Respan the default model

dsh's profiles default to the `deepseek-official` route. Override the default model with a patch overlay. Save this as `~/.dsh/respan.yml`:

```yaml
- id: agent-default-model
  config:
    provider: respan
    model: gpt-4o
```

#### Run dsh

```bash
dsh --profile tui --patch ~/.dsh/respan.yml
```

For a one-shot, non-interactive run:

```bash
dsh --profile headless --patch ~/.dsh/respan.yml "your task"
```

All LLM calls now route through Respan.

## Switch models

Add more entries under `models` and change `model` in the patch overlay (or pick a model in the UI) to use any of the 1000+ models available through the gateway.

```text
gpt-4o
claude-sonnet-4-5-20250929
gemini/gemini-3.5-flash
```

See the [full model list](https://platform.respan.ai/platform/models).