- Custom models: add a model by id (protocol, reasoning, images, context window, max output) next to the built-in catalog. - Gateway context caps: read per-model context_window from each key's /v1/models and narrow the catalog model to the tightest window (free DeepSeek group: 200K, 32K output) so DSH compacts before the cap. - Free daily keys: show each key's expiry, flag the renewal window and link to https://www.geek2api.com/free-ds; the no-usable-key error points there too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6.1 KiB
DSH Geek2API
简体中文 · English
Use Geek2API API keys in DeepSeek Harness: pick models, rotate keys, see balances.
Installing it adds a Geek2API group to the model picker. No YAML and no provider setup.
Features
| Capability | What you get |
|---|---|
| Built-in model route | A Geek2API picker group with Claude, GPT, DeepSeek, Grok, Gemini, GLM, and Kimi |
| Multi-endpoint failover | The hk / hk2 / hk3 / hk4 / www entry points are measured and the fastest is used; one that cannot be reached is skipped and the retry goes to the next |
| Several keys in order | An exhausted, disabled, or rejected key hands over to the next usable key |
| Per-key model choice | Each key lists the models it can use (✓ / ✕); a turn whose model the active key cannot use runs on a key that can |
| Balances at a glance | Remaining balance, today's spend, subscription window or key quota per key; keys of one account share a wallet and count once; the composer shows the active key's remaining balance |
| Two Claude runtimes | HTTP by default (DSH's own tools and permissions), or the local official Claude Code CLI |
| Optional web search | DSH's web_search can search through Geek2API (Claude or GPT backend) |
| Credentials stay local | Keys live only in the DSH credentials file; the browser sees labels, state, and balances |
Install
- In the desktop app, open Plugins → Add plugin, enter
dsh-geek2apiwith the official registry (within 24 hours of a release the bundled pnpm refuses it by name; use the mirror address then), or enterhttps://hk.geek2api.com/dsh/dsh-geek2api.tgz(Geek2API's mirror of the GitHub release, reachable from mainland networks; synced every 10 minutes) orhttps://github.com/CoderKuo/dsh-geek2api/releases/latest/download/dsh-geek2api.tgz, and install. No restart is needed for a first install. You can also download the.tgzfrom Releases and install it from a local path. - Open Settings → Geek2API and paste an API key (create one under API Keys in the Geek2API console). Add more keys for other groups; the plugin picks the right one per model.
- Pick a model under the
Geek2APIgroup.
Daily use
- Models per key. Under each key, ✓ / ◐ / ✕ per model family, read from that key's
/v1/models(free). When no stored key can use the selected model the turn says so instead of retrying. - Balance. Wallet (shared by an account's keys, counted once), the tightest subscription window, or the key's own quota and 5h/1d/7d windows, plus today's spend. Refresh skips the 60-second cache.
- Endpoints. The Endpoints card shows each entry point's latency and state. Hosts are re-measured every 10 minutes; a host that fails in transit (DNS, TLS, timeout, reset) is skipped for 2 minutes and the failed step retries on the next one. You can re-measure or edit the list (one per line; empty restores the defaults).
- Claude runtime. In the Claude Code CLI card: HTTP (default, recommended) or the local Claude Code CLI (one-click install; needs Node.js 18+, and Git for Windows on Windows). The
claude_codedelegation tool works either way. - Web search. Settings → Geek2API → Web search: leave DSH alone (default), search through Geek2API for Geek2API models only, or always. Backend: Claude (
claude-haiku-4-5-20251001, default, about 10K tokens per search) or GPT (gpt-6.1-sol, about 20–30K). DeepSeek groups drop the server search tool, so they are not offered.
Keys rotate on 余额不足,请充值, a lapsed subscription, Invalid API key, API key is disabled, API key 已过期, or API Key 所属分组已删除. Rate limits (429) and upstream 5xx do not rotate keys; they are retried.
Models
| Model | Protocol | Efforts |
|---|---|---|
claude-opus-5-5, claude-sonnet-5-5 |
Messages | low / medium / high / xhigh / max |
claude-haiku-4-5-20251001 |
Messages | low / medium / high |
gpt-6.1-sol, gpt-6-astra, gpt-6-luna |
Responses | low / medium / high / xhigh / max |
deepseek-v4.1-flash, deepseek-v4-pro |
Chat Completions | off; low / high / max |
grok-4.6, grok-4.7 |
Responses | low / medium / high / xhigh |
gemini-3.8-flash, glm-5.3, kimi-k3 |
Chat Completions | none |
Whether a key can use a model depends on its group; trust the ✓ / ✕ in settings.
Custom models. A model Geek2API serves but the table lacks can be added by id under Settings → Geek2API → Visible models → Custom models: the model id (as the key's /v1/models lists it; not a built-in id), an optional display name, the protocol (Chat Completions by default; Messages for Claude, Responses for GPT and Grok), whether it reasons (then off / low / medium / high are offered), whether it takes images, and optionally its context window and max output (default 128000 / 32000). It appears in the picker at once, with the same key rotation and endpoint failover, and a "Custom" column under each key shows whether that key reaches it. Up to 32. A session using a removed custom model fails with an unknown model instead of switching to another one.
Update and uninstall
The version card in Settings → Geek2API checks the Geek2API mirror first and GitHub when no mirror answers; update from there, then fully quit and reopen the desktop app. Before uninstalling, set web search back to "leave DSH alone" if you used it, then uninstall from the Plugins page and restart.
Security
Requests go to Geek2API's endpoints. Keys are stored in ~/.dsh/.credentials.yaml (owner-only) and never reach settings documents, logs, transcripts, or the browser. Balance and model-list reads are host-side, time-bounded, and refuse redirects. See SECURITY.md.
Development
pnpm install --frozen-lockfile
pnpm run check
node scripts/smoke.mjs keys.json # {"label": "sk-…"}; prints labels only
Derived from dsh-packycode-api (MIT). License: MIT.