$ show QuantumNous/new-api
New API is a full-stack AI gateway/proxy service that provides a unified interface for multiple AI model providers (OpenAI, Claude, Gemini, etc.). It features user authentication and authorization, API key/token management with quota tracking and billing, administrative dashboard for configuration and monitoring, intelligent routing between providers, format conversion between different AI APIs, payment integrations, webhook support, and a playground for testing models. The backend is built with Go using the Gin web framework and GORM ORM, while the frontend is a React/TypeScript application built with Bun. The system implements a modular architecture with clear separation of concerns across controller, service, model, and relay layers.
The LLM identified 4 files worth highlighting for reuse:
Implements sophisticated Redis-based rate limiting with Lua scripts for atomic operations, including fallback to in-memory implementation. Demonstrates non-obvious skill in distributed systems rate limiting with proper error handling and configuration options. Could be extracted as a standalone rate limiting library for other Go applications.
Provides comprehensive Server-Side Request Forgery (SSRF) protection with configurable allow/deny lists, CIDR matching, and proper error handling. Self-contained security component that could be reused in any Go application making HTTP requests. Shows attention to detail in network security implementation with thorough test coverage.
Implements a complete expression language for quota calculations including parser, compiler, and evaluator. Self-contained DSL implementation that could be extracted for use in other billing/quota systems. Demonstrates non-obvious skill in language design and implementation with proper error handling and extensibility.
Provides hierarchical configuration management with type safety, runtime reloading capability, and JSON-serializable settings with database persistence. Implements a pattern for managing complex application configuration that could be adapted for other applications. Shows non-obvious skill in designing a flexible yet type-safe configuration system.