# DSH 使用 DeepSleep 中转站 API 操作说明

通过 OpenAI 兼容接口在 DeepSeek Harness 中接入 DeepSleep，完成 API 配置、Codex 系列模型添加、必要请求头设置与会话模型选择。

# DSH 使用 DeepSleep 中转站 API 操作说明

通过 DeepSleep 的 OpenAI 兼容接口，将 Codex 系列模型添加到 DeepSeek Harness。

<div style="margin:24px 0 28px;padding:20px 16px;text-align:center;border-top:2px solid currentColor;border-bottom:2px solid currentColor;">
  <div style="font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,'Liberation Mono','Courier New',monospace;font-size:2em;font-weight:800;line-height:1.2;">Everything is a Plugin</div>
  <div style="margin-top:8px;font-size:0.95em;font-weight:600;">DeepSeek Harness 的扩展哲学</div>
</div>

> <strong>准备：</strong>DeepSleep API Key，以及当前可用的 OpenAI 兼容接口地址。

## 一、安装并打开 DSH

### 1. 启动 DSH

安装 [Node.js](https://nodejs.org/)，然后在终端进入需要使用的工作目录并运行：

```sh
npx @deepseek-ai/dsh web
```

首次运行时，`npx` 会下载并启动 DSH。

### 2. 打开 Web UI

终端显示访问地址后，在浏览器打开：

```text
http://127.0.0.1:3080
```

看到 DeepSeek Harness 页面即表示 Web UI 已正常启动。首次打开时按页面提示继续即可。

![DeepSeek Harness Web UI 首次打开界面](https://docs.20020519.xyz/uploads/images/gallery/2026-08/dsh-web-ui-open.png)

## 二、配置 DeepSleep 中转站

### 1. 打开模型设置

在 DeepSeek Harness 左下角打开「设置」，进入「模型」，点击「添加提供方」。

![打开模型设置并添加提供方](https://docs.20020519.xyz/uploads/images/gallery/2026-08/deepseek-harness-deepsleep-codex-1.png)

### 2. 填写 DeepSleep 接口

提供方选择 `openai`，填写 API Key 和 DeepSleep API 地址，然后点击「获取可用模型」。

![填写 API Key、API 地址并获取可用模型](https://docs.20020519.xyz/uploads/images/gallery/2026-08/deepseek-harness-deepsleep-codex-2.png)

### 3. 添加 Codex 模型

从返回的模型列表中勾选需要使用的 Codex 系列模型，点击「保存」。模型 ID 必须与接口返回值一致。

![勾选 Codex 系列模型并保存](https://docs.20020519.xyz/uploads/images/gallery/2026-08/deepseek-harness-deepsleep-codex-3.png)

### 4. 打开配置文件

保存后回到模型设置页，点击右上角「打开配置文件」。

![打开 settings.yaml 配置文件](https://docs.20020519.xyz/uploads/images/gallery/2026-08/deepseek-harness-deepsleep-codex-4.png)

### 5. 添加请求头

在 `llm-pi-ai.providers.openai` 下添加以下字段，并保存配置文件：

```yaml
headers:
  originator: dsh-local
```

![在 settings.yaml 中添加 originator 请求头](https://docs.20020519.xyz/uploads/images/gallery/2026-08/deepseek-harness-deepsleep-codex-6.png)

### 6. 在会话中选择模型

新建会话，在输入框右下角的模型选择器中选择刚刚添加的 Codex 模型，即可开始使用。

![在会话模型选择器中选择 Codex 模型](https://docs.20020519.xyz/uploads/images/gallery/2026-08/deepseek-harness-deepsleep-codex-7.png)