Ratelane.

Python SDK

Full configuration reference for the Ratelane Python SDK.

Installation

pip install ratelane

RatelaneConfig options

OptionTypeRequiredDescription
api_keystrYour Ratelane API key from the dashboard
service_namestrIdentifies this service in the fleet
instance_versionstrYour app version, shown in instance detail
poll_intervalintTelemetry poll interval in seconds (default: 30)
alert_emailstrEmail to notify on circuit breaker trips

Middleware

app.add_middleware(RatelaneMiddleware, config=config)

The middleware intercepts every request, enforces the active policy, and batches telemetry on a background thread — no latency added to your requests.

CLI

The SDK ships a CLI for local testing:

ratelane status        # show active policies for this service
ratelane emergency on  # activate emergency profile
ratelane emergency off # deactivate emergency profile

On this page