Global universal API connector with smart routing, transforms, budgets, and privacy.
Project description
ApiBridge Pro
Enterprise-grade Universal API Gateway with smart routing, PII protection, observability, and budget control.
One endpoint, any provider โ with multi-provider routing, schema unification, budgets, and advanced security.
โจ Features
Core Features
- YAML Connectors: Define auth, allowed paths, rate limits, retries, and caching in a simple YAML configuration
- Multi-Provider Routing: Fastest healthy provider with automatic failover
- JMESPath Transforms: Unify responses across different API providers
- Budget Guardrails: Track API costs with Redis or in-memory fallback
- Schema-Drift Sentinel: Validate responses against Pydantic models
- Record/Replay Mode: Record responses for development and CI testing
Advanced Features โญ NEW
- ๐ PII Firewall: Automatic detection and protection of sensitive data with redact/tokenize/encrypt/hash options
- ๐ OAuth2 Auto-Refresh: Automatic client_credentials token management per provider
- ๐ Observability: Prometheus metrics + OpenTelemetry distributed tracing
- ๐ Admin Dashboard: Beautiful real-time dashboard for monitoring budgets, health, and cache statistics
๐ Quick Start
Run locally
# Set your API keys as environment variables
export OPENWEATHER_KEY=YOUR_KEY
export WEATHERAPI_KEY=YOUR_KEY
export GITHUB_TOKEN=ghp_xxx
export SLACK_BOT_TOKEN=xoxb-xxx
# Optional: Redis for budgets (falls back to memory)
export REDIS_URL=redis://localhost:6379/0
# Optional: Enable OpenTelemetry tracing
export OTEL_ENABLED=true
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
# Optional: Set PII encryption key (auto-generated if not set)
export PII_ENCRYPTION_KEY=your-secret-key-here
# Install dependencies
pip install -r requirements.txt
# Run the server
uvicorn app.main:app --reload --port 8000
Try it
Health check:
curl http://127.0.0.1:8000/health
Admin Dashboard (NEW!):
http://127.0.0.1:8000/admin
Beautiful real-time dashboard showing:
- System overview
- Budget tracking with visual indicators
- Provider health status
- Rate limiting status
- Cache statistics
Prometheus Metrics (NEW!):
curl http://127.0.0.1:8000/metrics
Weather (unified response from multiple providers):
# OpenWeatherMap or WeatherAPI (automatically routes to fastest healthy provider)
curl "http://127.0.0.1:8000/proxy/weather_unified/weather?q=Bogota"
# or
curl "http://127.0.0.1:8000/proxy/weather_unified/current.json?q=Bogota"
GitHub user:
curl http://127.0.0.1:8000/proxy/github/user
Slack:
curl -X POST "http://127.0.0.1:8000/proxy/slack/chat.postMessage" \
-H "Content-Type: application/json" \
-d '{"channel": "general", "text": "Hello from ApiBridge!"}'
Docker
docker build -t apibridge-pro .
docker run -p 8000:8000 \
-e OPENWEATHER_KEY=YOUR_KEY \
-e WEATHERAPI_KEY=YOUR_KEY \
-e GITHUB_TOKEN=ghp_xxx \
apibridge-pro
Record/Replay Mode
Perfect for development and CI/CD testing:
# Record mode - captures API responses
export APIBRIDGE_MODE=record
uvicorn app.main:app --reload --port 8000
# Make requests... responses are recorded in-memory
# Replay mode - serves recorded responses without hitting real APIs
export APIBRIDGE_MODE=replay
uvicorn app.main:app --reload --port 8000
๐ Configuration
Edit connectors.yaml to add or modify API connectors. Each connector supports:
Basic Configuration
base_urlorproviders[]for multi-provider setupsallow_paths: Regex patterns for allowed endpointsrate_limit: Token bucket configurationcache_ttl_seconds: Response caching durationtransforms.response.jmes: JMESPath expression for response transformationbudget: Monthly USD limits with configurable actionsresponse_model: Pydantic model name for schema validation
Authentication Options
api_key_header: API key in headerapi_key_query: API key in query parameterbearer: Static bearer tokenoauth2_client_credentials: Auto-refreshing OAuth2 tokens (NEW!)
PII Protection (NEW!)
pii_protection:
enabled: true
auto_scan: true # Auto-detect PII patterns
action: redact # redact | tokenize | encrypt | hash
field_rules: # Or specify per-field rules
email: encrypt
ssn: redact
phone: tokenize
address: hash
OAuth2 Example
auth:
type: oauth2_client_credentials
token_url: https://auth.example.com/oauth/token
client_id: ${OAUTH_CLIENT_ID}
client_secret: ${OAUTH_CLIENT_SECRET}
scope: "read write"
See connectors_advanced.yaml for comprehensive examples.
Architecture
โโโโโโโโโโโโโโโ
โ Client โ
โโโโโโโโฌโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ApiBridge Gateway โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Rate Limiting & Path Check โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Cache Layer (GET requests) โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Multi-Provider Routing โ โ
โ โ (Health + Latency Based) โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ JMESPath Transformation โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Schema Validation (Optional) โ โ
โ โโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Budget Tracking โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ External APIs โ
โโโโโโโโโโโโโโโโโโโโ
๐ Monitoring & Observability
Prometheus Metrics
ApiBridge Pro exposes metrics at /metrics:
apibridge_requests_total- Total requests by connector, method, statusapibridge_request_duration_seconds- Request latency histogramapibridge_upstream_requests_total- Upstream provider requestsapibridge_upstream_duration_seconds- Upstream latencyapibridge_cache_hits_total- Cache hit countapibridge_cache_misses_total- Cache miss countapibridge_rate_limit_exceeded_total- Rate limit violationsapibridge_budget_spent_usd- Current budget spendingapibridge_provider_health- Provider health status (1=healthy, 0=unhealthy)apibridge_schema_drift_total- Schema drift detections
OpenTelemetry Tracing
Enable distributed tracing:
export OTEL_ENABLED=true
export OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317
Traces include:
- Gateway request spans
- Upstream provider calls
- Cache operations
- Transform operations
Admin Dashboard
Access the admin dashboard at /admin for:
- Real-time system metrics
- Budget tracking with visual progress bars
- Provider health monitoring
- Rate limit status
- Cache statistics
- Auto-refresh every 10 seconds
๐ PII Protection
ApiBridge Pro includes enterprise-grade PII protection:
Auto-Scan Mode
Automatically detects and protects:
- Email addresses
- Social Security Numbers (SSN)
- Credit card numbers
- Phone numbers
- IP addresses
Field-Level Protection
pii_protection:
enabled: true
field_rules:
user.email: encrypt # Reversible encryption
ssn: redact # Masked output (e.g., "1**-**-***4")
phone: tokenize # Consistent hash token
address: hash # One-way hash
Protection Actions
- Redact: Masks with asterisks (keeps first/last char)
- Tokenize: Deterministic token (same input โ same token)
- Encrypt: Reversible encryption (requires
PII_ENCRYPTION_KEY) - Hash: One-way hash (irreversible)
๐ OAuth2 Auto-Refresh
Automatic token management for OAuth2 client_credentials flow:
auth:
type: oauth2_client_credentials
token_url: https://auth.example.com/oauth/token
client_id: ${CLIENT_ID}
client_secret: ${CLIENT_SECRET}
scope: "read write"
extra_params: # Optional additional parameters
audience: "https://api.example.com"
Features:
- Automatic token refresh before expiration
- Per-provider token caching
- Thread-safe token management
- Configurable scopes
๐ API Documentation
When running, visit:
- Admin Dashboard: http://127.0.0.1:8000/admin
- Prometheus Metrics: http://127.0.0.1:8000/metrics
- Swagger UI: http://127.0.0.1:8000/docs
- ReDoc: http://127.0.0.1:8000/redoc
To disable docs in production:
export DISABLE_DOCS=true
๐๏ธ Production Deployment
Docker Compose Example
version: '3.8'
services:
apibridge:
build: .
ports:
- "8000:8000"
environment:
- REDIS_URL=redis://redis:6379/0
- OTEL_ENABLED=true
- OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4317
- PII_ENCRYPTION_KEY=${PII_ENCRYPTION_KEY}
depends_on:
- redis
- jaeger
redis:
image: redis:7-alpine
ports:
- "6379:6379"
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686" # UI
- "4317:4317" # OTLP gRPC
prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
Kubernetes Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: apibridge-pro
spec:
replicas: 3
selector:
matchLabels:
app: apibridge-pro
template:
metadata:
labels:
app: apibridge-pro
spec:
containers:
- name: apibridge
image: apibridge-pro:latest
ports:
- containerPort: 8000
env:
- name: REDIS_URL
value: "redis://redis-service:6379/0"
- name: OTEL_ENABLED
value: "true"
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "http://otel-collector:4317"
livenessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /health
port: 8000
initialDelaySeconds: 5
periodSeconds: 5
๐ค Contributing
Contributions welcome! Please feel free to submit a Pull Request.
For more details, see:
- CONTRIBUTING.md - Contribution guidelines
- CODE_OF_CONDUCT.md - Community guidelines
- SECURITY.md - Security policy
๐ Sponsor This Project
ApiBridge Pro is 100% open source and maintained with love by Lukas Londono.
If you find this project useful and want to support ongoing development:
Why sponsor?
- โจ Help maintain and improve ApiBridge Pro
- ๐ Fund new features and integrations
- ๐ Support documentation and tutorials
- ๐ Faster bug fixes and security updates
- ๐ Keep this project free and open source for everyone
What your sponsorship enables:
- More connector templates (OpenAI, Stripe, Twilio, and 100+ more)
- Advanced features (GraphQL support, WebSocket proxying, gRPC)
- Performance improvements and optimizations
- Professional support and consulting
- Community events and workshops
Other ways to support:
- โญ Star this repository
- ๐ฆ Share on Twitter/LinkedIn
- ๐ Write a blog post or tutorial
- ๐ฃ๏ธ Speak about ApiBridge Pro at meetups
- ๐ค Contribute code, docs, or connector templates
Every contribution, big or small, makes a difference! ๐
๐ License
MIT License - see LICENSE for details.
Copyright ยฉ 2025 Lukas Londono
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file apibridge_pro-0.1.0.tar.gz.
File metadata
- Download URL: apibridge_pro-0.1.0.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe5a47732bfc27fbf85da9a8f4e2516429410002ded3bb02bbde3df9099b6e4d
|
|
| MD5 |
74ed051bcc5f25a0c80861382e40b172
|
|
| BLAKE2b-256 |
8e904b4e6594a347073f0583d41987be1e7b8ced523aeb5106a8dee3ff230efb
|
Provenance
The following attestation bundles were made for apibridge_pro-0.1.0.tar.gz:
Publisher:
publish.yml on lukaslondono77/ApiBridgePro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apibridge_pro-0.1.0.tar.gz -
Subject digest:
fe5a47732bfc27fbf85da9a8f4e2516429410002ded3bb02bbde3df9099b6e4d - Sigstore transparency entry: 650609322
- Sigstore integration time:
-
Permalink:
lukaslondono77/ApiBridgePro@0d9501c07c4685e76c2c985db0dcf6d6b1fbd4ba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lukaslondono77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d9501c07c4685e76c2c985db0dcf6d6b1fbd4ba -
Trigger Event:
release
-
Statement type:
File details
Details for the file apibridge_pro-0.1.0-py3-none-any.whl.
File metadata
- Download URL: apibridge_pro-0.1.0-py3-none-any.whl
- Upload date:
- Size: 34.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31bb742a32c02c483b3efbbcc90b95422638a9940b5056a9dfc9df5085c6b718
|
|
| MD5 |
0f68577becf6b0f83f36037118fda4bd
|
|
| BLAKE2b-256 |
4f3acb0e2a3562810e904edddcbf7757aa868c1e344f76ed6ca64298f984d881
|
Provenance
The following attestation bundles were made for apibridge_pro-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on lukaslondono77/ApiBridgePro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
apibridge_pro-0.1.0-py3-none-any.whl -
Subject digest:
31bb742a32c02c483b3efbbcc90b95422638a9940b5056a9dfc9df5085c6b718 - Sigstore transparency entry: 650609325
- Sigstore integration time:
-
Permalink:
lukaslondono77/ApiBridgePro@0d9501c07c4685e76c2c985db0dcf6d6b1fbd4ba -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/lukaslondono77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d9501c07c4685e76c2c985db0dcf6d6b1fbd4ba -
Trigger Event:
release
-
Statement type: