mirror of
https://github.com/tiennm99/claude-central-gateway.git
synced 2026-04-17 13:20:56 +00:00
- Replace Vercel-specific handler with Hono framework - Add Cloudflare Workers support via wrangler.toml - Restructure project: src/index.js, src/routes/messages.js - Update README with Cloudflare deployment instructions - Save framework decision to memory Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.7 KiB
1.7 KiB
name, description, type
| name | description | type |
|---|---|---|
| Implementation Plan | Architecture and design decisions for Claude Central Gateway | project |
Claude Central Gateway - Implementation
Why: A lightweight proxy for Claude Code that routes requests to third-party API providers, deployable to Vercel without needing a VPS.
Architecture
Claude Code → Gateway (Vercel) → OpenAI API
↓
Validate token
Transform request
Stream response
Key Decisions
- Language: Node.js with JavaScript (no TypeScript)
- Framework: Hono (multi-platform: Vercel, Cloudflare, Deno, Bun)
- Deployment: Vercel serverless functions OR Cloudflare Workers
- Providers: OpenAI first (via official SDK), others in TODO
- Config: Environment variables only (no database)
- Auth: Single shared token (user's
ANTHROPIC_AUTH_TOKENmust matchGATEWAY_TOKEN) - Streaming: Full streaming support
- Model mapping: Via
MODEL_MAPenv var (format:claude:openai,claude2:openai2)
Environment Variables
| Variable | Description |
|---|---|
GATEWAY_TOKEN |
Shared token for authentication |
OPENAI_API_KEY |
OpenAI API key |
MODEL_MAP |
Model name mapping (optional) |
File Structure
src/
├── index.js - Hono app entry point
├── routes/
│ └── messages.js - /v1/messages proxy handler
api/
└── index.js - Vercel adapter
package.json - Dependencies (hono, openai)
vercel.json - Vercel config
wrangler.toml - Cloudflare Workers config