What is the AI Gateway?
The AI Gateway is RegPilot’s intelligent proxy layer that sits between your application and AI providers (OpenAI, Anthropic, etc.). It automatically validates, monitors, and logs all AI interactions for compliance.
Key Benefits
Automatic Compliance
Every AI response is validated against EU AI Act requirements automatically
Cost Tracking
Monitor AI usage and costs across all models in a single dashboard
Risk Management
Detect and block high-risk content before it reaches users
Audit Trail
Complete logging of all AI interactions for regulatory compliance
How It Works
1
Your Application Sends Request
Your app sends an AI request to RegPilot Gateway instead of directly to OpenAI/Anthropic
2
RegPilot Validates & Routes
The Gateway:
- Validates your API key
- Checks compliance settings
- Routes to appropriate AI provider
- Applies Governor validation if enabled
3
AI Provider Responds
The AI model (GPT-4, Claude, etc.) processes the request and returns a response
4
Compliance Check & Logging
RegPilot:
- Validates response for compliance violations
- Logs the interaction
- Tracks usage and costs
- Returns sanitized response to your app
Features
Real-time Monitoring
Track all AI interactions in real-time:- Request/Response Logs: Complete audit trail
- Usage Statistics: Token counts and costs
- Performance Metrics: Latency and success rates
- Error Tracking: Failed requests and reasons
Cost Management
Understand and control AI spending:Unified Billing
Unified Billing
Single dashboard for all AI provider costs. Track spending across OpenAI, Anthropic, and custom models.
Budget Alerts
Budget Alerts
Set spending limits and receive alerts when approaching thresholds.
Cost Attribution
Cost Attribution
Tag requests by feature, user, or department for detailed cost analysis.
Governor Integration
Enable the Governor feature for advanced compliance:Supported AI Providers
- OpenAI
- Anthropic
- Custom Models
- GPT-4, GPT-4 Turbo
- GPT-3.5 Turbo
- DALL-E 3
- Whisper
- Text Embeddings
API Endpoints
The AI Gateway provides multiple endpoints for different use cases:| Endpoint | Purpose | Streaming |
|---|---|---|
/api/ai/chat | Chat completions | ✅ Yes |
/api/ai/chat-v2 | Enhanced chat with Governor | ✅ Yes |
/api/ai/complete | Text completions | ❌ No |
/api/ai/embeddings | Text embeddings | ❌ No |
Quick Start
1
Create API Key
Navigate to AI Gateway → Overview and create a new API key
2
Make Your First Request
3
View Analytics
Check your dashboard to see request logs, costs, and compliance scores
Advanced Configuration
Request Headers
Customize AI Gateway behavior with request headers:Response Headers
Every AI Gateway response includes compliance metadata:Compliance Features
Automatic Violation Detection
The Gateway automatically detects:- Personal Data Exposure: GDPR violations
- Discriminatory Content: EU AI Act bias requirements
- Financial Advice: Regulatory compliance
- Medical Information: Healthcare regulations
- Age-Inappropriate Content: Child safety laws
Audit Logging
Every request is logged with:- Request/response content
- Timestamp and duration
- User and session identifiers
- Compliance validation results
- Governor risk scores
Best Practices
Use Streaming for Better UX
Use Streaming for Better UX
Enable streaming for chat interfaces to show responses as they’re generated:
Implement Retry Logic
Implement Retry Logic
Handle transient failures with exponential backoff:
Monitor Performance
Monitor Performance
Track latency and error rates:
- Set up alerts for high error rates
- Monitor P95/P99 latency
- Track success rates per model
- Review cost trends weekly