---
title: "Rate Limit API Requests Firewall Rule"
description: "Adds a rule to your Vercel Firewall that rate limits API requests."
url: "https://vercel.com/templates/other/rate-limit-api-requests-firewall-rule"
links:
  repository: "https://github.com/vercel/firewall-templates/tree/main/api-rate-limit"
  demo: "https://github.com/vercel-labs/ai-bots-firewall-rule"
---

# Rate Limit API Requests Firewall Rule

Adds a rule to your Vercel Firewall that rate limits API requests.

# Rate Limit API Requests

A firewall rule template designed to implement rate limiting for API requests, helping to protect your API from abuse and ensure fair usage.

The rule defaults to the "log action". Set to "Deny" to actually block requests.

## Consider customization

The generated firewall rule provides a basic rate limiting structure. Consider customizing the following parameters to suit your specific API needs:

1. Request limit: Adjust the maximum number of requests allowed within the time window.
2. Time window: Modify the duration for which the request limit applies.
3. Allow list: Configure exceptions for trusted entities across 15+ parameters.
4. Response: Customize the response sent when a client exceeds the rate limit.

## Availability

Rate limiting is available to customers on Pro or Enterprise plans.

## Related Templates

### [RAG with Vercel AI SDK](https://vercel.com/templates/next.js/ai-sdk-rag)

A retrieval-augmented generation chatbot built with Next.js, the Vercel AI SDK, Drizzle ORM, and PostgreSQL.

### [Advanced AI Bot Protection](https://vercel.com/templates/next.js/advanced-ai-bot-protection)

An AI chat app built on Vercel that integrates Kasada's advanced bot protection. Prevent abusive API calls to the LLM before they occur.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
