Skip to main content

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

pip install ratelane-sdk

Quick start

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

# 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

ratelane_sdk-0.1.6.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ratelane_sdk-0.1.6-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file ratelane_sdk-0.1.6.tar.gz.

File metadata

  • Download URL: ratelane_sdk-0.1.6.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.0

File hashes

Hashes for ratelane_sdk-0.1.6.tar.gz
Algorithm Hash digest
SHA256 176355d57243c7bb30004250a4d9d73c095e9d4a665bd5311ce6d4c1567c2e26
MD5 49620ba6399c2b92c975b50dc20d8eb7
BLAKE2b-256 12d689526a9da49f97a5cf22ecbc1a51176c131fa58515703c4b60eb43f98731

See more details on using hashes here.

File details

Details for the file ratelane_sdk-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: ratelane_sdk-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.0

File hashes

Hashes for ratelane_sdk-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7e126f6c23aac8140d8f86a8c3a818b9b1b9b449c44ed5170f282c2f3afe00d8
MD5 3a0d01b0bf73a1d1e40cbc56bba24ddb
BLAKE2b-256 7feff1c09b409a0989f7552b4eafe2cf95b42ad1551b92b593345dfeafe1c654

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

This release

0.1.6 This release

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page