Skip to content

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChatGPT Image Jul 6, 2026, 04_33_44 PM

Halt

SaaS-aware, cross-language rate limiting for APIs and services. One consistent model in TypeScript and Python for per-user / per-API-key / per-plan limits, quotas, weighted endpoints, abuse controls, distributed accuracy via atomic Redis, and built-in observability. Plugs into Express, Next, FastAPI, Flask, and Django.

📖 Documentation & guides: https://halt.afroawi.com/docs

Packages

Package Install Registry Installs
TypeScript — packages/typescript npm install halt-rate npm NPM Downloads
Python — packages/python pip install halt-rate PyPI PyPI Downloads

Why Halt

  • SaaS-aware, not just "requests per IP": per-user / per-API-key / per-plan limits, quotas, and weighted (cost-based) endpoints.
  • Cross-language parity: the same policies, algorithms, and behavior in TS and Python.
  • Distributed & accurate: RedisStore runs each check as a single-key Lua script, so limits stay exact under concurrency across a fleet (sync + async in Python).
  • Dynamic limits: change limits at runtime with a PolicyRegistry or a cached loader (reading Redis/DB/config) — no restart.
  • Abuse controls: progressive penalties / abuse scoring.
  • Observability built-in: zero-dep StatsCollector (blocked counts, top limited keys, endpoint cost, plan consumption) plus an OpenTelemetry metrics adapter.
  • Framework adapters: Express, Next, Hono, Fastify, Flask, FastAPI, Django, GraphQL — with edge-runtime support in TypeScript.

Quick start

See the per-package READMEs (TypeScript · Python) for a minimal example, and halt.afroawi.com/docs for full usage guidance.

Development

# TypeScript
cd packages/typescript && npm install && npm test

# Python
cd packages/python && pip install -e ".[dev]" && pytest

Distributed/Redis tests are opt-in via the REDIS_URL environment variable.

Contributing & License

See CONTRIBUTING.md. Open PRs against main using conventional commits. Licensed under MIT.

About

No description, website, or topics provided.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages