Claude visitors: new accounts receive $1.00 in bonus API credit within 30 days. One per person; usage credits only.

DEEPSEEK HARNESS + RUNAPI

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.

Checked with dsh 0.2.1-rc.2 against a local stub · no paid upstream call
- 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
export RUNAPI_API_KEY="runapi_xxx"
npx @deepseek-ai/[email protected] --version
npx @deepseek-ai/[email protected] headless --patch runapi.patch.yml "Reply with one short sentence."
npx @deepseek-ai/[email protected] web --patch runapi.patch.yml
Checked with dsh 0.2.1-rc.2/v1
SCOPE

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.

SETUP

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/[email protected] headless --patch runapi.patch.yml "Reply with one short sentence."
REFERENCE

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.
CHAT CHECK

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.

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."}]}'
TROUBLESHOOTING

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.

Get a RunAPI key for dsh.

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