DeepSeek Harness API Setup

Connect DeepSeek Harness to a TokenHub custom provider with an OpenAI-compatible API, key, and model.

What is DeepSeek Harness?

DeepSeek Harness is an open-source agent harness for DeepSeek models that can use self-hosted and custom provider configurations.

This guide configures a TokenHub provider in DeepSeek Harness, then validates it with a low-risk agent task. Use a model with reliable tool calling before running longer autonomous workflows. An agent harness coordinates context, tools, and task loops around a model endpoint, so ordinary DeepSeek chat compatibility is not enough. The available search evidence is limited and does not support a universal “best harness” claim; compare setup effort, native tool calls, latency, context, and cost in your own repository.

DeepSeek Harness (dsh) can add TokenHub as a custom provider from its Models page. Each provider must declare one protocol actually exposed by the gateway. For TokenHub OpenAI Chat Completions, use openai-completions with https://us-api.tokenhub.com/v1.

DeepSeek Harness remains in developer preview, and its maintainers warn that releases may contain breaking changes. Validate the connection with a low-risk task before using a real repository.

When this integration is a good fit

DeepSeek Harness is intended for development workflows that combine a model, tools, and a workspace into an agent. It persists providers, models, and session settings. Choose a stable Provider ID before creating it so that you do not later have to migrate default-model and session references.

Start DeepSeek Harness

Use the official command to start its local Web UI:

npx @deepseek-ai/dsh web

This starts the local UI and attempts to open it in a browser. When running over SSH or in a remote environment, follow the project's Web UI guidance for the access address. Confirm the UI is reachable before configuring a provider.

Prepare the TokenHub credential and model

Create an API key in the TokenHub dashboard and copy an exact model ID from the model catalog. Never commit the key to a repository or share it.

FieldValue
Provider IDUse a stable lowercase ID such as tokenhub
Base URLhttps://us-api.tokenhub.com/v1
API protocolopenai-completions
CredentialTokenHub API key
Model IDExact ID from the TokenHub model catalog

Add the TokenHub custom provider

  1. Open Settings → Models.
  2. Choose Add a custom provider. Do not configure TokenHub as one of the built-in providers.
  3. Enter the lowercase Provider ID, display name, Base URL, API protocol, and API key.
  4. Add at least one exact TokenHub model ID to the model list and save.
  5. Return to the model selector, choose the provider and model you saved, and create a new session to verify it.

One provider can use only one protocol. If a gateway exposes OpenAI Chat Completions, Responses, and Anthropic Messages, create a separate provider for each protocol instead of mixing them.

Saved sessions, default models, and credentials reference the Provider ID. To rename it, create a new provider, select a new default model, and then migrate old settings if necessary.

Add a model manually when discovery fails

The Model catalog can use Fetch available models to retrieve a model list. This depends on a compatible list-models response and is a convenience, not a prerequisite.

If the fetch fails or returns an empty list:

  1. Keep the correct Base URL, protocol, and API key.
  2. Enter the complete model ID from TokenHub manually.
  3. Save the provider and send a simple request from a new session.
  4. Confirm the model, status, and usage in TokenHub request logs.

A discovery failure alone does not mean the model is unavailable.

Advanced configuration in settings.yaml

The Models page covers routing fields: API key, display name, Base URL, protocol, and model ID. Configure image input, reasoning effort, compatibility overrides, request headers, timeouts, and retry policy in $DSH_HOME/settings.yaml.

For example, declare image input only when the exact model supports it:

llm-pi-ai:
  providers:
    tokenhub:
      apiKeyEnv: TOKENHUB_API_KEY
      api: openai-completions
      baseURL: __API_BASE_URL__/v1
      models:
        - id: YOUR_TOKENHUB_MODEL_ID
          input: [text, image]

The official guide says the adapter reads saved settings.yaml changes on the next request, normally without a restart. Do not add overrides such as supportsDeveloperRole or maxTokensField speculatively; use them only when the gateway requires them or rejects the default request.

Verify that requests reach TokenHub

  1. Confirm the provider and model are saved on the Models page.
  2. Create a new session and select the TokenHub model.
  3. Run a low-risk task, such as explaining one file or summarizing a short block of code.
  4. Confirm the exact model ID, response status, and usage in TokenHub logs.
  5. Then test tools, long tasks, and image input one capability at a time.

An existing session keeps the model recorded in its session log. After changing the default, verify with a new session.

Troubleshooting

SymptomWhat to do
Provider must be renamedCreate a new provider and reselect the default model; do not rely on renaming in place.
Fetch available models failsAdd the complete TokenHub model ID manually; discovery is optional.
404 or request-format errorCheck for openai-completions, https://us-api.tokenhub.com/v1, and no full endpoint path in Base URL.
Advanced parameters do not applyInspect $DSH_HOME/settings.yaml; the basic Models form does not contain reasoning, image, timeout, or retry fields.
Old session ignores a new defaultCreate a new session; sessions with requests retain their original model.

Official references

Choose a compatible DeepSeek Harness model

WorkloadModel choiceWhy it fits
Coding-agent tasksOpenAI Chat Completions model with native tool callingThe custom provider must use the protocol the gateway actually exposes; agent workflows additionally need reliable tool calls.
Vision or reasoning experimentsModel explicitly configured in settings.yamlThe UI only captures the core route. Image input, reasoning effort, headers, timeout, and retry policy require advanced settings.
Cost-sensitive iterationsSmaller compatible model added by exact IDA failed model-list request does not make the route unusable; add and validate the model manually before changing defaults.
Browse TokenHub models and compatibility

DeepSeek Harness provider FAQ

What are DeepSeek Harness and DeepSeek Code Harness?

The terms refer here to an agent harness that coordinates context, tools, and task loops around DeepSeek-oriented coding models.

Can DeepSeek Harness use a custom provider?

Use its documented OpenAI-compatible custom-provider fields, enter the TokenHub Base URL, and read the API key from an environment variable.

Which model should I use with DeepSeek Harness?

Choose a coding model with reliable native tool calling, sufficient context, and verified support for the configured protocol.

Is DeepSeek Harness the best option for my project?

The available search evidence is too limited for a universal best claim. Compare setup, tool success, latency, context, and cost in your own repository.

What should I check when DeepSeek Harness fails?

Check the Base URL, environment variable, API key, model ID, and native tool support, then use TokenHub logs to identify whether the request arrived.

References

This setup is based on TokenHub and official documentation, last verified on 2026-09-04.