Connect Moyi API to DeepSeek Harness

DeepSeek Harness (command: dsh) supports OpenAI-compatible model providers. After completing this guide, you can use models such as deepseek-flash, deepseek-v4-pro, deepseek-v4-flash, gpt-6-astra, and gpt-5.6-sol through Moyi API while keeping the Harness web interface, sessions, and agent capabilities.

Supported models

  • DeepSeek: deepseek-flash (DeepSeek V4.1 Flash), deepseek-v4-pro (August 13 official release), deepseek-v4-flash (July 31 official release)
  • GLM: glm-5.3-flash
  • GPT: gpt-6-astra, gpt-5.6-sol, gpt-5.6-luna, gpt-5.6-terra, gpt-5.5

1. Prerequisites

Before you begin, install Node.js 24 and prepare a valid Moyi API API key.

1.1 Install Node.js 24

DeepSeek Harness requires Node.js 24. npm is included with Node.js. Download the installer for your operating system and CPU architecture:

When using the China mirror, select a v24.x.x directory and download the installer for your system. After installation, reopen your terminal and check the versions:

bash
node --version
npm --version

The output of node --version should start with v24..

Moyi API API keys start with sk-moyiapi-. You can create one in the Moyi API dashboard.

Create a Moyi API API key

2. Configure and start in one step

You do not need to open or manually edit any configuration files. Replace sk-moyiapi-replace-with-your-api-key in the code block with your Moyi API API key, then copy and run the entire command in your terminal. It installs, configures, and starts DeepSeek Harness automatically.

macOS / Linux

bash
bash <<'MOYIAPI_SETUP'
set -e

npm install -g @deepseek-ai/dsh
MOYIAPI_API_KEY="sk-moyiapi-replace-with-your-api-key"
export MOYIAPI_API_KEY

NODE_PATH="$(npm root -g)/@deepseek-ai/dsh/node_modules" node <<'NODE'
const fs = require('fs');
const os = require('os');
const path = require('path');
const yaml = require('js-yaml');

const home = process.env.DSH_HOME || path.join(os.homedir(), '.dsh');
const settingsPath = path.join(home, 'settings.yaml');
fs.mkdirSync(home, { recursive: true });

const current = fs.existsSync(settingsPath)
  ? (yaml.load(fs.readFileSync(settingsPath, 'utf8')) || {})
  : {};

if (fs.existsSync(settingsPath)) {
  fs.copyFileSync(settingsPath, settingsPath + '.bak.' + Date.now());
}

current['llm-pi-ai'] ??= {};
current['llm-pi-ai'].providers ??= {};
current['llm-pi-ai'].providers.moyiapi = {
  displayName: 'Moyi API',
  apiKeyEnv: 'MOYIAPI_API_KEY',
  api: 'openai-completions',
  baseURL: 'https://api.moyiapi.com/v1',
  models: [
    { id: 'deepseek-flash', name: 'DeepSeek V4.1 Flash' },
    { id: 'deepseek-v4-pro', name: 'DeepSeek V4 Pro' },
    { id: 'deepseek-v4-flash', name: 'DeepSeek V4 Flash' },
    { id: 'gpt-6-astra', name: 'GPT 6 Astra' },
    { id: 'gpt-5.6-sol', name: 'GPT 5.6 Sol' },
    { id: 'gpt-5.6-luna', name: 'GPT 5.6 Luna' },
    { id: 'gpt-5.6-terra', name: 'GPT 5.6 Terra' },
    { id: 'gpt-5.5', name: 'GPT 5.5' },
  ],
};
current['agent-default-model'] = {
  provider: 'moyiapi',
  model: 'deepseek-flash',
};

fs.writeFileSync(
  settingsPath,
  yaml.dump(current, { lineWidth: -1, noRefs: true }),
  { mode: 0o600 },
);

const envPath = path.join(home, '.env');
const oldLines = fs.existsSync(envPath)
  ? fs.readFileSync(envPath, 'utf8').split(/\r?\n/)
  : [];
const lines = oldLines.filter(
  (line) => line && !line.startsWith('MOYIAPI_API_KEY='),
);
lines.push('MOYIAPI_API_KEY=' + process.env.MOYIAPI_API_KEY);
fs.writeFileSync(envPath, lines.join('\n') + '\n', { mode: 0o600 });

console.log('Moyi API configured. Default model: deepseek-flash');
NODE

dsh web
MOYIAPI_SETUP

Windows PowerShell

powershell
npm install -g @deepseek-ai/dsh

$env:MOYIAPI_API_KEY = 'sk-moyiapi-replace-with-your-api-key'
$env:NODE_PATH = "$(npm root -g)\@deepseek-ai\dsh\node_modules"

@'
const fs = require('fs');
const os = require('os');
const path = require('path');
const yaml = require('js-yaml');

const home = process.env.DSH_HOME || path.join(os.homedir(), '.dsh');
const settingsPath = path.join(home, 'settings.yaml');
fs.mkdirSync(home, { recursive: true });

const current = fs.existsSync(settingsPath)
  ? (yaml.load(fs.readFileSync(settingsPath, 'utf8')) || {})
  : {};

if (fs.existsSync(settingsPath)) {
  fs.copyFileSync(settingsPath, settingsPath + '.bak.' + Date.now());
}

current['llm-pi-ai'] ??= {};
current['llm-pi-ai'].providers ??= {};
current['llm-pi-ai'].providers.moyiapi = {
  displayName: 'Moyi API',
  apiKeyEnv: 'MOYIAPI_API_KEY',
  api: 'openai-completions',
  baseURL: 'https://api.moyiapi.com/v1',
  models: [
    { id: 'deepseek-flash', name: 'DeepSeek V4.1 Flash' },
    { id: 'deepseek-v4-pro', name: 'DeepSeek V4 Pro' },
    { id: 'deepseek-v4-flash', name: 'DeepSeek V4 Flash' },
    { id: 'gpt-6-astra', name: 'GPT 6 Astra' },
    { id: 'gpt-5.6-sol', name: 'GPT 5.6 Sol' },
    { id: 'gpt-5.6-luna', name: 'GPT 5.6 Luna' },
    { id: 'gpt-5.6-terra', name: 'GPT 5.6 Terra' },
    { id: 'gpt-5.5', name: 'GPT 5.5' }
  ]
};

current['agent-default-model'] = {
  provider: 'moyiapi',
  model: 'deepseek-flash'
};

fs.writeFileSync(
  settingsPath,
  yaml.dump(current, { lineWidth: -1, noRefs: true }),
  { mode: 0o600 }
);

const envPath = path.join(home, '.env');
const oldLines = fs.existsSync(envPath)
  ? fs.readFileSync(envPath, 'utf8').split(/\r?\n/)
  : [];
const lines = oldLines.filter(
  (line) => line && !line.startsWith('MOYIAPI_API_KEY=')
);
lines.push('MOYIAPI_API_KEY=' + process.env.MOYIAPI_API_KEY);
fs.writeFileSync(envPath, lines.join('\n') + '\n', { mode: 0o600 });

console.log('Moyi API configured. Default model: deepseek-flash');
'@ | node

if ($LASTEXITCODE -eq 0) {
  dsh web
}

The command installs DeepSeek Harness, backs up and merges any existing configuration, stores your key, configures the Moyi API models, and starts Harness. It does not remove your existing theme or other settings.

After startup, the terminal displays a local URL, usually http://127.0.0.1:3080. Open it in your browser and create a new session. To start Harness again later, run this command from your project directory:

bash
dsh web

To use Harness in a specific project, change to the actual project directory before running dsh web. Do not copy /path/to/my-project literally; it is only a placeholder.

3. Verify the connection

Send a minimal request in headless mode to verify the configuration, API key, and model:

bash
export MOYIAPI_API_KEY="sk-moyiapi-xxxxxx"
dsh --profile headless "Reply with OK only"

If the terminal returns OK, DeepSeek Harness has successfully called a model through Moyi API. Run dsh web to open the web interface.

4. Add and switch models

To choose from multiple Moyi API models in Harness, add them to the same models list. This example includes DeepSeek V4.1 Flash, DeepSeek V4 models, and several GPT models:

yaml
llm-pi-ai:
  providers:
    moyiapi:
      displayName: Moyi API
      apiKeyEnv: MOYIAPI_API_KEY
      api: openai-completions
      baseURL: https://api.moyiapi.com/v1
      models:
        - id: deepseek-flash
          name: DeepSeek V4.1 Flash
        - id: deepseek-v4-pro
          name: DeepSeek V4 Pro
        - id: deepseek-v4-flash
          name: DeepSeek V4 Flash
        - id: gpt-6-astra
          name: GPT 6 Astra
        - id: gpt-5.6-sol
          name: GPT 5.6 Sol
        - id: gpt-5.6-luna
          name: GPT 5.6 Luna
        - id: gpt-5.5
          name: GPT 5.5
        - id: gpt-5.4
          name: GPT 5.4

agent-default-model:
  provider: moyiapi
  model: deepseek-flash

Change agent-default-model.model to set the default model for new sessions. Existing sessions may continue using their original model. After changing the default, refresh the page and create a new session, or switch models manually from the model selector.

A model entry accepts text only by default. To send images in a conversation, add input: [text, image] to each model that supports image input; otherwise Harness shows "The current model does not support images". For example, DeepSeek V4.1 Flash and GLM 5.3 Flash:

yaml
      models:
        - id: deepseek-flash
          name: DeepSeek V4.1 Flash
          input: [text, image]
        - id: glm-5.3-flash
          name: GLM 5.3 Flash
          input: [text, image]

deepseek-v4-flash accepts text only. Do not add image to it.

Moyi API's model catalog is updated continuously. To confirm the current model IDs, run:

bash
curl https://api.moyiapi.com/v1/models \
  -H "Authorization: Bearer sk-moyiapi-xxxxxx"

5. Troubleshooting

The API returns 401 or invalid_bearer_token. Make sure the API key is complete, contains no extra spaces, has not been deleted, and starts with sk-moyiapi-. If the error continues, create a new key in the Moyi API dashboard and try again.

Sending an image shows "The current model does not support images". The model entry does not declare image input. Open ~/.dsh/settings.yaml (or, in the Harness UI, go to Settings → Models → Open config file), add input: [text, image] to that model, save, and start a new session. If the model selector does not update, restart dsh web. See section 4 for the full syntax.

Ready? Three steps to startLog in to the console · top up · create an API key
DiscordGet community help instantly
Connect Moyi API to DeepSeek Harness · Docs