One API. Any provider.
Keep your clients pointed at one stable OpenAI-compatible endpoint while you mix OpenAI, DeepSeek, and other upstreams behind it.
menshen is a lightweight gateway that puts auth, routing, failover, usage intelligence, and caching between your clients and any OpenAI or Anthropic compatible provider.
Everything in the path, nothing out of reach
Keep your clients pointed at one stable OpenAI-compatible endpoint while you mix OpenAI, DeepSeek, and other upstreams behind it.
Distribute requests by weight and retry network errors, 5xx, and rate limits against the next active provider automatically.
Audit requests, responses, and token usage in local SQLite. Stream usage is captured too, without sending your data to a third party.
Reuse matching non-stream responses locally, with configurable size and age limits to reduce latency and provider costs.
Keep real upstream credentials in a local TOML configuration. Clients only ever need the gateway token.
A small Go service with SQLite and embedded dashboard assets. Perfect for a laptop, homelab, or air-gapped environment.
How it works
Clients use the API they already know. menshen handles provider credentials, model overrides, routing, retries, logging, and response reuse while keeping the control plane on your machine.
SDK · curl · OpenClaw
Auth injection · weighted routing · failover · cache · model override
OpenAI · Claude · DeepSeek · any compatible API
Request logs · token usage · cached responses
Built-in visibility
The embedded dashboard turns local logs into a clear view of traffic, trends, models, cache hits, latency, and token usage. No account. No external analytics. No CDN calls.
Quick start
Run the gateway locally, keep your keys in a TOML file, and point your existing OpenAI or Anthropic client at one stable endpoint.
curl -fsSL https://jiacai2050.github.io/menshen/install.sh | shOr build from source: clone the repo, then run make build.menshen -gen-config > ~/.config/menshen/config.tomlAdd your provider API key.menshen -config ~/.config/menshen/config.tomlStarts the proxy on port 8080.base_url = "http://localhost:8080"Use any OpenAI or Anthropic SDK.