Translation Service: Anthropic API format β OpenAI format β OpenRouter
Convert Anthropic's message format to OpenAI's chat completions format and route to OpenRouter for multi-model access.
Status: β
ACTIVE - All 6 models verified working
Documentation: docs/LXC_DEPLOYMENT.md
Quick Access:
# Health check
curl http://localhost:3000/health
# Test with Claude CLI
export ANTHROPIC_BASE_URL="http://localhost:3000"
claude --settings config/glm.json -p "Your query"Service Management (on Proxmox host):
# Restart service
pct exec <container-id> -- systemctl restart anthropic-bridge
# View logs
pct exec <container-id> -- journalctl -u anthropic-bridge -fStatus: β
Container works internally, docs/DOCKER_LXC_DEPLOYMENT.md
Deploy:
docker-compose up -dTest from inside container:
docker exec anthropic-bridge curl http://localhost:3000/healthStatus: β All 6 models verified working
Start:
./scripts/start-anthropic-bridge.shOr manually:
cd smart-router
export OPENROUTER_API_KEY="your-key-here"
node src/anthropic-bridge.jsAll models verified working:
- GLM 4.6 Exacto -
z-ai/glm-4.6:exacto - Deepseek Chat -
deepseek/deepseek-chat - Qwen 2.5 Coder 32B -
qwen/qwen-2.5-coder-32b-instruct - GPT-4o -
openai/gpt-4o - Claude Sonnet 4 -
anthropic/claude-sonnet-4 - Gemini 2.5 Pro -
google/gemini-2.5-pro-preview
smart-router/
βββ src/
β βββ anthropic-bridge.js # Main service (Anthropic to OpenAI translator)
βββ config/ # Claude CLI configuration files
β βββ glm.json # GLM 4.6 Exacto
β βββ deepseek-v3.1-terminus.json # Deepseek Chat
β βββ qwen3-coder-plus.json # Qwen 2.5 Coder 32B
β βββ gpt-5-pro.json # GPT-4o
β βββ claude-sonnet-4.5.json # Claude Sonnet 4
β βββ gemini-2.5-pro.json # Gemini 2.5 Pro
βββ scripts/
β βββ start-anthropic-bridge.sh # Native startup script
βββ docs/
β βββ LXC_DEPLOYMENT.md # LXC production deployment (RECOMMENDED)
β βββ DOCKER_LXC_DEPLOYMENT.md # Docker deployment guide
β βββ CLI_TESTING.md # Claude CLI testing guide
βββ .env # OpenRouter API key
βββ package.json
βββ README.md
Required:
OPENROUTER_API_KEY- Your OpenRouter API key from https://openrouter.ai/
Optional:
PORT- Server port (default: 3000)NODE_ENV- Environment (development/production)
Each model has a configuration file in config/ directory:
{
"env": {
"ANTHROPIC_BASE_URL": "http://localhost:3000",
"ANTHROPIC_MODEL": "z-ai/glm-4.6:exacto"
},
"model": "z-ai/glm-4.6:exacto"
}Usage:
# Use GLM 4.6
claude --settings config/glm.json -p "Your query"
# Use Deepseek
claude --settings config/deepseek-v3.1-terminus.json -p "Your query"
# Use Claude Sonnet 4
claude --settings config/claude-sonnet-4.5.json -p "Your query"βββββββββββββββ Anthropic ββββββββββββββββββββ OpenAI ββββββββββββββ
β Claude CLI ββββββββββββββββββββββΆβ anthropic-bridge ββββββββββββββββββββΆβ OpenRouter β
β β Format Request β (Translation) β Format Request β β
βββββββββββββββ ββββββββββββββββββββ ββββββββββββββ
β
βΌ
ββββββββββββββββ
β Model Router β
ββββββββββββββββ
β
βββββββββββββββββββββββββΌββββββββββββββββββββββββ
βΌ βΌ βΌ
βββββββ ββββββββββββ ββββββββββββ
β GLM β β Deepseek β β Claude β
βGPT-4β β Qwen β β Gemini β
βββββββ ββββββββββββ ββββββββββββ
# Real-time logs
pct exec <container-id> -- journalctl -u anthropic-bridge -f
# Last 50 lines
pct exec <container-id> -- journalctl -u anthropic-bridge -n 50
# Follow routing activity
pct exec <container-id> -- journalctl -u anthropic-bridge -f | grep -E 'Forwarding|Response'curl http://localhost:3000/healthExpected response:
{
"status": "healthy",
"service": "Smart Router",
"provider": "OpenRouter",
"mode": "anthropic-to-openai-translator"
}- API key stored in
.envfile (not committed to git) - Service runs in isolated container
- Unprivileged container (non-root user namespace)
- Internal network only (no external exposure by default)
MIT
Marco Del Pin - marco.delpin@gmail.com
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Status: β PRODUCTION READY - All 6 models operational Last Updated: 2025-11-06