Click below to watch the demo:
π https://www.loom.com/share/7006b1576cb74833b8628bb0db300c5a
- User authentication
- API key generation
- Rate limiting (prevents abuse)
- Usage tracking
This system adds a control layer to APIs to keep them secure and stable.
A production-style backend system built with FastAPI that provides:
- API key authentication
- Redis-based rate limiting
- Usage tracking
- Plan-based access control (Free / Pro / Enterprise)
- π API Key Generation & Validation
- β‘ Rate Limiting using Redis
- π Usage Tracking (requests count, last used)
- π§ Plan-based limits (Free / Pro / Enterprise)
- π JWT Authentication system
- π§© Plug-and-play dependency for any API
- FastAPI
- PostgreSQL
- Redis
- SQLAlchemy
app/
core/
db/
models/
routes/
services/
git clone https://github.com/your-username/saas-api-platform.git
cd saas-api-platform
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
Create .env from .env.example
uvicorn app.main:app --reload --port 8001
curl -H "X-API-Key: YOUR_API_KEY" \
http://127.0.0.1:8001/api/v1/api-keys/test-api-key
- Free β 10 requests/min
- Pro β 100 requests/min
- Enterprise β 1000 requests/min
- Protect your API from abuse
- Add API key authentication to your SaaS
- Track usage per client
- Build paid API services
- Dashboard UI
- Billing integration
- Analytics
- Multi-project support
Pull requests welcome.
A production-style backend system built with FastAPI that provides:
- API key authentication
- Redis-based rate limiting
- Usage tracking
- Plan-based access control (Free / Pro / Enterprise)
- π API Key Generation & Validation
- β‘ Rate Limiting using Redis
- π Usage Tracking (requests count, last used)
- π§ Plan-based limits (Free / Pro / Enterprise)
- π JWT Authentication system
- π§© Plug-and-play dependency for any API
- FastAPI
- PostgreSQL
- Redis
- SQLAlchemy
app/
core/
db/
models/
routes/
services/
git clone <repo>
cd api-control-platform
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# fill values
uvicorn app.main:app --reload
---
## π Example Usage
### Generate API Key (after login)
### Test API Key
curl -H "X-API-Key: YOUR_API_KEY"
http://127.0.0.1:8001/api/v1/api-keys/test-api-key
---
## π Rate Limiting
* Free β 10 requests/min
* Pro β 100 requests/min
* Enterprise β 1000 requests/min
---
## π§ Use Cases
* Protect your API from abuse
* Add API key authentication to your SaaS
* Track usage per client
* Build paid API services
---
## π Future Improvements
* Dashboard UI
* Billing integration
* Analytics
* Multi-project support
---
## π€ Contributing
Pull requests welcome.
---
## π License
MIT