> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-fix-issues-on-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

# Upstash Rate Limit

[![npm (scoped)](https://img.shields.io/npm/v/@upstash/ratelimit)](https://www.npmjs.com/package/ratelimit)

It is the only connectionless (HTTP based) rate limiting library and designed
for:

* Serverless functions (AWS Lambda, Vercel ...)
* Cloudflare Workers
* Vercel Edge
* Fastly Compute\@Edge
* Next.js, Jamstack ...
* Client side web/mobile applications
* WebAssembly
* and other environments where HTTP is preferred over TCP.

## Quick Links:

* [Github Repository](https://github.com/upstash/ratelimit)
* [Getting Started](https://upstash.com/docs/oss/sdks/ts/ratelimit/gettingstarted)
* [Costs](https://upstash.com/docs/oss/sdks/ts/ratelimit/costs)

## Features

<CardGroup cols={2}>
  <Card title="Caching" icon="shield-halved" href="https://upstash.com/docs/oss/sdks/ts/ratelimit/features#caching">
    Handle blocked requests without having to call the Redis Database
  </Card>

  <Card title="Timeout" icon="stopwatch" href="https://upstash.com/docs/oss/sdks/ts/ratelimit/features#timeout">
    If the Redis call of the ratelimit is not resolved in some timeframe, allow the request by default
  </Card>

  <Card title="Analytics & Dashboard" icon="magnifying-glass-chart" href="https://upstash.com/docs/oss/sdks/ts/ratelimit/features#analytics-and-dashboard">
    Collect information on which identifiers made how many requests and how many were blocked.
  </Card>

  <Card title="Multiple Limits" icon="gears" href="https://upstash.com/docs/oss/sdks/ts/ratelimit/features#using-multiple-limits">
    Use different limits for different kinds of requests (example: paid and free users)
  </Card>

  <Card title="Custom Rates" icon="chart-simple" href="https://upstash.com/docs/oss/sdks/ts/ratelimit/features#custom-rates">
    Consume different amounts of tokens in different requests (example: limiting based on request/response size)
  </Card>

  <Card title="Multi Region" icon="globe" href="https://upstash.com/docs/oss/sdks/ts/ratelimit/features#multi-region">
    Utilize several Redis databases in different regions to serve users faster
  </Card>
</CardGroup>

For more information about the features, see the [Features tab](https://upstash.com/docs/oss/sdks/ts/ratelimit/features).

## Examples

<CardGroup cols={2}>
  <Card title="Cloudflare Workers" href="https://github.com/upstash/ratelimit/tree/main/examples/cloudflare-workers">
    Rate limit access to your Cloudflare Workers
  </Card>

  <Card title="Nextjs" href="https://github.com/upstash/ratelimit/tree/main/examples/nextjs13">
    Rate limit an API in a Nextjs project using the App router
  </Card>

  <Card title="Nextjs with Middleware" href="https://github.com/upstash/ratelimit/tree/main/examples/nextjs">
    Rate limit an API with a Middleware in a Nextjs project using the Pages router
  </Card>

  <Card title="Remix" href="https://github.com/upstash/ratelimit/tree/main/examples/remix">
    Rate limit access to a Remix App
  </Card>

  <Card title="Rate limit using Vercel KV" href="https://github.com/upstash/ratelimit/tree/main/examples/with-vercel-kv">
    Rate limit a Nexjs app using Vercel KV
  </Card>

  <Card title="Rate limit your Chatbot" href="https://upstash.com/blog/degree-guru#rate-limiting">
    Limiting requests to a Chatbot endpoint which streams LLM outputs
  </Card>
</CardGroup>
