Ratelane.

Quickstart — Python

Add Ratelane to a FastAPI app in under 5 minutes.

Install

pip install ratelane

Configure

Create a RatelaneConfig and attach the middleware to your FastAPI app:

from fastapi import FastAPI
from ratelane import RatelaneMiddleware, RatelaneConfig

app = FastAPI()

config = RatelaneConfig(
    api_key="rl_your_api_key",
    service_name="my-api",
    instance_version="1.0.0",  # optional
)

app.add_middleware(RatelaneMiddleware, config=config)

Run

uvicorn main:app --reload

Your instance will appear in the Ratelane dashboard within seconds. Routes are discovered automatically on startup.

Next steps

On this page