Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Rate Limiting

Teaches how to implement and configure the Rate Limiting API in Cloudflare Workers using bindings to enforce custom limits based on user IDs, API routes, or customer tiers.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Rate Limiting

Teaches how to implement and configure the Rate Limiting API in Cloudflare Workers using bindings to enforce custom limits based on user IDs, API routes, or customer tiers.

When To Use

Use when you need to implement custom rate limiting logic within a Worker to protect specific API routes or differentiate limits between free and paid users.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-runtime-apis-bindings-rate-limiting-workflow-guide.mdA guide explaining how to configure and implement the Workers Rate Limiting API to enforce request limits within a Worker.Questions about a guide explaining how to configure and implement the Workers Rate Limiting API to enforce request limits within a Wo...
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi.textA configuration object defining a rate limiter namespace ID and period settings for a Cloudflare Worker.Exact payloads, commands, or snippets shown in A configuration object defining a rate limiter namespace ID and period settings for a Cloudflare Worker.
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi-2.textA TOML configuration file defining a simple rate limit rule with a limit of 100 requests per 60 seconds.Exact payloads, commands, or snippets shown in A TOML configuration file defining a simple rate limit rule with a limit of 100 requests per 60 seconds.
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi-3.textA JavaScript code example demonstrating how to use the Workers Rate Limiting binding to check and enforce request limits based on a URL pathname.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the Workers Rate Limiting binding to check and enforce request lim...
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi-4.textA TypeScript code example demonstrating how to define and use the RateLimit binding within a Cloudflare Workers environment interface.Exact payloads, commands, or snippets shown in A TypeScript code example demonstrating how to define and use the RateLimit binding within a Cloudflare Workers envir...
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi-5.textA JSON configuration object defining rate limit namespaces and simple limit rules for free and paid users.Exact payloads, commands, or snippets shown in A JSON configuration object defining rate limit namespaces and simple limit rules for free and paid users.
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi-6.textA TOML configuration file defining multiple rate limit namespaces and their respective simple limit thresholds and periods.Exact payloads, commands, or snippets shown in A TOML configuration file defining multiple rate limit namespaces and their respective simple limit thresholds and pe...
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi-7.textA text configuration example defining rate limit rules including namespace IDs, request limits, and time periods.Exact payloads, commands, or snippets shown in A text configuration example defining rate limit rules including namespace IDs, request limits, and time periods.
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi-8.textA TOML configuration snippet defining a rate limiter name, namespace ID, and simple limit parameters.Exact payloads, commands, or snippets shown in A TOML configuration snippet defining a rate limiter name, namespace ID, and simple limit parameters.
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi-9.textA JavaScript code example demonstrating how to use the Workers Rate Limiting binding to limit requests based on a user ID.Exact payloads, commands, or snippets shown in A JavaScript code example demonstrating how to use the Workers Rate Limiting binding to limit requests based on a use...
examples/workers-runtime-apis-bindings-rate-limiting-cloudflare-workers-rate-limi-10.textA code example demonstrating how to use the Workers Rate Limiting binding to check request limits using a specific key.Exact payloads, commands, or snippets shown in A code example demonstrating how to use the Workers Rate Limiting binding to check request limits using a specific key.

What This Skill Covers

  • The Rate Limiting API lets you define rate limits and write code around them in your Worker.
  • Main sections: Get started, Configuration, Best practices, Locality, Performance.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/runtime-apis/bindings/rate-limit