ClewdR is a Rust proxy for Claude (Claude.ai, Claude Code) and Google Gemini (AI Studio, Vertex AI).
It keeps resource usage low, serves OpenAI-style endpoints, and ships with a small React admin UI for managing cookies, keys, and settings.
- Works with Claude web, Claude Code, Gemini AI Studio, and Vertex AI.
- Single static binary for Linux, macOS, Windows, and Android; Docker image available.
- Web dashboard shows live status, exposes cookie/key editors, and supports hot config reloads.
- Drops into existing OpenAI-compatible clients while keeping native Claude/Gemini formats.
- Optional SQLite/Postgres/MySQL persistence; default
clewdr.tomlfile mode still available. - Typical production footprint:
<10 MBRAM,<1 sstartup,~15 MBbinary.
| Service | Endpoint |
|---|---|
| Claude native | http://127.0.0.1:8484/v1/messages |
| Claude OpenAI compatible | http://127.0.0.1:8484/v1/chat/completions |
| Claude Code | http://127.0.0.1:8484/code/v1/messages |
| Gemini native | http://127.0.0.1:8484/v1/v1beta/generateContent |
| Gemini OpenAI compatible | http://127.0.0.1:8484/gemini/chat/completions |
| Vertex AI proxy | http://127.0.0.1:8484/v1/vertex/v1beta/ |
Streaming responses work on every endpoint.
- Download the latest release for your platform from GitHub.
Linux/macOS example:curl -L -o clewdr.tar.gz https://github.com/Xerxes-2/clewdr/releases/latest/download/clewdr-linux-x64.tar.gz tar -xzf clewdr.tar.gz && cd clewdr-linux-x64 chmod +x clewdr
- Run the binary:
./clewdr
- Open
http://127.0.0.1:8484and enter the admin password shown in the console (or container logs if using Docker).
Dashboardshows health, connected clients, and rate-limit status.Claudetab stores browser cookies; pastecookie: valuepairs and save.Geminitab accepts AI Studio keys and optional Vertex OAuth credentials.Settingslets you rotate the admin password, set upstream proxies, and reload config without restarting.
If you forget the password, delete clewdr.toml and start the binary again. Docker users can mount a persistent folder for that file.
- Export your Claude.ai cookies (e.g., via browser devtools).
- Paste them into the Claude tab; ClewdR tracks their status automatically.
- Optionally set an outbound proxy or fingerprint overrides if Claude blocks your region.
- Add AI Studio API keys in the Gemini tab.
- For Vertex AI, provide OAuth client ID/secret and project info.
- Select default models or override them per request via the API.
SillyTavern:
{
"api_url": "http://127.0.0.1:8484/v1/chat/completions",
"api_key": "password-from-console",
"model": "claude-3-sonnet-20240229"
}Continue (VS Code):
{
"models": [
{
"title": "Claude via ClewdR",
"provider": "openai",
"model": "claude-3-sonnet-20240229",
"apiBase": "http://127.0.0.1:8484/v1/",
"apiKey": "password-from-console"
}
]
}Cursor:
{
"openaiApiBase": "http://127.0.0.1:8484/v1/",
"openaiApiKey": "password-from-console"
}ClewdR stores everything in clewdr.toml by default. To use a database instead, build with the matching feature flag and set persistence.mode.
cargo build --release --no-default-features --features "embed-resource,xdg,db-sqlite"Available feature flags: db-sqlite, db-postgres, db-mysql (each pulls in the core db feature).
Custom Docker builds should pass the same flags during cargo build.
clewdr.toml example:
[persistence]
mode = "postgres" # sqlite | postgres | mysql
database_url = "postgres://user:pass@db:5432/clewdr"-
SQLite: optionally set
sqlite_path = "/var/lib/clewdr/clewdr.db". ClewdR expands it tosqlite:///...and creates the parent folder if possible. -
Postgres/MySQL:
database_urlis required. -
Environment variables use Figment’s double underscore style, for example:
export CLEWDR_PERSISTENCE__MODE=sqlite export CLEWDR_PERSISTENCE__SQLITE_PATH=/var/lib/clewdr/clewdr.db export CLEWDR_PERSISTENCE__DATABASE_URL="postgres://user:pass@db/clewdr"
Operational notes:
- On first run ClewdR applies SeaORM migrations for
config,cookies,keys, andwastedtables. GET /api/storage/statusreports database health; writes fail if storage is unavailable.- Verify the running binary exposes DB support (
clewdr -V) when switching from file mode.
- Wiki: https://github.com/Xerxes-2/clewdr/wiki
- Database persistence guide (中文):
wiki/database.md
- Database persistence guide (中文):