Prerequisites
Register at codegateway.dev — $2 trial credit included.
Create an API key in Dashboard → API Keys (starts with sk-cg-).
Loading…
Add one custom provider in DSH to reach Claude/Gemini/DeepSeek models via CodeGateway.
Register at codegateway.dev — $2 trial credit included.
Create an API key in Dashboard → API Keys (starts with sk-cg-).
~/.dsh/.env.envnpx @deepseek-ai/dsh webNo Homebrew package yet; Node.js is required. The Web UI opens on a local port after startup.
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):
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_tokensAfter 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).
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.
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).