claude-remap
v1.12.0
Published
Local API proxy for third-party model relay stations. Zero deps, pure Node.js.
Maintainers
Readme
claude-remap
Local API proxy with model name remapping. Zero dependencies, pure Node.js.
Point your AI tools at localhost, use custom model names — the proxy rewrites them to the real upstream model and rewrites responses back. Supports both OpenAI (Authorization: Bearer) and Claude (x-api-key) auth formats, auto-detected per request.
Install & Run
npx claude-remap \
-t https://your-relay.com \
-k sk-your-api-key \
-m my-model:real-model-nameWhat It Does
Your Tool claude-remap Relay Station
───────── ──────────── ─────────────
model: "my-gpt4" → rewrites to "deepseek-chat" → upstream API
← rewrites back to "my-gpt4" ← response- Proxies all requests from
localhostto the target relay station - Replaces the
modelfield in request JSON with the mapped real name - Rewrites the
modelfield in responses (including SSE streams) back to your alias - Injects your API key automatically — clients don't need a real key
- Auto-detects Claude vs OpenAI auth format
Options
| Flag | Env Var | Default | Description |
|------|---------|---------|-------------|
| -t, --target <url> | PROXY_TARGET | — | Relay station base URL (required) |
| -k, --key <key> | PROXY_KEY | — | API key, injected into every request |
| -p, --port <port> | PROXY_PORT | 9960 | Local port |
| -m, --map <a:b> | — | — | Model alias mapping, repeatable |
| -v, --verbose | — | — | Log upstream details |
Examples
Single model remap
npx claude-remap \
-t https://api.relay.com \
-k sk-xxxx \
-m gpt4:deepseek-chatMultiple models
npx claude-remap \
-t https://api.relay.com \
-k sk-xxxx \
-m claude-sonnet:deepseek-v4-pro \
-m claude-opus:deepseek-reasoner \
-m gpt4:qwen-maxUse with Claude Code
- Start the proxy:
npx claude-remap \
-t https://your-relay.com \
-k sk-real-key \
-m claude-deepseek-v4-pro:deepseek-v4-proConfigure Claude Code to use
http://localhost:9960as API base URL, with any placeholder API key.Select model
claude-deepseek-v4-pro— it hitsdeepseek-v4-proon the relay station.
Env vars (no key in shell history)
export PROXY_TARGET=https://api.relay.com
export PROXY_KEY=sk-xxxx
npx claude-remap -m my-model:real-modelRequirements
- Node.js >= 18
License
MIT
