Playground API
DocsStatsBlogStudio
Documentation Tree
Technical BlogFeature Deep Dives
  • Introduction
  • Quickstart
    5 min
  • How It Works
  • Recipes & Cookbooks
  • Platform Comparisons
  • Real-World Showcase
  • Interactive Studio
    Studio
  • GraphiQL IDE
    IDE
  • Session Quotas & Activity
  • Network Chaos Simulator
  • Atomic Sandbox Reset
  • Overview & Models
    Hub
  • Users Resource
  • Posts Resource
  • Comments Resource
  • Todos Resource
  • Custom Collections
    Custom
  • Multipart File Uploads
    Upload
  • Dynamic SVG Avatars
    SVG
  • Image Thumbnails
    CDN
  • Relational Filtering
  • Full-Text Search
  • Dynamic Sorting
  • Offset Pagination
  • Cursor Pagination
    Scroll
  • CSV & Excel Export & Import
    IO
  • Custom Collections
    CRUD
  • Overview & Architecture
    Hub
  • JWT Auth Flow
  • Refresh Token Rotation
    Mutex
  • RBAC Permission Matrix
    Roles
  • Expiry Simulation
  • Clock Skew Drift
  • Password Recovery Loop
  • Dual-Mode Sandboxing
  • GraphiQL IDE
    IDE
  • Relational Queries
  • Stateful Mutations
  • Realtime Subscriptions
  • Overview & Flowcharts
    Hub
  • Hosted Checkout
    Stripe
  • Payment Intents API
  • 3DS Challenge Modal
    Modal
  • Customers Vault
  • Charges & Refunds
  • Test Cards Catalog
  • Overview & Channels
    Hub
  • Virtual Email Mailbox
    Mailtrap
  • Virtual SMS Terminal
    Phone
  • In-App Notifications
  • Message Dispatcher
  • Realtime Studio
    Studio
  • Native WebSocket (/ws)
  • Socket.io Gateway
  • Presence & Echo Bot
  • Server-Sent Events (SSE)
    SSE
  • Analytics Telemetry
  • Webhook Subscriptions
  • HMAC SHA-256 Signatures
  • Delivery Logs
  • Manual Retry Simulator
  • Network Latency Delay
  • HTTP Status Codes
  • Rate-Limit Simulator
    429
  • Flaky Network & Jitter
    Chaos
  • Session Quotas & Activity
  • JSON Snapshots
    JSON
  • Headless CI/CD Testing
    CI
  • Mobile QR Code Sync
  • System Metrics & Health
  • Atomic Sandbox Reset
  • Official TypeScript SDK
  • Multi-Language Generators
  • DevTools Extension
  • OpenAPI 3.1 Spec
    JSON
  • Postman Collection v2.1
  • Bruno Collection
  • Insomnia Workspace
  • TypeScript .d.ts
    .d.ts
  • AI Prompt Rules
    Rules
  • Context Index (llms.txt)
  • Full Schema (llms-full.txt)
  • Manifest (product.json)
  • All Feature Articles
    Blog
  • React CRUD Without Backend
    Deep Dive
  • Why Static APIs Fail
  • Mocking Stateful Auth
  • WebSockets & SSE Guide
Technical Blog
Articles

In-depth articles explaining stateful mock APIs, WebSockets, payments, and frontend resilience.

Read Articles
PreviousHTTP Status Codes
NextFlaky Network & Jitter
Chaos & Fault Injection

Rate-Limit Simulation (HTTP 429)

Test client-side exponential backoff, retry throttles, and user toast notifications when API quotas are exceeded. Simulates sliding-window rate limiters and returns compliant Retry-After and X-RateLimit-* headers.

Interactive Rate-Limit Workbench

Choose a quota preset and send repeated requests to observe rate limiting in action:

Rate-Limited Request (Immediate 429)

Send repeatedly to exhaust remaining calls and observe HTTP 429 response.

GET
response.json
1
{
2
// Click "Send" above to execute this request against the live server.
3
}

Rate-Limit Response Headers Reference

HeaderFormatExampleDescription
Retry-AfterInteger (seconds)3Recommended pause duration in seconds before the client should attempt a retry.
X-RateLimit-LimitInteger5The maximum permitted request ceiling within the configured time window.
X-RateLimit-RemainingInteger0The number of remaining permitted calls before rejection occurs.
X-RateLimit-ResetUnix Timestamp1759165200Epoch timestamp in seconds marking when the sliding window resets.

Client-Side Exponential Backoff Recipe

A resilient TypeScript implementation that parses Retry-After and retries automatically:

fetchWithRetry.ts
1
// Client-side fetch wrapper that honors Retry-After headers
2
async function fetchWithRetry(url: string, options: RequestInit = {}, maxRetries = 3): Promise<Response> {
3
let attempt = 0;
4
5
while (attempt < maxRetries) {
6
const response = await fetch(url, options);
7
8
if (response.status === 429) {
9
attempt++;
10
// Parse standard Retry-After header (in seconds), fallback to exponential backoff
11
const retryAfterHeader = response.headers.get('Retry-After');
12
const waitSeconds = retryAfterHeader ? parseInt(retryAfterHeader, 10) : Math.pow(2, attempt);
13
14
console.warn(Rate limited (429)! Retrying after ${waitSeconds}s (attempt ${attempt}/${maxRetries})...);
15
await new Promise((resolve) => setTimeout(resolve, waitSeconds * 1000));
16
continue;
17
}
18
19
return response;
20
}
21
22
throw new Error('Request failed after maximum rate limit retries.');
23
}

Need to test intermittent packet drops?

Simulate probabilistic failure rates and randomized network jitter.

View Flaky Network Engine