clauda
v0.5.2
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
# Just run it — defaults to the botim endpoint
# (https://openapi-glb.botim.me/api/llm-gw). The first time, it prompts for a
# token (hidden), saves it, and launches. After that it launches directly.
clauda # interactive session on the default endpoint
clauda -p "explain this repo" # one-shot; extra args pass through to claudeOverride the default URL with CLAUDA_DEFAULT_URL if needed. For other
endpoints, create named profiles:
# 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 [claude args...] | Launch claude on the default endpoint (prompts for a token the first time) |
| 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-8Recognized 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 |
| CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS | Set to 1 to strip beta-only request fields (auto-enabled for botim.me profiles, whose gateway upstreams reject e.g. context_management) |
| 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 |
| CLAUDA_DEFAULT_URL | https://openapi-glb.botim.me/api/llm-gw | Endpoint used by bare clauda (stored in the default profile) |
| CLAUDA_DEFAULT_MODEL | claude-opus-4-8 | Default model written into the default profile on first run |
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
