# DeepSeek Harness API Key: Which Key Goes Where

Updated: 2026-09-24

One Modellix API key powers LLM, Design, and Web in DeepSeek Harness. Where it lives depends on how you add it: $DSH\_HOME/.credentials.yaml or MODELLIX\_API\_KEY.

![Modellix Team](<https://img.modellix.ai/en/article/modellix-blog-author-official-2x.webp>)

**Modellix Team**Official

Published 2026-09-01

Updated 2026-09-24

10 min read

### On this page

On this page

**Summary**

The DeepSeek Harness API key: one key, not a platform key The deepseek harness api key question has a short answer: it is one Modellix key from the Modellix consolehttps://www.modellix.

![DeepSeek Harness API key editorial cover: one amber key branching to three glass hosts (LLM, Design, Web) with credential storage, MODELLIX wordmark, dark amber vignette](<https://img.modellix.ai/en/article/cover-deepseek-harness-api-key.png>)  

## The DeepSeek Harness API key: one key, not a platform key

The deepseek harness api key question has a short answer: it is **one Modellix key** from the [Modellix console](<https://www.modellix.ai/console/api-key>)—not from DeepSeek, OpenAI, Anthropic, or any other model provider's platform. The first-party integration doc is explicit about this: the prerequisite is "a Modellix [API key](<https://docs.modellix.ai/llm/agent/deepseek-harness>)—not a vendor platform key."

That last clause is where most setups go wrong. If you already hold a DeepSeek platform key (`sk-…` from [platform.deepseek.com](<http://platform.deepseek.com/>)) or an OpenAI key, it is natural to paste it into the first "API key" field the harness shows you. But the harness distinguishes providers by credential, not by field name: a key issued by another platform is a bearer credential for that platform's billing, and the Modellix provider will reject it. The key you want is the one created in the console's API key page, which bills to your Modellix account and authenticates every Modellix host the harness talks to.

If you came here from the configuration-only path—the [DeepSeek Harness custom model guide](<https://www.modellix.ai/blog/deepseek-harness-custom-model.md>) covers swapping the model source without a plugin—this key ownership question is the same one you hit there. It is also the same one the plugin path hits, because both paths hand the harness the same single key. We operate Modellix and maintain its Harness integration, so we have a commercial interest in this working for you; everything below was verified against [docs.modellix.ai](<http://docs.modellix.ai/>) and the official DeepSeek Harness providers guide on September 1, 2026.

## Two key sources, two behaviors

There are two ways to give the harness a Modellix key, and they behave differently in every way that matters later—where the key is stored, what the UI shows you, and how you change it:

| Source | How you add it | Where it is stored | What the UI shows | How to change it |
| --- | --- | --- | --- | --- |
| **Saved key** (Web UI / form) | Enter the key in Modellix settings or the custom provider form | Harness Credential service, written to `$DSH_HOME/.credentials.yaml` | Only a redacted descriptor after saving, never the key itself | Replace or remove it in the settings page |
| **Environment variable** | `MODELLIX_API_KEY` in the harness launch environment | Outside the harness, in your shell or secret manager | Read-only—the field is not editable in the UI | Change the variable and restart the harness |

The saved-key path is the one the [Modellix plugin for DeepSeek Harness](<https://www.modellix.ai/blog/dsh-plugin-add.md>) uses in its "Connect Modellix" dialog: the key is write-only, and the page shows a redacted descriptor once it is saved. The environment path is the supported pattern for scripts, containers, and anyone who keeps secrets in a manager: `MODELLIX_API_KEY` in the launch environment, which the [plugin docs](<https://docs.modellix.ai/ways-to-use/deepseek-harness>) describe as "read-only in the UI and require a Harness restart after you replace the value."

Most of the "my key stopped working" reports in this area trace back to one of the two behaviors above: someone rotated the key in the console but the harness still holds the old saved key, or someone edited the environment variable of a running process and expected it to pick up the new value. Neither updates live. The deepseek harness environment variable `MODELLIX_API_KEY` is resolved at request time from your launch environment, not re-read from a config file.

   ![Two DeepSeek Harness API key sources: form input stored in the Credential service's .credentials.yaml with a redacted descriptor, versus MODELLIX\_API\_KEY read-only in the UI with restart to change](<https://img.modellix.ai/en/article/dsh-key-sources-behaviors.png>)  

*The two sources side by side: a saved key is stored in the Credential service and shown redacted; an environment key stays outside the harness and needs a restart to change.*

## Where the key lives: the Credential service, not settings.yaml

The storage detail that surprises people: your key is not in the deepseek harness provider configuration file, `settings.yaml`. The official [providers guide](<https://github.com/deepseek-ai/deepseek-harness/blob/master/docs/user/guide/providers.md>) states it plainly:

> Keys are write-only. The page receives a redacted descriptor after saving, never the literal secret. The key is stored in `$DSH_HOME/.credentials.yaml`, while settings retain only its credential reference.

That is the pattern to remember: **`settings.yaml` holds a reference, the Credential service holds the value.** Most deepseek harness credentials questions are really storage questions, and the answer is always the same split. The Modellix integration doc says it about the config-file route: "Credentials stay out of this file—`apiKeyEnv` is a reference resolved per request." When you declare the Modellix provider directly in `$DSH_HOME/settings.yaml`, the file looks like this:

yaml

```
llm-pi-ai:
  providers:
    modellix:
      api: openai-completions
      baseURL: https://llm.modellix.ai/v1
      apiKeyEnv: MODELLIX_API_KEY
      models:
        - id: deepseek/deepseek-chat
```

There is no key literal anywhere in that file. `apiKeyEnv` names the environment variable whose value is resolved when a request is made—so the plaintext lives either in your environment or in the Credential service's `$DSH_HOME/.credentials.yaml`, never in the configuration file itself.

Why does the storage location matter in practice? Two reasons. First, if you back up, sync, or commit `$DSH_HOME` anywhere, the credential document is what you must protect—a GitHub discussion on the harness repository, [Storage of API Key \#3503](<https://github.com/deepseek-ai/deepseek-harness/discussions/3503>), notes the document is plaintext YAML protected only by file permissions (`0600` under a `0700` directory) and by keeping the path out of the model's context. Second, when you are told to "check `$DSH_HOME/.credentials.yaml`", it must exist and contain a `modellix` entry—if it does not, the key was never saved through the form, which usually means the harness is looking for `MODELLIX_API_KEY` instead.

## One key, three hosts

A single Modellix key authenticates every host the harness can reach through Modellix. There is no separate "search key," "image key," or "model key" to create:

| Host | What it serves | Where the key is checked |
| --- | --- | --- |
| `https://llm.modellix.ai/v1` | LLM model calls (OpenAI-compatible Chat Completions) | Every request to the LLM gateway |
| `https://api.modellix.ai` | Design: image, video, and audio generation tasks | Every media task submission |
| `https://tool.modellix.ai` | Web Search and Web Fetch tools | Every web tool call |

The same key that unlocks the model selector also covers media generation and the web tools, which is why the plugin's setup has exactly one credential field. The Modellix [Tools overview](<https://docs.modellix.ai/tools/overview>) documents the `api.modellix.ai` and `tool.modellix.ai` hosts; the LLM gateway's endpoint, protocol, and models live in the [LLM overview](<https://docs.modellix.ai/llm/overview>). One boundary from the same docs: the Modellix LLM is a text gateway—use text-only prompts and do not attach images to model requests; media goes to the Design host, not the LLM host.

One consequence worth knowing: because all three hosts authenticate with the same key, rotating that key in the console affects every Modellix feature in the harness at once. There is no way to keep media working while the LLM host rejects an old key—they share one credential.

   ![One Modellix API key branching to the three hosts it authenticates: LLM at llm.modellix.ai, Design at api.modellix.ai, and Web at tool.modellix.ai](<https://img.modellix.ai/en/article/dsh-one-key-three-hosts.png>)  

*The one-key-three-hosts model: a single Modellix key authenticates the LLM gateway, the Design API, and the Web tools.*

The web-tool host is covered in detail by the [web search and fetch guide](<https://www.modellix.ai/blog/deepseek-harness-web-search.md>) in this series, including how the native `web_search` and `web_fetch` tools authenticate through it.

## Which key goes where: the new-profile popup trap

A fresh profile does not present one dialog—it presents two, and they ask for different keys. This is the single most common "which key does what" confusion in the plugin's local-usage notes:

1. First, the harness's own **DeepSeek initialization popup** appears. It wants a DeepSeek key, because the harness ships with DeepSeek's own provider as its default model source.
2. Only after that, the plugin's **"Connect Modellix" dialog** appears. It wants a Modellix key.

People see the first popup, decide they do not want to use DeepSeek's platform, and either paste a Modellix key into it (which the DeepSeek provider will reject) or close everything and conclude the plugin failed to load. Neither is the case: complete or dismiss the DeepSeek initialization step first, and the plugin's dialog takes its turn. If you skipped the plugin dialog, the plugin stays unavailable and asks again the next time you use an enabled Modellix capability.

The one-line rule that resolves every popup and form in this article: **the DeepSeek provider accepts a DeepSeek platform key; the Modellix provider accepts a Modellix console key.** Filling a DeepSeek, OpenAI, or other platform key into the Modellix provider is the most common misconfiguration in this setup, and it fails with authentication errors that look like network problems.

## Changing, replacing, and removing a key

How you change a key depends on which source it came from, matching the table above:

- **Saved key:** open the Modellix settings section and use the replace action. The page shows a redacted descriptor plus the source (saved key vs `MODELLIX_API_KEY`); replace or remove the writable local credential there.
- **Environment-sourced key:** edit the variable in your shell profile or secret manager, then **restart the harness**. The UI will not let you type over an environment credential.
- **Invalid key:** only an HTTP `401` marks a credential invalid. A `402` means check account status and balance in the console, `429` means wait for the rate-limit window, and timeouts mean restore connectivity—do not assume the key is bad when the failure is something else.
- **Missing credential:** a `MISSING_CREDENTIAL` error means the provider has no stored key and no resolvable `apiKeyEnv`—store the key through the settings page or provide the referenced environment variable, per the integration doc's troubleshooting table.

Two traps around "where the key is stored" belong to this section. First, the `modellix-cli` command-line tool keeps its own Keychain, and it is a **separate store** from the Harness Credential service: the plugin does not install or invoke `modellix-cli` at runtime, and it does not auto-read your CLI login state. Logging in with the CLI does not configure the harness, and there is no "login once, works everywhere" shortcut. Second, if you are reinstalling or updating the plugin, remove the writable key in settings first (or revoke the environment credential), then remove the plugin and restart the profile—the [plugin add guide](<https://www.modellix.ai/blog/dsh-plugin-add.md>) walks through the `dsh plugin add` install-and-restart sequence for the dsh api key setup. For failures that survive all of the above, the companion [error recovery article](<https://www.modellix.ai/blog/deepseek-harness-error.md>) in this batch goes deeper into each error state.

## Key hygiene: places a key should never end up

Once you know where a key is *supposed* to live, the inverse is worth stating explicitly. A real Modellix key should never appear in:

- a repository (including a private one—credentials in git history are permanent),
- a command-line argument (visible in process listings and shell history),
- a log file or debug output,
- a screenshot or screen recording,
- an HTTP archive (HAR) capture,
- or a test snapshot.

This is the plugin's own guidance, paraphrased: never put a real key in a repository, command argument, log, screenshot, HAR, recording, or test snapshot. The supported pattern is `MODELLIX_API_KEY` in your shell profile or secret manager, or the saved-key path with its redacted descriptor.

The "why" has a concrete edge case for Harness users: the credential document in `$DSH_HOME/.credentials.yaml` is readable by any process running as your user—including the harness's own tool subprocesses. The repository's security discussion \#3503 calls file permissions "discretion, not a boundary" and proposes at-rest encryption or an OS keychain as the stronger answer. Until that lands, treat the file as a secret: do not sync `$DSH_HOME` to cloud storage, do not commit it, and do not paste its contents into a support thread. If you suspect a key leaked through any of the channels above, rotate it in the console—the old value stops working immediately for all three hosts.

## Is there a "free" API key for the harness?

There is no automatic free tier for Modellix. Add credit to the account, then each request bills per call at the price shown in the console. The $1 signup credit for new accounts ended on August 19, 2026.

Two adjacent points so the answer does not mislead. First, a free DeepSeek account's API key is not a free Modellix key—it authenticates DeepSeek's own platform, which bills its own usage. Second, "free" in the community sense of the open-source harness itself is unchanged: DeepSeek Harness is open source and free to run locally; what costs money is the model usage behind the key, on whichever provider you configure. This article is about key ownership, not about comparing providers—that selection decision is a separate topic.

## Where this fits: what to do now

You now know the three facts that matter: the key is a Modellix console key, not a vendor platform key; it lives either in the Credential service's `$DSH_HOME/.credentials.yaml` or in `MODELLIX_API_KEY`, never in `settings.yaml`; and changing it is either a settings-page replace or an environment edit plus restart. The rest of the series covers the surrounding decisions: the custom model guide for the configuration-only path, the plugin article for bundle mechanics, and the pillar [DeepSeek Harness article](<https://www.modellix.ai/blog/deepseek-harness.md>) that ties the cluster together. The companion piece on token usage and metering, being published in the same batch, covers what each request actually costs on the LLM host.

Your next three steps: create a key in the Modellix console, add it through the saved-key path or `MODELLIX_API_KEY`, and confirm a model call succeeds. When you later rotate it, come back to the table in this article—the source determines the change procedure.

### Create Your Modellix API Key

Log in to the Modellix console to create your API key and check live per-call pricing before your first harness run.

[Login](<https://www.modellix.ai/console/login>)

![Modellix Team](<https://img.modellix.ai/en/article/modellix-blog-author-official-2x.webp>)

Written by**Modellix Team**Official

**Share**

[Back to top](<https://www.modellix.ai/blog/deepseek-harness-api-key#blog-article-top>)

## Related articles

[![DeepSeek Harness Provider Errors: UNKNOWN\_MODEL and 401s](<https://img.modellix.ai/en/article/cover-deepseek-harness-error.webp>)](<https://www.modellix.ai/blog/deepseek-harness-error.md>)

[LLM API](<https://www.modellix.ai/blog/categories/LLM-API>)

2026-09-01

### DeepSeek Harness Provider Errors: UNKNOWN\_MODEL and 401s

Decode DeepSeek Harness provider errors: UNKNOWN\_MODEL means the models list is the catalog, MISSING\_CREDENTIAL means no key, only a 401 marks a key invalid.

Modellix Team10 min read

[![dsh plugin add: Install, Verify, Remove Harness Bundles](<https://img.modellix.ai/en/article/cover-dsh-plugin-add.webp>)](<https://www.modellix.ai/blog/dsh-plugin-add.md>)

[LLM API](<https://www.modellix.ai/blog/categories/LLM-API>)

2026-09-01

### dsh plugin add: Install, Verify, Remove Harness Bundles

dsh plugin add installs a bundle into a profile, but installed does not mean effective. Verify with dsh --dump-config, pack a tarball, or remove cleanly.

Modellix Team13 min read

[![DeepSeek Harness Image Generation: Media Output via Plugin](<https://img.modellix.ai/en/article/cover-deepseek-harness-image-generation.webp>)](<https://www.modellix.ai/blog/deepseek-harness-image-generation.md>)

[LLM API](<https://www.modellix.ai/blog/categories/LLM-API>)

2026-09-01

### DeepSeek Harness Image Generation: Media Output via Plugin

Generating images inside DeepSeek Harness requires a plugin: the Design module adds image, video and audio output, and the billing boundaries most guides skip.

Modellix Team10 min read

[![DeepSeek Harness Token Usage: What an Agent Run Costs](<https://img.modellix.ai/en/article/cover-deepseek-harness-token-usage.webp>)](<https://www.modellix.ai/blog/deepseek-harness-token-usage.md>)

[LLM API](<https://www.modellix.ai/blog/categories/LLM-API>)

2026-09-01

### DeepSeek Harness Token Usage: What an Agent Run Costs

See what one DeepSeek Harness agent run costs: query GET /v1/logs for per-request cost, token buckets, and session attribution, then convert per 1M tokens.

Modellix Team10 min read
