> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use DeepSeek Harness with CometAPI

> Configure DeepSeek Harness 0.1.0-rc.8 to use CometAPI through Chat Completions, Responses, Anthropic Messages, or Google generateContent.

Use this guide to run [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) with CometAPI. DeepSeek Harness loads custom model providers from `$DSH_HOME/settings.yaml`, which defaults to `~/.dsh/settings.yaml`.

The configurations on this page were verified with `@deepseek-ai/dsh@0.1.0-rc.8`. Each route completed a streaming text turn and a file-reading tool loop with one representative model. This scope does not mean that every CometAPI model accepts every API format.

<Warning>
  DeepSeek Harness is in Developer Preview and can introduce breaking changes. Pin the tested package version when following this guide, and review the upstream release notes before upgrading.
</Warning>

Official references:

* [DeepSeek Harness repository](https://github.com/deepseek-ai/deepseek-harness)
* [DeepSeek Harness 0.1.0-rc.8 source](https://github.com/deepseek-ai/deepseek-harness/tree/dsh-v0.1.0-rc.8)
* [DeepSeek Harness CLI](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.1.0-rc.8/apps/cli/README.md)
* [DeepSeek Harness provider guide](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.1.0-rc.8/docs/user/guide/providers.md)

## Prerequisites

* Node.js and npm
* A CometAPI account with an active API key from the [dashboard](https://www.cometapi.com/console/token)
* A model ID from the [CometAPI Models page](/overview/models) for each API format you plan to use

## Understand the provider routes

The `api` value selects the wire format. The `baseURL` stops before the operation path that Harness appends.

| Provider ID          | `api` value          | `baseURL`                     | Request path           |
| -------------------- | -------------------- | ----------------------------- | ---------------------- |
| `cometapi-chat`      | `openai-completions` | `https://api.cometapi.com/v1` | `/v1/chat/completions` |
| `cometapi-responses` | `openai-responses`   | `https://api.cometapi.com/v1` | `/v1/responses`        |
| `cometapi-messages`  | `anthropic-messages` | `https://api.cometapi.com`    | `/v1/messages`         |

<Note>
  Replace each `your-model-id` value independently. Choose a model that accepts the API format of its provider entry.
</Note>

## Configure the providers

<Steps>
  <Step title="Confirm the tested Harness version">
    Confirm the pinned package version before configuring Harness:

    ```bash theme={null}
    npx @deepseek-ai/dsh@0.1.0-rc.8 --version
    ```

    The command should print `0.1.0-rc.8`.
  </Step>

  <Step title="Set your CometAPI API key">
    Store your key in `COMETAPI_KEY` before starting Harness:

    ```bash theme={null}
    read -rsp "CometAPI API key: " COMETAPI_KEY
    printf '\n'
    export COMETAPI_KEY
    ```

    Set the variable in every shell session that launches Harness. Do not commit API keys to version control.
  </Step>

  <Step title="Add the CometAPI providers">
    Create `$DSH_HOME/settings.yaml`. If the file already has an `llm-pi-ai` section, merge these provider entries into its existing `providers` map:

    ```yaml theme={null}
    llm-pi-ai:
      providers:
        cometapi-chat:
          displayName: CometAPI Chat Completions
          apiKeyEnv: COMETAPI_KEY
          api: openai-completions
          baseURL: https://api.cometapi.com/v1
          models:
            - id: your-model-id
        cometapi-responses:
          displayName: CometAPI Responses
          apiKeyEnv: COMETAPI_KEY
          api: openai-responses
          baseURL: https://api.cometapi.com/v1
          models:
            - id: your-model-id
        cometapi-messages:
          displayName: CometAPI Anthropic Messages
          apiKeyEnv: COMETAPI_KEY
          api: anthropic-messages
          baseURL: https://api.cometapi.com
          models:
            - id: your-model-id

    agent-default-model:
      provider: cometapi-responses
      model: your-model-id
    ```

    The example selects the Responses provider by default. Change `agent-default-model.provider` and `agent-default-model.model` to select another configured entry.

    If you prefer the Web UI, start it after exporting `COMETAPI_KEY`, then use its model settings to add or edit provider entries and select the default model:

    ```bash theme={null}
    npx @deepseek-ai/dsh@0.1.0-rc.8 web
    ```

    The default local address is `http://127.0.0.1:3080`. YAML remains the direct path for matching the route names and base URLs in this guide.
  </Step>

  <Step title="Verify a text turn">
    Run a one-shot headless task from the project directory you want Harness to use:

    ```bash theme={null}
    npx @deepseek-ai/dsh@0.1.0-rc.8 \
      --profile headless \
      "Reply exactly with: COMETAPI_DSH_OK"
    ```

    A successful run prints `COMETAPI_DSH_OK`. To check another provider, update `agent-default-model` and run the command again.
  </Step>

  <Step title="Verify file tool use">
    Create a temporary sentinel file, then ask Harness to read it with a file tool:

    ```bash theme={null}
    printf 'COMETAPI_DSH_TOOL_OK\n' > /tmp/cometapi-dsh-sentinel.txt
    npx @deepseek-ai/dsh@0.1.0-rc.8 \
      --profile headless \
      "Read /tmp/cometapi-dsh-sentinel.txt with a file tool, then reply with only its contents."
    ```

    Confirm that the final answer is `COMETAPI_DSH_TOOL_OK`. Run Harness only in a workspace where you accept its file, process, and network access.
  </Step>
</Steps>

## Optional route

Harness has one built-in provider route named `google`. The configuration below points that route at CometAPI, so it replaces the route's native Google endpoint instead of adding a second Google route.

Merge this entry into `llm-pi-ai.providers`, then select it in `agent-default-model`:

```yaml theme={null}
llm-pi-ai:
  providers:
    google:
      displayName: CometAPI Google generateContent
      apiKeyEnv: COMETAPI_KEY
      baseURL: https://api.cometapi.com/v1beta
      models:
        - id: your-model-id

agent-default-model:
  provider: google
  model: your-model-id
```

Do not add an `api` field to this entry. The built-in `google` route keeps its native Google protocol and sends streaming requests to `/v1beta/models/{model}:streamGenerateContent?alt=sse` with `x-goog-api-key` authentication.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Harness reports that the API key is missing">
    Confirm that `COMETAPI_KEY` is set in the same shell that launches Harness. Restart Harness after changing the environment variable.
  </Accordion>

  <Accordion title="Harness does not show the configured model">
    Confirm that `$DSH_HOME/settings.yaml` is valid YAML, the provider is under `llm-pi-ai.providers`, and the model is listed under that provider's `models`. The default `DSH_HOME` is `~/.dsh`.
  </Accordion>

  <Accordion title="Chat Completions or Responses uses the wrong path">
    Use `https://api.cometapi.com/v1` as `baseURL`. Do not append `/chat/completions` or `/responses`; Harness appends the operation path.
  </Accordion>

  <Accordion title="Anthropic Messages returns a path error">
    Use `https://api.cometapi.com` without `/v1` as the Messages `baseURL`. The Anthropic adapter appends `/v1/messages`.
  </Accordion>

  <Accordion title="Google generates a duplicated v1beta path">
    Use `https://api.cometapi.com/v1beta` exactly. Do not append a model path, and do not add an `api` field to the built-in `google` route.
  </Accordion>

  <Accordion title="A model works on one provider but not another">
    Model availability and accepted API formats can differ. Choose a model for each provider entry instead of assuming one model works across all four formats.
  </Accordion>

  <Accordion title="Configuration stops working after an upgrade">
    DeepSeek Harness is in Developer Preview. Return to `@deepseek-ai/dsh@0.1.0-rc.8`, then review upstream changes before adapting the configuration to another version.
  </Accordion>
</AccordionGroup>

## Related resources

* [CometAPI quick start](/overview/quick-start)
* [CometAPI Models page](/overview/models)
* [DeepSeek Harness repository](https://github.com/deepseek-ai/deepseek-harness)
* [DeepSeek Harness provider guide](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.1.0-rc.8/docs/user/guide/providers.md)

<script type="application/ld+json">
  {`
    {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "HowTo",
        "@id": "https://apidoc.cometapi.com/integrations/deepseek-harness#howto",
        "name": "Use DeepSeek Harness with CometAPI",
        "description": "Configure DeepSeek Harness 0.1.0-rc.8 to use CometAPI through Chat Completions, Responses, Anthropic Messages, or Google generateContent.",
        "step": [
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/deepseek-harness#step-1",
            "position": 1,
            "name": "Confirm the tested Harness version",
            "text": "Confirm the pinned DeepSeek Harness 0.1.0-rc.8 package version."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/deepseek-harness#step-2",
            "position": 2,
            "name": "Set your CometAPI API key",
            "text": "Store the CometAPI API key in COMETAPI_KEY before starting Harness."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/deepseek-harness#step-3",
            "position": 3,
            "name": "Add the CometAPI providers",
            "text": "Add the verified provider routes to the Harness settings.yaml file."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/deepseek-harness#step-4",
            "position": 4,
            "name": "Verify a text turn",
            "text": "Run a pinned headless task and confirm the expected text response."
          },
          {
            "@type": "HowToStep",
            "@id": "https://apidoc.cometapi.com/integrations/deepseek-harness#step-5",
            "position": 5,
            "name": "Verify file tool use",
            "text": "Ask Harness to read a sentinel file and confirm the exact final answer."
          }
        ]
      },
      {
        "@type": "BreadcrumbList",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "CometAPI Docs",
            "item": "https://apidoc.cometapi.com/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "Integrations",
            "item": "https://apidoc.cometapi.com/integrations"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "Use DeepSeek Harness with CometAPI",
            "item": "https://apidoc.cometapi.com/integrations/deepseek-harness"
          }
        ]
      }
    ]
    }
    `}
</script>
