---
title: Use RunAPI in DeepSeek Harness — Custom Model API Guide | RunAPI
description: Configure DeepSeek Harness (dsh) with RunAPI as a Custom model API over OpenAI Chat Completions, keep the key in RUNAPI_API_KEY, and send a first text chat with gpt-5.4-nano.
url: https://runapi.ai/dsh.md
canonical: https://runapi.ai/dsh
locale: en
site: RunAPI
image: https://runapi.ai/assets/opengraph-bfaaa0f0.png
alternates:
  en: https://runapi.ai/dsh
  zh-CN: https://runapi.ai/zh-CN/dsh
  es: https://runapi.ai/es/dsh
  ja: https://runapi.ai/ja/dsh
  de: https://runapi.ai/de/dsh
  fr: https://runapi.ai/fr/dsh
  pt-BR: https://runapi.ai/pt-BR/dsh
  ko: https://runapi.ai/ko/dsh
  it: https://runapi.ai/it/dsh
  nl: https://runapi.ai/nl/dsh
  pl: https://runapi.ai/pl/dsh
  tr: https://runapi.ai/tr/dsh
  zh-TW: https://runapi.ai/zh-TW/dsh
  zh-HK: https://runapi.ai/zh-HK/dsh
  ar: https://runapi.ai/ar/dsh
  x-default: https://runapi.ai/dsh
---

> HTML version: https://runapi.ai/dsh
> Site index for agents: https://runapi.ai/llms.txt


# Use RunAPI in DeepSeek Harness.

Add RunAPI as a Custom model API in dsh, point it at https://runapi.ai/v1 over OpenAI Chat Completions, and chat with gpt-5.4-nano from the Web UI or a headless run.

- [Get API Key](https://runapi.ai/login)
- [Browse models](https://runapi.ai/models.md)

> Checked with dsh 0.2.1-rc.2 against a local stub · no paid upstream call

## One model, one text chat

- **Goal** — Let a DeepSeek Harness user route chat requests through RunAPI with their own base URL and API key, without a native provider plugin.
- **Smallest working setup** — One Custom model API provider named runapi, one model, gpt-5.4-nano, and one text message that returns a reply.
- **Locked version** — The configuration and commands were checked with @deepseek-ai/dsh 0.2.1-rc.2. Pin that version with npx until you have checked a newer release yourself.
- **Unpaid boundary** — dsh loading, request shape, replies, and error messages were checked against a local stub of the RunAPI endpoint. No paid upstream request was made for this page.

## runapi.patch.yml

```yaml
- id: llm-pi-ai
  config:
    providers:
      runapi:
        apiKeyEnv: RUNAPI_API_KEY
        api: openai-completions
        baseURL: https://runapi.ai/v1
        models:
          - id: gpt-5.4-nano
- id: agent-default-model
  config:
    provider: runapi
    model: gpt-5.4-nano
```

## Commands

```bash
export RUNAPI_API_KEY="runapi_xxx"
npx @deepseek-ai/dsh@0.2.1-rc.2 --version
npx @deepseek-ai/dsh@0.2.1-rc.2 headless --patch runapi.patch.yml "Reply with one short sentence."
npx @deepseek-ai/dsh@0.2.1-rc.2 web --patch runapi.patch.yml
```

## Connect dsh to RunAPI in three steps

1. **Export the RunAPI key** — Set RUNAPI_API_KEY in the shell that starts dsh. The patch reads the key from the environment, so the key never lands in a file. `export RUNAPI_API_KEY="runapi_xxx"`
2. **Add the Custom model API** — Save runapi.patch.yml for --patch, or add the values in Settings → Models → Add model provider → Custom model API. The UI saves its own profile and key in credentials storage; --patch makes these fields read-only in Settings. `api: openai-completions`
3. **Send one text message** — Run one headless task or open the Web UI with the patch. In the UI, select runapi/gpt-5.4-nano in the model picker before chatting. A reply in the terminal or chat means dsh reached RunAPI. `npx @deepseek-ai/dsh@0.2.1-rc.2 headless --patch runapi.patch.yml "Reply with one short sentence."`

## Custom model API fields

| Field | Value | Purpose |
| --- | --- | --- |
| Provider ID | `runapi` | Permanent ID that sessions, defaults, and the credential reference use. |
| Base URL | `https://runapi.ai/v1` | Sends requests to RunAPI's OpenAI-compatible endpoint. |
| API protocol | `openai-completions` | OpenAI Chat Completions, which RunAPI serves at /v1/chat/completions. |
| Credential | `RUNAPI_API_KEY` | Read from the environment with apiKeyEnv, or saved through the Models page. |
| Model | `gpt-5.4-nano` | Low-cost synchronous text model in the RunAPI catalog. |

## Check the key and model before dsh

This synchronous request uses the same base URL, key, and model as the patch and caps the reply at 64 tokens. If it returns a message, a dsh failure is in the dsh configuration rather than the RunAPI account.

```bash
curl https://runapi.ai/v1/chat/completions \
  -H "Authorization: Bearer $RUNAPI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-5.4-nano", "max_tokens": 64, "messages": [{"role": "user", "content": "Reply with one short sentence."}]}'
```

## DeepSeek Harness errors

### dsh stops with MISSING_CREDENTIAL. What is missing?

RUNAPI_API_KEY is not set in the shell that started dsh. Export it, or save the key on the Models page, and run the same command again.
### dsh reports a 404 or a connection error. Is the base URL wrong?

Usually. The base URL must be exactly https://runapi.ai/v1; dsh appends /chat/completions itself. A connection error means the host could not be reached at all.
### dsh reports 404 Resource not found with the right URL. What should I check?

Verify the model ID against the RunAPI model catalog, for example gpt-5.4-nano, and check that agent-default-model uses the matching provider runapi and model ID.
### Do I need a native RunAPI provider plugin?

No. dsh ships Custom model API support for OpenAI Chat Completions, and RunAPI serves that protocol, so the patch is enough for text chat.

## Official sources

- [DeepSeek Harness model configuration](https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/user/guide/providers.md#add-a-custom-model-api)
- [DeepSeek Harness README](https://github.com/deepseek-ai/deepseek-harness#run)

Create or sign in to a RunAPI account, create an API key, and export it as RUNAPI_API_KEY before you start dsh.


---

## More from RunAPI

- [Home](https://runapi.ai/.md)
### Product
- [Model Catalog](https://runapi.ai/models.md)
- [Pricing](https://runapi.ai/pricing.md)
- [Providers](https://runapi.ai/models#all-models)
### Developers
- [Documentation](https://runapi.ai/docs/guides)
- [SDKs](https://runapi.ai/sdk.md)
- [CLI](https://runapi.ai/cli.md)
- [MCP Server](https://runapi.ai/mcp.md)
- [x402](https://runapi.ai/x402.md)
### Guides
- [Claude Code vs Cursor](https://runapi.ai/claude-code-vs-cursor.md)
- [Cursor API Setup](https://runapi.ai/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/openrouter-alternative.md)
### Company
- [Enterprise](https://runapi.ai/contact.md)
- [Contact](https://runapi.ai/contact.md)
### Legal
- [Terms](https://runapi.ai/terms.md)
- [Privacy](https://runapi.ai/privacy.md)
- [Site index for agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Structured data

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/icon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "SoftwareApplication",
    "name": "RunAPI for DeepSeek Harness",
    "applicationCategory": "DeveloperApplication",
    "description": "Configure DeepSeek Harness (dsh) with RunAPI as a Custom model API over OpenAI Chat Completions, keep the key in RUNAPI_API_KEY, and send a first text chat with gpt-5.4-nano.",
    "url": "https://runapi.ai/dsh"
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "dsh stops with MISSING_CREDENTIAL. What is missing?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "RUNAPI_API_KEY is not set in the shell that started dsh. Export it, or save the key on the Models page, and run the same command again."
        }
      },
      {
        "@type": "Question",
        "name": "dsh reports a 404 or a connection error. Is the base URL wrong?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Usually. The base URL must be exactly https://runapi.ai/v1; dsh appends /chat/completions itself. A connection error means the host could not be reached at all."
        }
      },
      {
        "@type": "Question",
        "name": "dsh reports 404 Resource not found with the right URL. What should I check?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "Verify the model ID against the RunAPI model catalog, for example gpt-5.4-nano, and check that agent-default-model uses the matching provider runapi and model ID."
        }
      },
      {
        "@type": "Question",
        "name": "Do I need a native RunAPI provider plugin?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "No. dsh ships Custom model API support for OpenAI Chat Completions, and RunAPI serves that protocol, so the patch is enough for text chat."
        }
      }
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "HowTo",
    "step": [
      {
        "@type": "HowToStep",
        "position": 1,
        "name": "Export the RunAPI key",
        "text": "Set RUNAPI_API_KEY in the shell that starts dsh. The patch reads the key from the environment, so the key never lands in a file."
      },
      {
        "@type": "HowToStep",
        "position": 2,
        "name": "Add the Custom model API",
        "text": "Save runapi.patch.yml for --patch, or add the values in Settings → Models → Add model provider → Custom model API. The UI saves its own profile and key in credentials storage; --patch makes these fields read-only in Settings."
      },
      {
        "@type": "HowToStep",
        "position": 3,
        "name": "Send one text message",
        "text": "Run one headless task or open the Web UI with the patch. In the UI, select runapi/gpt-5.4-nano in the model picker before chatting. A reply in the terminal or chat means dsh reached RunAPI."
      }
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "en",
    "@type": "BreadcrumbList",
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "name": "Home",
        "item": "https://runapi.ai/"
      },
      {
        "@type": "ListItem",
        "position": 2,
        "name": "RunAPI for DeepSeek Harness",
        "item": "https://runapi.ai/dsh"
      }
    ]
  }
]
```
