π Enterprise-Grade AI API Proxy Management Platform
A sophisticated, production-ready proxy management system for AI APIs with comprehensive monitoring, analytics, and multi-platform integration.
π Getting Started β’ π Documentation β’ π Features β’ π οΈ API Reference
- β¨ Features
- ποΈ Architecture
- π Getting Started
- π οΈ Installation
- βοΈ Configuration
- π Dashboard
- π§ API Reference
- π Multi-Platform Support
- π Monitoring & Analytics
- π Security
- π€ Contributing
- π License
π API Key Management
π’ Account Integration
|
π Advanced Analytics
π‘οΈ Enterprise Security
|
- Professional Dashboard - Real-time metrics, system health, and KPI monitoring
- Advanced Statistics - Multi-dimensional analytics with interactive visualizations
- Request Logging - Comprehensive audit trails with filtering and search capabilities
- Cost Analysis - Financial tracking with detailed flow analysis and forecasting
- User Management - Secure authentication with role-based permissions
graph TB
subgraph "Frontend (React 19)"
A[Admin Dashboard] --> B[API Key Manager]
A --> C[Analytics Dashboard]
A --> D[Account Manager]
A --> E[Request Logger]
end
subgraph "Backend (.NET 9 API)"
F[Authentication Service] --> G[Proxy Engine]
G --> H[Rate Limiter]
H --> I[Cost Calculator]
I --> J[Request Logger]
end
subgraph "AI Platforms"
K[Claude/Anthropic]
L[OpenAI]
M[Google Gemini]
end
subgraph "Data Layer"
N[SQLite Database]
O[Memory Cache]
end
A --> F
G --> K
G --> L
G --> M
J --> N
I --> O
Component | Technology | Version |
---|---|---|
Backend | .NET Core | 9.0 |
Frontend | React + TypeScript | 19.x + 5.6 |
Database | SQLite + EF Core | Latest |
UI Framework | Tailwind CSS + Shadcn/ui | 3.x |
Build Tool | Vite | 6.x |
Authentication | JWT | - |
-
Clone the repository
git clone https://github.com/AIDotNet/ClaudeCodeProxy.git cd ClaudeCodeProxy
-
Start the backend
cd src/ClaudeCodeProxy.Host dotnet restore dotnet run
-
Start the frontend
cd web npm install npm run dev
-
Access the application
- Frontend: http://localhost:5173
- Backend API: http://localhost:5000
- Swagger UI: http://localhost:5000/scalar/v1
# Build and run with Docker Compose
docker-compose up -d
-
Backend Setup
cd src/ClaudeCodeProxy.Host dotnet publish -c Release -o ./publish cd publish dotnet ClaudeCodeProxy.Host.dll
-
Frontend Build
cd web npm run build # Serve the dist folder with your preferred web server
Create appsettings.json
in the Host project:
{
"ThorPlatformOptions": {
"DatabaseConnectionString": "Data Source=claudecodeproxy.db",
"JwtSettings": {
"SecretKey": "your-secret-key-here",
"Issuer": "ClaudeCodeProxy",
"Audience": "ClaudeCodeProxy-Users",
"ExpirationHours": 24
}
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
Update web/src/config/api.ts
:
export const API_CONFIG = {
baseURL: process.env.VITE_API_URL || 'http://localhost:5000',
timeout: 30000,
retries: 3
};
Key Features:
- Live system performance indicators
- Cost tracking with trend analysis
- Token usage analytics (input/output/cache)
- API key status monitoring
- System uptime and health metrics
- Usage Heat Maps - Visual representation of API usage patterns
- Cost Flow Analysis - Detailed financial attribution and forecasting
- Performance Trends - Historical data with predictive insights
- User Profiling - Behavioral analysis and usage optimization
All API endpoints require JWT authentication:
# Login to get JWT token
curl -X POST "http://localhost:5000/api/auth/login" \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"password"}'
# Use token in subsequent requests
curl -H "Authorization: Bearer YOUR_JWT_TOKEN" \
"http://localhost:5000/api/apikeys"
Method | Endpoint | Description |
---|---|---|
GET |
/api/apikeys |
List all API keys |
POST |
/api/apikeys |
Create new API key |
PUT |
/api/apikeys/{id} |
Update API key |
DELETE |
/api/apikeys/{id} |
Delete API key |
GET |
/api/accounts |
List service accounts |
GET |
/api/dashboard |
Dashboard statistics |
GET |
/api/logs |
Request logs |
# Claude API Proxy
curl -X POST "http://localhost:5000/v1/messages" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"claude-3-sonnet","messages":[...]}'
# OpenAI API Proxy
curl -X POST "http://localhost:5000/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4","messages":[...]}'
Claude OAuth Integration |
OpenAI Full API Support |
Gemini Project-based Auth |
- Intelligent Routing - Automatic platform selection based on request parameters
- Model Mapping - Cross-platform model compatibility management
- Cost Calculation - Platform-specific pricing models and usage tracking
- Error Handling - Platform-specific error codes and retry logic
- Request/Response Tracking - Complete API transaction logging
- Token Usage Monitoring - Detailed input/output token calculation
- Cost Attribution - Real-time cost calculation and allocation
- Performance Metrics - Response time, throughput, and error rates
- Real-time status updates and system health monitoring
- Usage threshold alerts with automatic notifications
- Error tracking with immediate notification of system issues
- Capacity planning with proactive scaling recommendations
- π JWT Authentication - Secure token-based authentication with configurable expiration
- π Encrypted Storage - API keys encrypted at rest and in transit
- π¦ Rate Limiting - Comprehensive throttling to prevent abuse
- π IP Restrictions - Client IP whitelisting for enhanced access control
- π Audit Logging - Complete audit trails for compliance and security monitoring
{
"SecurityRecommendations": {
"JwtSecretKey": "Use a strong, randomly generated secret key (256+ bits)",
"DatabaseEncryption": "Enable SQLite encryption in production environments",
"TLS": "Always use HTTPS in production deployments",
"RateLimiting": "Configure appropriate rate limits based on your usage patterns",
"Monitoring": "Enable comprehensive logging and monitoring for security events"
}
}
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
- Backend: Follow .NET coding conventions
- Frontend: ESLint + Prettier configuration included
- Commit Messages: Use Conventional Commits
This project is licensed under the MIT License - see the LICENSE file for details.
- Anthropic for Claude API
- OpenAI for GPT APIs
- Google for Gemini API
- Shadcn/ui for UI components
- Tailwind CSS for styling
β Star this repo if you find it helpful!
π Report Bug β’ β¨ Request Feature β’ π¬ Discussions
π English | δΈζζζ‘£
β Star this repo if you find it helpful!
π Report Bug β’ β¨ Request Feature β’ π¬ Discussions
Made with β€οΈ by the ClaudeCodeProxy Team