DeepSeek Harness
Connect DeepSeek Harness (dsh) to OpenGateway with a custom OpenAI Chat Completions provider in a dedicated profile, leaving shipped profiles untouched.
npx @deepseek-ai/dsh --profile opengateway profile and saves it as the opengateway-deepseek-harness skill.Apply a one-off patch#
The --patch option adds an overlay for one launch; it does not write the
settings into the selected profile. The YAML file remains in your project.
Set OPENGATEWAY_API_KEY in your shell first, and keep the secret out of the
patch file.
cat > opengateway.patch.yml <<'YAML'- id: llm-pi-aiconfig:providers:opengateway:displayName: OpenGatewayapiKeyEnv: OPENGATEWAY_API_KEYapi: openai-completionsbaseURL: "https://apis.opengateway.ai/v1"models:- id: deepseek/deepseek-v4.1-flash-ultrafastname: DeepSeek V4.1 Flash UltraFast- id: z-ai/glm-5.3-flash-ultrafastname: GLM-5.3 Flash UltraFast- id: agent-default-modelconfig:provider: opengatewaymodel: deepseek/deepseek-v4.1-flash-ultrafastYAMLnpx @deepseek-ai/dsh --profile headless --patch ./opengateway.patch.yml "Reply with OK"
Set it up by hand#
1. Get an API key#
OpenGateway → API Keys → Create Key.
Export the key in the shell that will start DeepSeek Harness; add it to
~/.zshrc or ~/.bashrc only if you want it available in new shells:
export OPENGATEWAY_API_KEY="YOUR_OPENGATEWAY_API_KEY"
2. Create a profile#
Use a separate profile so your other profiles remain unchanged. The command
below creates opengateway from the shipped headless template and prints
the composed configuration without starting the app:
npx @deepseek-ai/dsh --profile opengateway --from-default-profile headless --dump-config
--from-default-profile replaces an existing custom profile. If
$DSH_HOME/profiles/opengateway already exists, do not run that command;
inspect and preserve the existing profile instead. DSH_HOME defaults to
~/.dsh. To use the Web UI, create the profile from web rather than
headless.
3. Add the provider#
Edit ~/.dsh/profiles/opengateway/cordis.patch.yml (or
$DSH_HOME/profiles/opengateway/cordis.patch.yml when DSH_HOME is set):
- id: llm-pi-aiconfig:providers:opengateway:displayName: OpenGatewayapiKeyEnv: OPENGATEWAY_API_KEYapi: openai-completionsbaseURL: "https://apis.opengateway.ai/v1"models:- id: deepseek/deepseek-v4.1-flash-ultrafastname: DeepSeek V4.1 Flash UltraFast- id: z-ai/glm-5.3-flash-ultrafastname: GLM-5.3 Flash UltraFast- id: agent-default-modelconfig:provider: opengatewaymodel: deepseek/deepseek-v4.1-flash-ultrafast
api: openai-completions selects OpenAI Chat Completions, and the base URL
ends in /v1. apiKeyEnv names the environment variable; it never contains
the key itself. The models list defines the models offered for this
provider, and agent-default-model selects the default. Both IDs above are
OpenGateway UltraFast models. Each has a per-key limit on concurrent
in-flight requests; excess requests return 429 with
concurrency_limit_exceeded and Retry-After. Reduce parallel requests or
wait before retrying, or contact support to request a higher limit. For
either model, requests with more than 256K input tokens have double the
input-token price for the whole request; cache reads and output tokens are
not surcharged. See UltraFast and /models
for the current rules and pricing.
A cordis.patch.yml entry targeting llm-pi-ai replaces that row's entire
config. If the profile already has other llm-pi-ai providers or settings,
preserve them under config when adding opengateway.
4. Verify#
First inspect the resolved configuration without making a model request:
dsh --profile opengateway --dump-config
If the dsh command is not on your path, use
npx @deepseek-ai/dsh --profile opengateway --dump-config instead. Confirm
that the provider route and default model match the YAML. For a profile
created from headless, then run:
npx @deepseek-ai/dsh --profile opengateway "Reply with OK"
For a profile created from web, start it with
npx @deepseek-ai/dsh --profile opengateway and send a test prompt in the
UI. A response confirms the connection; usage appears on the
dashboard.
To undo the setup, remove only the OpenGateway provider and default-model rows you added. Remove the shell export only if another setup does not use that key.