mirror of
https://github.com/tiennm99/claude-central-gateway.git
synced 2026-04-17 13:20:56 +00:00
- Add main proxy endpoint (api/v1/messages.js) - Add token validation via GATEWAY_TOKEN - Add model mapping via MODEL_MAP env var - Support full SSE streaming in Anthropic format - Add package.json with openai dependency - Add vercel.json for routing config - Update README with Quick Start guide - Consolidate memory to .claude/memory/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2.3 KiB
2.3 KiB
Claude Central Gateway
A proxy for Claude Code that routes requests to your preferred third-party API provider. Easily hosted on Vercel, Netlify, and similar platforms.
Where to Find Cheap LLM Providers?
Check out this repo for a list of affordable LLM providers compatible with this gateway.
Philosophy
Minimal, simple, deploy anywhere.
Quick Start
1. Deploy to Vercel
Or manually:
git clone https://github.com/tiennm99/claude-central-gateway
cd claude-central-gateway
vercel
2. Set Environment Variables
In Vercel dashboard, set these environment variables:
| Variable | Description | Example |
|---|---|---|
GATEWAY_TOKEN |
Shared token for authentication | my-secret-token |
OPENAI_API_KEY |
Your OpenAI API key | sk-... |
MODEL_MAP |
Model name mapping | claude-sonnet-4-20250514:gpt-4o |
3. Configure Claude Code
export ANTHROPIC_BASE_URL=https://your-gateway.vercel.app
export ANTHROPIC_AUTH_TOKEN=my-secret-token
claude
Environment Variables
| Variable | Required | Description |
|---|---|---|
GATEWAY_TOKEN |
Yes | Token users must provide in ANTHROPIC_AUTH_TOKEN |
OPENAI_API_KEY |
Yes | OpenAI API key |
MODEL_MAP |
No | Comma-separated model mappings (format: claude:openai) |
Why This Project?
Why not use a local proxy, like Claude Code Router?
Local proxies only work on a single machine. This project serves multiple machines simultaneously.
Why not use LiteLLM?
LiteLLM requires a dedicated VPS, consumes more resources, and costs more to deploy.
Why no advanced features like routing or GUI management?
Built for personal use. Simplicity over features.
Not Suitable For
- Single-machine localhost proxy → Highly recommend Claude Code Router
- Enterprise/Team usage with GUI management → Use LiteLLM
- Advanced routing, load balancing, rate limiting → Use LiteLLM or similar