HaltModern Rate Limiting • v0.0.1 / v0.0.1

Modern rate limiting
for APIs & SaaS

Drop-in middleware with safe defaults, observability hooks, and distributed storage support. Works the same in Python and TypeScript.

FastAPI middleware
main.pypython
from fastapi import FastAPI
from halt import RateLimiter, InMemoryStore, presets
from halt.adapters.fastapi import HaltMiddleware

app = FastAPI()

limiter = RateLimiter(
    store=InMemoryStore(),
    policy=presets.PUBLIC_API  # 100 req/min
)

app.add_middleware(HaltMiddleware, limiter=limiter)

Halt at work

Halt checks each request, forwards valid traffic, and blocks excessive calls before they hit your handlers.

Allowed · 200

Client

fetch("/api/data", {
  headers: { "x-api-key": "team_pro_key" }
});
req#1req#2req#3req#4req#5req#6

Halt Middleware

const limiter = new RateLimiter({...});

app.use(haltMiddleware(limiter));
Policy check passed

API Server

app.get("/api/data", async (req, res) => {
  return res.json({ ok: true });
});

Accepted 1 rapid requests

Live logs

12:41:01 req_id=8f1 user=team_pro check=pass remaining=3

12:41:01 forwarded=true target="/api/data" status=200 latency=25ms

Works with your stack

Popular frameworks and storage engines, ready out of the box.

FastAPI
Express
Next.js
Redis
PostgreSQL
MongoDB

Why Halt

Everything you need for reliable limits

Production-grade algorithms, storage, and telemetry in one toolkit.

4 Algorithms

Token Bucket, Fixed Window, Sliding Window, and Leaky Bucket.

6 Storage Backends

Memory, Redis, PostgreSQL, MongoDB, DynamoDB, Memcached.

SaaS-Ready

Quotas, penalties, plan-based limits, telemetry hooks.

High Performance

~100k req/s with minimal overhead and O(1) memory per key.

Framework Support

FastAPI, Flask, Django, Express, Next.js adapters built-in.

Smart Defaults

Health-check exemptions, private IP allowlist, RateLimit-* headers.

Supported stack

Frameworks, storage, and algorithms

Everything you need is grouped below with direct links and compact summaries.

5 frameworks6 storage backends4 algorithms

Frameworks

5 items
FastAPI
FastAPI

High-performance Python web framework.

Flask
Flask

Lightweight Python microframework.

Django
Django

Batteries-included Python framework.

Express
Express

Minimal Node.js web framework.

Next.js
Next.js

React framework for fullstack web.

Storage Backends

6 items
In-Memory
In-Memory

Local, development-only store.

Redis
Redis

In-memory data store for distributed limits.

PostgreSQL
PostgreSQL

Relational store with strong consistency.

MongoDB
MongoDB

Document store with TTL indexes.

DynamoDB
DynamoDB

AWS serverless key-value store.

Memcached
Memcached

Distributed cache for fast lookups.

Algorithms

4 items

Token Bucket

Burst-friendly

Fixed Window

Simple & fast

Sliding Window

Most accurate

Leaky Bucket

Traffic shaping

Ship rate limits in minutes

Ready to protect your API?

Install Halt and add bulletproof rate limiting to any service.