Use your Claude Pro/Max subscription as a LibreChat endpoint — no API key billing.
LibreChat -> CLIProxyAPI (:8317) -> claude CLI (SDK) -> Anthropic
OpenAI-compatible CLAUDE_CODE_OAUTH_TOKEN
Run on any machine with a browser (one-time):
claude setup-token
# -> sk-ant-oat01-... <- shown ONCE, save it nowStore securely:
cat >> ~/.claude-auth.env << 'EOF'
CLAUDE_CODE_OAUTH_TOKEN=sk-ant-oat01-...
EOF
chmod 600 ~/.claude-auth.envToken is valid for 1 year. No refresh cron needed.
macOS:
brew install router-for-me/tap/cliproxyapiLinux / manual:
# Requires Node 18+
npm install -g cliproxyapiOn Uberspace (via augur):
augur proxy setup
# Installs cliproxyapi, creates config, registers servicemkdir -p ~/.cli-proxy-api
cat > ~/.cli-proxy-api/config.yaml << 'EOF'
port: 8317
remote-management:
allow-remote: false
secret-key: ""
auth-dir: "~/.cli-proxy-api"
auth:
providers: [] # empty = use OAuth token, not API key validation
debug: false
EOFsource ~/.claude-auth.env
cliproxyapi --config ~/.cli-proxy-api/config.yamlVerify:
curl http://localhost:8317/v1/models
# -> should list claude-sonnet-*, claude-opus-*, etc.As a systemd user service (~/.config/systemd/user/cliproxyapi.service):
[Unit]
Description=CLIProxyAPI — Claude subscription OpenAI endpoint
After=network.target
[Service]
EnvironmentFile=%h/.claude-auth.env
ExecStart=cliproxyapi --config %h/.cli-proxy-api/config.yaml
Restart=always
RestartSec=10
[Install]
WantedBy=default.targetsystemctl --user enable --now cliproxyapiOn Uberspace (systemd):
augur proxy start
# Uses ~/.config/systemd/user/cliproxyapi.serviceAlready preconfigured in librechat.yaml (commented out by default).
Uncomment the "Claude Max" endpoint section and restart:
augur yaml # edit librechat.yaml
augur restartOr manually add to librechat.yaml:
endpoints:
custom:
- name: "Claude Max"
apiKey: "dummy"
baseURL: "http://localhost:8317/v1"
models:
default:
- claude-sonnet-4-6
- claude-opus-4-6
- claude-haiku-4-5-20251001
fetch: false
titleConvo: true
titleModel: "claude-sonnet-4-6"
directEndpoint: true
summarize: falseEnsure .env has custom in ENDPOINTS:
ENDPOINTS=openAI,anthropic,customRestart LibreChat — "Claude Max" appears in the model selector.
Use claude-auth-daemon.sh --once in cron to check token health:
# crontab -e
*/30 * * * * ~/bin/claude-auth-daemon.sh --once >> ~/.claude-auth.log 2>&1
# Annual renewal reminder
0 9 1 */11 * curl -sd "Claude setup-token renewal due -- $(hostname)" https://ntfy.sh/your-topicOn Uberspace, the augur cron hook runs the check automatically every 30 minutes
when ~/.claude-auth.env exists.
augur proxy setup Install CLIProxyAPI, create config, register service
augur proxy start Start CLIProxyAPI service
augur proxy stop Stop CLIProxyAPI service
augur proxy status Show CLIProxyAPI service status
augur proxy test Test proxy endpoint (curl /v1/models)
augur proxy token Show token expiry info
| Feature | Status |
|---|---|
| Chat completions + streaming | Supported |
| Multi-turn conversation | Supported |
| Model selection | Supported |
temperature / top_p / max_tokens |
Ignored by CLI layer |
| 1M context window | Not available (OAuth restriction) |
| Token cost tracking in LibreChat | Not available (subscription, not per-token) |
| Multi-user LibreChat | Shared subscription limits apply |
Anthropic's terms are designed for individual interactive use. Using a subscription
via CLI wrapper for personal single-user self-hosted LibreChat is a grey area at
moderate scale. For business/production use, the commercial API (ANTHROPIC_API_KEY)
is the correct path.