{"id":31582297,"url":"https://github.com/chenxingqiang/claude-code-open","last_synced_at":"2026-05-17T15:38:58.379Z","repository":{"id":309013693,"uuid":"1034893103","full_name":"chenxingqiang/claude-code-open","owner":"chenxingqiang","description":"🚀 Claude CLI jailbreak using Moonshot API to bypass organization restrictions. Complete tutorial from installation to setup.","archived":false,"fork":false,"pushed_at":"2025-08-09T13:44:56.000Z","size":1724,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-12T07:46:01.120Z","etag":null,"topics":["claude","claude-code"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenxingqiang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-09T07:44:39.000Z","updated_at":"2025-08-25T11:56:22.000Z","dependencies_parsed_at":"2025-08-09T11:47:48.509Z","dependency_job_id":null,"html_url":"https://github.com/chenxingqiang/claude-code-open","commit_stats":null,"previous_names":["chenxingqiang/claude-code-jailbreak"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chenxingqiang/claude-code-open","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxingqiang%2Fclaude-code-open","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxingqiang%2Fclaude-code-open/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxingqiang%2Fclaude-code-open/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxingqiang%2Fclaude-code-open/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenxingqiang","download_url":"https://codeload.github.com/chenxingqiang/claude-code-open/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenxingqiang%2Fclaude-code-open/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278532354,"owners_count":26002346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude","claude-code"],"created_at":"2025-10-05T22:54:45.131Z","updated_at":"2025-10-05T22:54:47.998Z","avatar_url":"https://github.com/chenxingqiang.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 Claude LLM Gateway - Intelligent Multi-LLM API Gateway\n\n**Intelligent Multi-Model API Gateway - Unified Interface for 36+ Large Language Models**\n\n[![NPM Version](https://img.shields.io/npm/v/claude-llm-gateway)](https://www.npmjs.com/package/claude-llm-gateway)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Node.js](https://img.shields.io/badge/Node.js-16%2B-green)](https://nodejs.org/)\n\nClaude LLM Gateway is an intelligent API gateway that provides a unified multi-model LLM interface for Claude Code and other applications. It features intelligent model selection, cost optimization, load balancing, and failover capabilities.\n\n![Claude LLM Gateway Dashboard](https://raw.githubusercontent.com/chenxingqiang/claude-code-jailbreak/main/asset/dashboard.png)\n\n## ✨ Key Features\n\n- 🧠 **Intelligent Model Selection** - Auto-select optimal models based on task types\n- 🌍 **36+ Model Support** - OpenAI, Anthropic, Google, Meta, DeepSeek, and more\n- 🔄 **Bilingual Interface** - Complete Chinese/English internationalization\n- 💰 **Cost Optimization** - Smart routing to reduce API call costs\n- 📊 **Real-time Monitoring** - Web interface for all provider status monitoring\n- 🛡️ **Failover Protection** - Automatic switching to available backup models\n- 🔐 **Secure Gateway** - API key management and access control\n\n---\n\n## 📋 Table of Contents\n\n1. [🚀 Quick Start](#-quick-start)\n2. [📦 Installation](#-installation)\n3. [⚙️ Configuration](#-configuration)\n4. [🌐 Web Interface](#-web-interface)\n5. [🛠️ CLI Commands](#-cli-commands)\n6. [🔧 API Usage](#-api-usage)\n7. [🌍 Supported Models](#-supported-models)\n8. [📊 Intelligent Selection](#-intelligent-selection)\n9. [🔐 Security Configuration](#-security-configuration)\n10. [📝 Troubleshooting](#-troubleshooting)\n\n---\n\n## 🚀 Quick Start\n\n### System Requirements\n\n- **Node.js** v16+ - [Download here](https://nodejs.org/)\n- **npm** v7+ (comes with Node.js)\n- **Supported OS**: macOS, Linux, Windows\n\n### One-Click Installation\n\n```bash\n# Install globally via NPM\nnpm install -g claude-llm-gateway\n\n# Start immediately\nnpx claude-llm-gateway start --port 8765\n```\n\n🎉 **Done!** Open your browser and visit http://localhost:8765\n\n---\n\n## 📦 Installation\n\n### Method 1: Global Installation (Recommended)\n```bash\n# Install globally\nnpm install -g claude-llm-gateway\n\n# Start service\nclaude-llm-gateway start --port 8765\n\n# Run in background\nclaude-llm-gateway start --port 8765 --daemon\n```\n\n### Method 2: Local Project Installation\n```bash\n# Add to project dependencies\nnpm install claude-llm-gateway\n\n# Run with npx\nnpx claude-llm-gateway start --port 8765\n```\n\n### Method 3: Build from Source\n```bash\n# Clone repository\ngit clone https://github.com/chenxingqiang/claude-code-jailbreak.git\ncd claude-code-jailbreak/claude-llm-gateway\n\n# Install dependencies\nnpm install\n\n# Start development mode\nnpm run dev\n```\n\n## ⚙️ Configuration\n\n### Environment Variable Setup\n\nCreate a `.env` file or set environment variables:\n\n```bash\n# OpenAI\nOPENAI_API_KEY=sk-your-openai-key\n\n# Anthropic Claude\nANTHROPIC_API_KEY=sk-ant-your-anthropic-key\n\n# Google Gemini\nGOOGLE_API_KEY=your-google-api-key\n\n# DeepSeek (Recommended, large free quota)\nDEEPSEEK_API_KEY=sk-your-deepseek-key\n\n# Other optional configurations\nGROQ_API_KEY=gsk_your-groq-key\nMISTRAL_API_KEY=your-mistral-key\nMOONSHOT_API_KEY=sk-your-moonshot-key\n```\n\n### Quick Configuration Template\n\n```bash\n# Copy environment variable template\ncp env.example .env\n\n# Edit configuration file\nnano .env\n```\n\n**🔒 Security Tips**: \n- Never commit API keys to Git repositories\n- Use environment variables for sensitive information\n- Rotate API keys regularly\n\n---\n\n## 🌐 Web Interface\n\nAfter starting the service, you can access the management interface in two ways:\n\n### 🚀 Method 1: Integrated Web Interface (Default)\n```bash\nclaude-llm-gateway start --port 8765\n# Visit: http://localhost:8765\n```\n\n### 🌟 Method 2: Dedicated Web Server (Recommended)\n```bash\n# Start Gateway API service\nclaude-llm-gateway start --port 8765 --daemon\n\n# Start dedicated Web UI server  \ncd claude-llm-gateway \u0026\u0026 npm run web\n# Visit: http://localhost:9000\n\n# Or start both services together\nnpm run both\n```\n\n**🎯 Benefits of Method 2:**\n- **Better Performance**: Web UI and API separated\n- **Independent Scaling**: Scale web and API separately  \n- **Enhanced Security**: API and UI can run on different networks\n- **Development Friendly**: Hot reload for UI development\n\n### Interface Overview\n\nThe Claude LLM Gateway features a comprehensive web management interface with multiple functional tabs:\n\n#### 📊 Main Dashboard\n![Claude LLM Gateway Dashboard](https://raw.githubusercontent.com/chenxingqiang/claude-code-jailbreak/main/asset/dashboard.png)\n\nThe main dashboard provides real-time status overview with provider health monitoring and system statistics.\n\n#### 🔝 Top Status Bar\n- **Language Toggle**: One-click Chinese/English switching\n- **Refresh Status**: Manually refresh all provider statuses\n- **Last Updated**: Display data update timestamp\n\n#### 📊 Status Overview\n- **Healthy Providers**: Number of currently available models (shown as 2 in the image)\n- **Total Providers**: Total supported provider count (36)\n- **Available Models**: Total number of available models (78)\n- **Total Requests**: Request statistics\n\n#### 📝 Main Tabs\n\n**1. Provider Management** (as shown in image)\n- View real-time status of all LLM providers\n- Green toggle indicates enabled, red dot indicates unhealthy\n- Display request count, response time, cost information for each provider\n- Supported model lists (e.g., OpenAI's gpt-4, gpt-3.5-turbo, etc.)\n\n**2. Configuration** \n![Configuration Interface](https://raw.githubusercontent.com/chenxingqiang/claude-code-jailbreak/main/asset/configs.png)\n\n- Environment variable configuration with secure API key management\n- Real-time gateway settings adjustment\n- Provider-specific configuration options\n\n**3. API Endpoints**\n![API Endpoints](https://raw.githubusercontent.com/chenxingqiang/claude-code-jailbreak/main/asset/api-endpoints.png)\n\n- Complete API documentation with live examples\n- Claude-compatible endpoints with usage instructions\n- Token management API references\n- Health check and provider status interfaces\n\n**4. Intelligent Selection**\n![Model Selection Interface](https://raw.githubusercontent.com/chenxingqiang/claude-code-jailbreak/main/asset/modelsection.png)\n\n- Comprehensive model capability matrix with detailed statistics\n- Performance analytics and optimization insights\n- Task-based intelligent selection strategies\n- Real-time model comparison and recommendations\n\n**5. Real-time Logs**\n![Real-time Logs](https://raw.githubusercontent.com/chenxingqiang/claude-code-jailbreak/main/asset/realtime-logs.png)\n\n- Live system activity monitoring with auto-scroll\n- Detailed request/response logging\n- Provider health status updates\n- System diagnostic information\n\n#### 🎛️ Provider Card Operations\nEach provider card contains:\n- **Status Indicator**: Healthy/unhealthy status\n- **Enable Toggle**: One-click enable/disable provider\n- **Test Button**: Test provider connection\n- **Configure Button**: Quick jump to configuration page\n- **Error Messages**: Display specific error information (e.g., \"API key not configured\")\n\n---\n\n## 🛠️ CLI Commands\n\n### Basic Commands\n\n```bash\n# Start service\nclaude-llm-gateway start [options]\n\n# Run in background (daemon mode)\nclaude-llm-gateway start --daemon\n\n# Stop service\nclaude-llm-gateway stop\n\n# Check status\nclaude-llm-gateway status\n\n# Show help\nclaude-llm-gateway --help\n```\n\n### Web Server Commands\n\n```bash\n# Start dedicated web server (port 9000)\ncd claude-llm-gateway \u0026\u0026 npm run web\n\n# Start web server in development mode\nnpm run web:dev\n\n# Start both API gateway and web server\nnpm run both\n```\n\n### Startup Options\n\n```bash\n# Specify port (default: 8765)\nclaude-llm-gateway start --port 3000\n\n# Specify host (default: localhost)\nclaude-llm-gateway start --host 0.0.0.0\n\n# Run in background (daemon mode)\nclaude-llm-gateway start --daemon\n\n# Combined usage\nclaude-llm-gateway start --port 8765 --host 0.0.0.0 --daemon\n```\n\n### Status Management\n\n```bash\n# View detailed status\nclaude-llm-gateway status\n\n# Check all provider statuses\ncurl http://localhost:8765/providers\n\n# Health check\ncurl http://localhost:8765/health\n```\n\n---\n\n## 🔧 API Usage\n\n### Claude-Compatible Interface\n\nClaude LLM Gateway provides fully compatible Claude API interfaces:\n\n```bash\n# Claude Messages API\ncurl -X POST http://localhost:8765/v1/messages \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-api-key: your-api-key\" \\\n  -d '{\n    \"model\": \"claude-3-sonnet-20240229\",\n    \"max_tokens\": 1024,\n    \"messages\": [\n      {\n        \"role\": \"user\", \n        \"content\": \"Hello, world!\"\n      }\n    ]\n  }'\n```\n\n### OpenAI-Compatible Interface\n\nAlso supports OpenAI ChatGPT interface format:\n\n```bash\n# OpenAI Chat Completions API\ncurl -X POST http://localhost:8765/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer your-api-key\" \\\n  -d '{\n    \"model\": \"gpt-4\",\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Hello, world!\"\n      }\n    ]\n  }'\n```\n\n### Intelligent Routing\n\nWhen no model is specified, the gateway automatically selects the optimal model:\n\n```bash\ncurl -X POST http://localhost:8765/v1/messages \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"max_tokens\": 1024,\n    \"messages\": [\n      {\n        \"role\": \"user\",\n        \"content\": \"Write a Python function to calculate Fibonacci numbers\"\n      }\n    ]\n  }'\n```\n\n### Node.js SDK Usage\n\n```javascript\nconst { ClaudeLLMGateway } = require('claude-llm-gateway');\n\n// Create gateway instance\nconst gateway = new ClaudeLLMGateway();\n\n// Start service\nawait gateway.start(8765);\n\n// Use built-in client\nconst response = await gateway.chat({\n  messages: [\n    { role: 'user', content: 'Hello!' }\n  ]\n});\n\nconsole.log(response.content);\n```\n\n---\n\n## 🌍 Supported Models\n\n### OpenAI Models\n- **GPT-4o** (gpt-4o) - Latest multimodal model\n- **GPT-4 Turbo** (gpt-4-turbo) - High-performance version\n- **GPT-4** (gpt-4) - Classic version\n- **GPT-4o Mini** (gpt-4o-mini) - Lightweight version\n- **GPT-3.5 Turbo** (gpt-3.5-turbo) - Fast response\n\n### Anthropic Models  \n- **Claude 3 Opus** (claude-3-opus) - Strongest reasoning capabilities\n- **Claude 3.5 Sonnet** (claude-3.5-sonnet) - Balanced performance\n- **Claude 3 Sonnet** (claude-3-sonnet) - Standard version\n- **Claude 3 Haiku** (claude-3-haiku) - Fast response\n\n### Google Models\n- **Gemini Ultra** (gemini-ultra) - Flagship model\n- **Gemini 1.5 Pro** (gemini-1.5-pro) - Long context\n- **Gemini Pro** (gemini-pro) - Standard version\n\n### Meta Models\n- **Llama 3.1 405B** (llama-3.1-405b) - Ultra-large model\n- **Llama 3.1 70B** (llama-3.1-70b) - High performance\n- **Llama 3.1 8B** (llama-3.1-8b) - Lightweight\n\n### Chinese-Optimized Models\n- **DeepSeek V3** (deepseek-v3) - Chinese programming\n- **DeepSeek Chat** (deepseek-chat) - Chinese conversation\n- **DeepSeek Coder** (deepseek-coder) - Code generation\n- **Qianwen Max** (qianwen-max) - Alibaba's large model\n- **GLM-4** (zhipu-glm-4) - Zhipu AI\n- **Moonshot V1** (moonshot-v1) - Dark Side of the Moon\n\n### Other Models\n- **Mistral Large** (mistral-large) - European AI\n- **Groq Models** - Ultra-fast inference\n- **Cohere Command R+** - Enterprise-grade\n- **Grok-1** (grok-1) - xAI humor model\n\n**Total**: 30+ model providers, 78+ available models\n\n---\n\n## 📊 Intelligent Selection\n\n### Task Type Detection\n\nThe gateway can automatically detect task types and select optimal models:\n\n#### 🔧 Programming Tasks\n```\nInput: \"Write a Python function to calculate prime numbers\"\nRecommended: DeepSeek Coder, GPT-4, Claude 3.5 Sonnet\nReason: Strong code generation capabilities, accurate syntax\n```\n\n#### 📝 Creative Tasks  \n```\nInput: \"Write an article about AI\"\nRecommended: Claude 3 Opus, GPT-4, Gemini Pro\nReason: Strong creative abilities, natural writing style\n```\n\n#### 🔍 Analysis Tasks\n```\nInput: \"Analyze the trends in this data report\"\nRecommended: Claude 3 Opus, GPT-4 Turbo, Gemini Ultra  \nReason: Strong logical reasoning, deep analysis\n```\n\n#### 💬 Conversation Tasks\n```\nInput: \"Hello, please introduce yourself\"\nRecommended: GPT-3.5 Turbo, Claude 3 Haiku, DeepSeek Chat\nReason: Fast response, low cost, natural conversation\n```\n\n### Cost Optimization Strategies\n\n- **Intelligent Downgrading**: Automatically use lower-cost models for simple tasks\n- **Parallel Requests**: Send requests to multiple providers simultaneously, choose fastest response\n- **Failover**: Automatically switch to backup models when primary models are unavailable\n- **Load Balancing**: Distribute requests based on provider response time and success rate\n\n## 🔐 Security Configuration\n\n### API Key Management\n\n```bash\n# Recommended: Use environment variables\nexport OPENAI_API_KEY=\"sk-your-key\"\n\n# Avoid: Hard-coding in code\n# const apiKey = \"sk-your-key\"  ❌\n```\n\n### Access Control\n\n```bash\n# Restrict access sources\nclaude-llm-gateway start --host 127.0.0.1  # Local access only\n\n# Production environment\nclaude-llm-gateway start --host 0.0.0.0    # Allow external access\n```\n\n### Security Measures\n\n- ✅ **CORS Configuration**: Prevent cross-origin attacks\n- ✅ **Rate Limiting**: Prevent API abuse  \n- ✅ **Helmet Security Headers**: Enhanced security\n- ✅ **Input Validation**: Prevent injection attacks\n- ✅ **Error Handling**: No sensitive information leakage\n\n---\n\n## 📝 Troubleshooting\n\n### Common Issues\n\n**Q: Port already in use error on startup**\n```bash\n# Check port usage\nlsof -i :8765\n\n# Use different port\nclaude-llm-gateway start --port 8766\n```\n\n**Q: Invalid API key error**\n```bash\n# Check environment variables\necho $OPENAI_API_KEY\n\n# Reset key\nexport OPENAI_API_KEY=\"sk-your-new-key\"\n```\n\n**Q: Cannot connect to a provider**\n```bash\n# Check network connection\ncurl -I https://api.openai.com\n\n# View detailed errors\nclaude-llm-gateway start --verbose\n```\n\n**Q: Intelligent selection not working**\n```bash\n# View model capability configuration\ncurl http://localhost:8765/model-stats\n\n# Check provider status\ncurl http://localhost:8765/providers\n```\n\n### Debug Mode\n\n```bash\n# Enable detailed logging\nexport LOG_LEVEL=debug\nclaude-llm-gateway start\n\n# View real-time logs\ntail -f logs/gateway.log\n```\n\n### Performance Optimization\n\n```bash\n# Increase concurrent connections\nexport MAX_CONNECTIONS=100\n\n# Enable caching\nexport ENABLE_CACHE=true\n\n# Set timeout\nexport REQUEST_TIMEOUT=30000\n```\n\n---\n\n## 🤝 Contributing\n\nWelcome to contribute code! Please follow these steps:\n\n1. **Fork the repository** \n2. **Create feature branch**: `git checkout -b feature/amazing-feature`\n3. **Commit changes**: `git commit -m 'Add amazing feature'`\n4. **Push branch**: `git push origin feature/amazing-feature`\n5. **Create Pull Request**\n\n### Development Environment\n\n```bash\n# Clone repository\ngit clone https://github.com/chenxingqiang/claude-code-jailbreak.git\ncd claude-code-jailbreak/claude-llm-gateway\n\n# Install dependencies\nnpm install\n\n# Run tests\nnpm test\n\n# Start development mode\nnpm run dev\n```\n\n---\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE)\n\n---\n\n## 🌟 Star History\n\nIf this project helps you, please give us a ⭐!\n\n[![Star History Chart](https://api.star-history.com/svg?repos=chenxingqiang/claude-code-jailbreak\u0026type=Date)](https://star-history.com/#chenxingqiang/claude-code-jailbreak\u0026Date)\n\n---\n\n## 📞 Support \u0026 Contact\n\n- 📁 **GitHub**: [claude-code-jailbreak](https://github.com/chenxingqiang/claude-code-jailbreak)\n- 📦 **NPM**: [claude-llm-gateway](https://www.npmjs.com/package/claude-llm-gateway)\n- 🐛 **Issues**: [GitHub Issues](https://github.com/chenxingqiang/claude-code-jailbreak/issues)\n- 💬 **Discussions**: [GitHub Discussions](https://github.com/chenxingqiang/claude-code-jailbreak/discussions)\n\n---\n\n**🎯 Making AI model selection simple and intelligent!**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenxingqiang%2Fclaude-code-open","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenxingqiang%2Fclaude-code-open","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenxingqiang%2Fclaude-code-open/lists"}