Status: [UNTESTED] Endpoints found: http://localhost:3003/api/openai/proxy http://localhost:3003/api/split-key/split Source: https://github.com/mtgsoftworks/SafeAPI-Bridge # SafeAPI-Bridge **Secure API Gateway for AI Providers** – Protect your API keys, manage quotas, and monitor usage across OpenAI, Gemini, Claude, and 15+ AI providers. [![Node.js](https://img.shields.io/badge/Node.js-18%2B-green)](https://nodejs.org) [![License](https://img.shields.io/badge/License-MIT-blue)](LICENSE) --- ## 🚀 Features - **Multi-Provider Support** – OpenAI, Gemini, Claude, Groq, Mistral, Cohere, and more. - **Split Key (BYOK)** – Secure "Bring Your Own Key" architecture that keeps API keys safe. - **Rate Limiting** – Global and per-provider request limits. - **Retry & Circuit Breaker** – Automatic retries with exponential backoff and fault tolerance. - **Usage Tracking** – Per-user quotas, token counting, and cost estimation. - **Prometheus Metrics** – Production-grade observability. - **Admin Dashboard** – Real-time monitoring and management. --- ## 📦 Quick Start ### Prerequisites - Node.js 18+ - PostgreSQL (Railway, Supabase, etc.) - Redis (optional, for Bull queue) ### Installation ```bash # Clone git clone https://github.com/your-org/SafeAPI-Bridge.git cd SafeAPI-Bridge # Install dependencies npm install # Configure environment cp .env.example .env # Edit .env with your settings # Setup database npx prisma generate npx prisma migrate deploy # Start server npm start ``` --- ## ⚙️ Configuration All configuration is done via environment variables (`.env` file): ### Core Settings ```ini # Server PORT=3003 NODE_ENV=production # Database (PostgreSQL) DATABASE_URL=postgresql://user:password@host:5432/dbname # Authentication JWT_SECRET=your-secret-key JWT_EXPIRES_IN=24h ADMIN_API_KEY=your-admin-key ``` ### API Provider Keys (Optional – Server Key Mode) ```ini OPENAI_API_KEY=sk-... GEMINI_API_KEY=AIza... CLAUDE_API_KEY=sk-ant-... GROQ_API_KEY=gsk_... ``` ### Rate Limiting ```ini # Global RATE_LIMIT_WINDOW_MS=3600000 RATE_LIMIT_MAX_REQUESTS=100 # Per-Provider (requests per minute) RATE_LIMIT_OPENAI_MA