ratelane-sdk
API observability and live policy control plane middleware for FastAPI.
Ratelane gives you fleet-wide visibility and real-time policy enforcement — rate limits, route enable/disable, per-route timeouts, and CORS — without redeploying your app. Policy changes push to all instances within 10 seconds.
Installation
```bash pip install ratelane-sdk ```
Quick start
```python from fastapi import FastAPI from ratelane import RatelaneConfig, RatelaneMiddleware
app = FastAPI()
app.add_middleware( RatelaneMiddleware, config=RatelaneConfig( api_key="your_api_key", collector_url="https://your-ratelane-backend.com", fastapi_app=app, ) ) ```
Features
- Rate limiting — global and per-route, enforced locally with no network call on the hot path
- Route control — enable/disable routes with custom status codes and messages
- Per-route timeouts — automatic 504 on slow downstream responses
- CORS — dynamic allowed origins pushed from the dashboard
- Emergency Profile — automatic fallback policy when the policy server is unreachable
- Fleet visibility — per-instance sync status, last seen, and policy signature in the dashboard
CLI
```bash
Clear state for this project
ratelane clear --collector-url https://... --api-key sk_live_...
Clear all Ratelane state on this machine
ratelane clear --all ```
License
Copyright 2026 Ratelane. All Rights Reserved.
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 ratelane_sdk-0.1.1.tar.gz.
File metadata
- Download URL: ratelane_sdk-0.1.1.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df684f02ecd8afca372135b61204f7e8c9a2d3c54721e48d82679f44388ee854
|
|
| MD5 |
68d4fe433f9e51260f1aa2a9de7cfcbc
|
|
| BLAKE2b-256 |
363f4491e630accb5396e00a1a83b950dbccce5a3c20bb8a41f1882abc2c145d
|
File details
Details for the file ratelane_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: ratelane_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d520a7fe60ad675117cfb0ddebc40cf8e3df39bf5a05d2e8346a4371d56982d7
|
|
| MD5 |
79bf32f23567afcd8ddf5e8f802f1bda
|
|
| BLAKE2b-256 |
69164d8c00ff00dcfaa0638080314172ecb01aa67a6eaa3f598a15b234f81be2
|