DeepSeek Harness (DSH) Integration with CodeGateway: Custom Provider Setup

(Unofficial)

This guide is independently community-maintained. It is not affiliated with, endorsed by, or sponsored by the vendor of the third-party tool it covers. All third-party trademarks are the property of their respective owners.

Add one custom provider in DSH to reach Claude/Gemini/DeepSeek models via CodeGateway.

Prerequisites

  • Register at codegateway.dev — trial credit included after you bind a card (current amount shown on the signup/pricing page).

  • Create an API key in Dashboard → API Keys (starts with sk-cg-).

  • DSH reads env vars from ~/.dsh/.env, a project .env, or the process environment.

Step 1: Install DeepSeek Harness

bash
npx @deepseek-ai/dsh web

No Homebrew package yet; Node.js is required. The Web UI opens on a local port after startup.

Step 2: Add a custom model provider

In the Web UI, go to Settings → Models → Add a custom provider and fill in:

  • Provider ID: any lowercase id, e.g. cg.

  • Base URL: depends on the protocol (see below).

  • API protocol: must match the Base URL.

  • API key: your CodeGateway key (sk-cg- prefix).

  • Models: at least one model whose id matches CodeGateway's model list.

Equivalent config file (settings.yaml, hot-reloaded on the next request):

yaml
llm-pi-ai:
providers:
cg:
apiKeyEnv: CG_KEY # or directly apiKey: sk-cg-...
api: openai-completions
baseURL: https://api.codegateway.dev/v1
models:
- id: deepseek-v4-pro
contextWindow: 262144
compat:
supportsDeveloperRole: false
maxTokensField: max_tokens

Step 3: Verify and pick a model

After saving, select the new model (e.g. cg/deepseek-v4-pro) in DSH's model picker and send a short message:

  • A reply → success.

  • 401 → check the key and the variable pointed to by apiKeyEnv.

  • Model not found → compare models[].id with the model list.

The model then becomes the default for new sessions. You can also point the built-in llm-deepseek route at the gateway via DEEPSEEK_BASE_URL (OpenAI-compatible models only).

Which protocol should I use

DSH's API protocol supports three options, mapping to CodeGateway's two surfaces:

  • openai-completions: Base URL https://api.codegateway.dev/v1. Models: DeepSeek / Kimi / GLM / Qwen (e.g. deepseek-v4-pro, kimi-k2.7-code, glm-5.3).

  • anthropic-messages: Base URL https://api.codegateway.dev. Models: Claude or Gemini series (e.g. claude-sonnet-4-6, gemini-3.8-flash).

  • openai-responses: same Base URL as openai-completions (.../v1), for Response-protocol relay scenarios.

Note: GPT-series models (gpt-5.3-codex, etc.) are region-restricted upstream — some countries/regions get a 400.

FAQ

Q: Is there an install-free way to run it? npx @deepseek-ai/dsh web caches locally; the first run downloads dependencies, later runs are fast.

Q: Do I need to restart DSH after editing settings.yaml? No. The config is hot-reloaded on the next request.

Q: My model doesn't show up in the picker? Make sure the provider saved with at least one models entry; the picker groups by provider — expand the group.

Q: Can one key serve multiple models? Yes. The key is per-provider; register multiple models under one provider.

Q: Does DSH support Codex (OAuth) login? Not currently. Use a custom provider with an API key instead (this guide's approach).

References

Turn this doc into a real API call

Lacking an official key or facing overseas card payment issues? Create an sk-cg- key after signing up, point your base URL at CodeGateway, and keep your existing SDK or CLI unchanged. Pay per token; binding a card adds free credit.

Sign up free
Author:CodeGateway Team