clauda
v0.2.0
Published
Launch Claude Code with per-profile API endpoints (base URL + API key), without touching your subscription login
Maintainers
Readme
clauda
Launch Claude Code against different API endpoints — without touching your subscription login.
- Plain
claude→ keeps using your logged-in subscription account, as always. clauda <profile>→ launches Claude Code with that profile'sANTHROPIC_BASE_URL+ API key (token-billed), e.g. the official API, a corporate gateway, or any Anthropic-compatible provider (Kimi, GLM, …).
Each profile gets its own isolated CLAUDE_CONFIG_DIR, so your ~/.claude subscription login is never mixed with API-key sessions, and you never get the "API key vs subscription" conflict prompt.
Install
npm install -g claudaRequires macOS or Linux with bash, and the claude CLI installed.
Quick start
# Create a profile (the API key prompt is hidden; flags are all optional)
clauda add botim --url https://openapi-glb.botim.me/api/llm-gw --auth token
# Run Claude Code on that endpoint
clauda botim # interactive session
clauda botim -p "explain this repo" # one-shot; extra args pass through to claudeCommands
| Command | What it does |
|---|---|
| clauda <profile> [claude args...] | Launch claude with this profile's endpoint |
| clauda add <name> [--url URL] [--key KEY] [--auth token\|apikey] [--model M] [--fast-model M] | Create a profile |
| clauda list | List profiles |
| clauda show <name> | Show a profile (key masked) |
| clauda edit <name> | Open the profile file in $EDITOR |
| clauda rm <name> | Delete a profile |
| clauda env <name> | Print export lines, for eval "$(clauda env x)" |
Profiles
Profiles are plain KEY=VALUE files in ~/.config/clauda/profiles/<name>.env (created with mode 600), so you can also edit them by hand:
ANTHROPIC_BASE_URL=https://openapi-glb.botim.me/api/llm-gw
ANTHROPIC_AUTH_TOKEN=sk-...
ANTHROPIC_MODEL=claude-opus-4-7Recognized keys:
| Key | Meaning |
|---|---|
| ANTHROPIC_BASE_URL | Required. The endpoint base URL |
| ANTHROPIC_AUTH_TOKEN | Key sent as Authorization: Bearer ... (most proxies/providers) |
| ANTHROPIC_API_KEY | Key sent as x-api-key: ... (official Anthropic API) |
| ANTHROPIC_MODEL | Optional default model |
| ANTHROPIC_SMALL_FAST_MODEL | Optional background/fast model |
| API_TIMEOUT_MS | Optional request timeout |
| anything else | Exported as-is to the claude process |
Environment variables
| Variable | Default | Meaning |
|---|---|---|
| CLAUDA_HOME | ~/.config/clauda | Where profiles and per-profile claude configs live |
| CLAUDA_CLAUDE_BIN | claude | Path to the claude binary to launch |
How it works
clauda <profile> does exactly this, then execs claude:
- Scrubs any inherited
ANTHROPIC_API_KEY/ANTHROPIC_AUTH_TOKEN/ANTHROPIC_BASE_URLfrom the environment. - Exports every
KEY=VALUEfrom the profile file. - Sets
CLAUDE_CONFIG_DIR=~/.config/clauda/claude-config/<profile>so the session is fully isolated from your~/.claudesubscription login.
Nothing is changed globally; close the session and plain claude is back to your subscription.
License
MIT
