OpenAI & Anthropic compatible. Local-first.

Your AI traffic,
under your control.

menshen is a lightweight gateway that puts auth, routing, failover, usage intelligence, and caching between your clients and any OpenAI or Anthropic compatible provider.

◈

One API. Any provider.

Keep your clients pointed at one stable OpenAI-compatible endpoint while you mix OpenAI, DeepSeek, and other upstreams behind it.

↯

Failover that just works.

Distribute requests by weight and retry network errors, 5xx, and rate limits against the next active provider automatically.

⌁

See what you spend.

Audit requests, responses, and token usage in local SQLite. Stream usage is captured too, without sending your data to a third party.

▣

Cache the repeat work.

Reuse matching non-stream responses locally, with configurable size and age limits to reduce latency and provider costs.

⌘

Bring your own keys.

Keep real upstream credentials in a local TOML configuration. Clients only ever need the gateway token.

○

One binary. Zero fuss.

A small Go service with SQLite and embedded dashboard assets. Perfect for a laptop, homelab, or air-gapped environment.

A calm layer between your apps and the cloud.

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.

↗

YOUR CLIENTS

SDK · curl · OpenClaw

OpenAI / Anthropic
✦

MENSHEN

Auth injection · weighted routing · failover · cache · model override

forward / retry
◎

PROVIDERS

OpenAI · Claude · DeepSeek · any compatible API

audit + usage
▣

LOCAL SQLITE

Request logs · token usage · cached responses

Know every request. Keep every secret.

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.

Usage trendsModel breakdownAudit logsOffline-ready
门神 / OverviewLast 7 days · ● live
TOTAL REQUESTS1,284
CACHE HIT RATE38.2%
TOTAL TOKENS2.4M
gpt-4o842 requests   1.8M tokens
deepseek-chat319 requests   494K tokens
claude-3-5-sonnet123 requests   156K tokens

Up and running in four steps.

Run the gateway locally, keep your keys in a TOML file, and point your existing OpenAI or Anthropic client at one stable endpoint.

  1. Installcurl -fsSL https://jiacai2050.github.io/menshen/install.sh | shOr build from source: clone the repo, then run make build.
  2. Configuremenshen -gen-config > ~/.config/menshen/config.tomlAdd your provider API key.
  3. Runmenshen -config ~/.config/menshen/config.tomlStarts the proxy on port 8080.
  4. Connectbase_url = "http://localhost:8080"Use any OpenAI or Anthropic SDK.