Yee-h/dsh-zen-proxy

dsh plugin: in-process proxy that injects official OpenCode Zen client headers,

An in-process, OpenAI-compatible proxy that injects the official OpenCode Zen client identity headers on upstream requests, enabling Zen free models in dsh without the 429 FreeUsageLimitError. The README explains that dsh's LLM adapters always send their own attribution User-Agent and filter any configured user-agent out, so no dsh configuration can make the gateway see the official client; the proxy closes that gap with a tiny local server that rewrites the identity headers (User-Agent, x-opencode-client, x-opencode-project, plus per-request x-opencode-session / x-opencode-request) before forwarding to https://opencode.ai/zen/v1. The Authorization header and request body pass through unchanged and SSE responses are relayed as-is. The README's smoke table records that the gateway validates the User-Agent content, not just presence of the x-opencode-* headers.

Coding & Development ★ 2 updated 2026-08-14 — untested
View on GitHub ↗

Install

dsh plugin --profile web add "https://github.com/Yee-h/dsh-zen-proxy.git"

README Install section quoted verbatim (a PowerShell block); the README's local-checkout alternative is dsh plugin --profile web add "file:C:/path/to/dsh-zen-proxy". Configuration is two edits the README documents: add a plugin row to $DSH_HOME/profiles/<profile>/cordis.patch.yml (id: zen-proxy, name: 'dsh-zen-proxy', config host / port / upstreamHost / upstreamBasePath) and point the opencode provider's baseURL in $DSH_HOME/settings.yaml at http://127.0.0.1:4097/v1, keeping the sk-zen-* key in $DSH_HOME/.credentials.yaml or the environment variable named by apiKeyEnv. Then restart dsh.

Compatibility

In-process proxy: it listens on 127.0.0.1:4097 for as long as the profile runs and closes automatically on shutdown — no external process or startup script. The README's notes state the free-tier quota still applies (shared per IP + client fingerprint, community reports ~200 requests/day) and is managed by OpenCode, so header injection restores the official-client tier but cannot create quota; occasional 429s can still happen when the server is overloaded, and recharging does not unlock free models. Only /v1/chat/completions and GET /v1/models are proxied.

Details

Recent updates

The README documents behavior, a smoke-test table, a configuration reference and limitations rather than a release table; no version is published.

FAQ

Does this create free quota?
No — the README states headers only restore the official-client tier; the free allowance is still shared per IP and client fingerprint and is managed dynamically by OpenCode.
Are the x-opencode headers enough on their own?
No. The README's smoke table shows x-opencode-* alone still returns 429; the official User-Agent must also be present, because the gateway validates its content.
Does it run a separate process?
No — the README says the proxy lives inside the dsh process, starts with the profile and closes on shutdown, with no startup scripts.

Alternatives

030611/dsh-context-provenance · 030611/qiushi-dsh-evidence-audit · 0x3fffff/dsh-desktop-launcher

More plugins in Coding & Development

Browse more in Coding & Development

Guides for Coding & Development plugins