Windsurf Rate Limiting

VerifiedSafe

Implement rate limiting, exponential backoff, and idempotency patterns for Windsurf. Handle 429 errors and optimize API request throughput.

Sby Skills Guide Bot
DevelopmentIntermediate
3/8/2026
Claude CodeCursorWindsurf
#rate-limiting#retry-logic#idempotency#api-resilience#windsurf

Recommended for

Automated summary

This skill provides TypeScript patterns for handling Windsurf API rate limits: exponential backoff with jitter, idempotency keys, request queuing, and quota header monitoring.

Strengths

  • Ships working code for exponential backoff with jitter, avoiding thundering-herd retries
  • Explains deterministic idempotency key generation (SHA-256 of operation params) so retries stay safe
  • Clear table of rate limit headers (Limit, Remaining, Reset, Retry-After) with the action to take for each
  • Demonstrates client-side throttling with a p-queue configured by concurrency and interval cap

Limitations

  • Tier numbers (60/300/1000 req/min, daily quotas, burst) are hardcoded and may drift from Windsurf's real limits
  • Assumes the SDK exposes X-RateLimit-* headers and a WindsurfClient-shaped client, which is not verified
  • The file is truncated (RateLimitMonitor cuts off mid-method) and no tests are included
When to use it

Use it when integrating the Windsurf API and you need to handle 429 errors, add reliable retries, or smooth request throughput.

When not to use it

Skip it if you need a provider-agnostic rate limiting solution or a configuration validated against Windsurf's current official documentation.

Security analysis

Safe
Quality score82/100

The skill only contains documentation and TypeScript examples for retry, backoff, and idempotency. It declares Read, Write, Edit and does not instruct destructive, exfiltrating, obfuscated, or safety-disabling actions.

No concerns found

How this analysis is made

Examples

Add retry to Windsurf calls
My Windsurf API calls keep failing with 429s under load. Add exponential backoff with jitter and honor the Retry-After header in my client wrapper.
Make retries idempotent
Implement deterministic idempotency keys for my Windsurf POST requests so that retried calls don't create duplicates.
Throttle request throughput
Set up a queued rate limiter around my Windsurf SDK calls with concurrency 5 and max 10 requests per second, and log the X-RateLimit-Remaining value.

name: windsurf-rate-limits description: | Implement Windsurf rate limiting, backoff, and idempotency patterns. Use when handling rate limit errors, implementing retry logic, or optimizing API request throughput for Windsurf. Trigger with phrases like "windsurf rate limit", "windsurf throttling", "windsurf 429", "windsurf retry", "windsurf backoff". allowed-tools: Read, Write, Edit version: 1.0.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io

Windsurf Rate Limits

Overview

Handle Windsurf rate limits gracefully with exponential backoff and idempotency.

Prerequisites

  • Windsurf SDK installed
  • Understanding of async/await patterns
  • Access to rate limit headers

Instructions

Step 1: Understand Rate Limit Tiers

| Tier | Requests/min | Requests/day | Burst | |------|-------------|--------------|-------| | Free | 60 | 1,000 | 10 | | Pro | 300 | 10,000 | 50 | | Enterprise | 1,000 | 100,000 | 200 |

Step 2: Implement Exponential Backoff with Jitter

async function withExponentialBackoff<T>(
  operation: () => Promise<T>,
  config = { maxRetries: 5, baseDelayMs: 1000, maxDelayMs: 32000, jitterMs: 500 }
): Promise<T> {
  for (let attempt = 0; attempt <= config.maxRetries; attempt++) {
    try {
      return await operation();
    } catch (error: any) {
      if (attempt === config.maxRetries) throw error;
      const status = error.status || error.response?.status;
      if (status !== 429 && (status < 500 || status >= 600)) throw error;

      // Exponential delay with jitter to prevent thundering herd
      const exponentialDelay = config.baseDelayMs * Math.pow(2, attempt);
      const jitter = Math.random() * config.jitterMs;
      const delay = Math.min(exponentialDelay + jitter, config.maxDelayMs);

      console.log(`Rate limited. Retrying in ${delay.toFixed(0)}ms...`);
      await new Promise(r => setTimeout(r, delay));
    }
  }
  throw new Error('Unreachable');
}

Step 3: Add Idempotency Keys

import { v4 as uuidv4 } from 'uuid';
import crypto from 'crypto';

// Generate deterministic key from operation params (for safe retries)
function generateIdempotencyKey(operation: string, params: Record<string, any>): string {
  const data = JSON.stringify({ operation, params });
  return crypto.createHash('sha256').update(data).digest('hex');
}

async function idempotentRequest<T>(
  client: WindsurfClient,
  params: Record<string, any>,
  idempotencyKey?: string  // Pass existing key for retries
): Promise<T> {
  // Use provided key (for retries) or generate deterministic key from params
  const key = idempotencyKey || generateIdempotencyKey(params.method || 'POST', params);
  return client.request({
    ...params,
    headers: { 'Idempotency-Key': key, ...params.headers },
  });
}

Output

  • Reliable API calls with automatic retry
  • Idempotent requests preventing duplicates
  • Rate limit headers properly handled

Error Handling

| Header | Description | Action | |--------|-------------|--------| | X-RateLimit-Limit | Max requests | Monitor usage | | X-RateLimit-Remaining | Remaining requests | Throttle if low | | X-RateLimit-Reset | Reset timestamp | Wait until reset | | Retry-After | Seconds to wait | Honor this value |

Examples

Queue-Based Rate Limiting

import PQueue from 'p-queue';

const queue = new PQueue({
  concurrency: 5,
  interval: 1000,
  intervalCap: 10,
});

async function queuedRequest<T>(operation: () => Promise<T>): Promise<T> {
  return queue.add(operation);
}

Monitor Rate Limit Usage

class RateLimitMonitor {
  private remaining: number = 60;
  private resetAt: Date = new Date();

  updateFromHeaders(headers: Headers) {
    this.remaining = parseInt(headers.get('X-RateLimit-Remaining') || '60');
    const resetTimestamp = headers.get('X-RateLimit-Reset');
    if (resetTimestamp) {
      this.resetAt = new Date(parseInt(resetTimestamp) * 1000);
    }
  }

  shouldThrottle(): boolean {
    // Only throttle if low remaining AND reset hasn't happened yet
    return this.remaining < 5 && new Date() < this.resetAt;
  }

  getWaitTime(): number {
    return Math.max(0, this.resetAt.getTime() - Date.now());
  }
}

Resources

Next Steps

For security configuration, see windsurf-security-basics.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/windsurf-rate-limiting-mmh8qqn9/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/windsurf-rate-limiting-mmh8qqn9' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/windsurf-rate-limiting-mmh8qqn9/download' --output '.skill-downloads/windsurf-rate-limiting-mmh8qqn9/SKILL.md.part' && mv '.skill-downloads/windsurf-rate-limiting-mmh8qqn9/SKILL.md.part' '.skill-downloads/windsurf-rate-limiting-mmh8qqn9/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Write, Edit

Original excerpt: Prerequisites
  • Windsurf SDK installed
  • Understanding of async/await patterns
  • Access to rate limit headers

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/windsurf-rate-limiting-mmh8qqn9/SKILL.md' && test -s '.skill-downloads/windsurf-rate-limiting-mmh8qqn9/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/windsurf-rate-limits' && cp -R '.skill-downloads/windsurf-rate-limiting-mmh8qqn9' '.claude/skills/windsurf-rate-limits'

Cursor
test -f '.skill-downloads/windsurf-rate-limiting-mmh8qqn9/SKILL.md' && test -s '.skill-downloads/windsurf-rate-limiting-mmh8qqn9/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/windsurf-rate-limits' && cp -R '.skill-downloads/windsurf-rate-limiting-mmh8qqn9' '.cursor/skills/windsurf-rate-limits'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/windsurf-rate-limiting-mmh8qqn9'

openskills read 'windsurf-rate-limiting-mmh8qqn9'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/windsurf-rate-limiting-mmh8qqn9/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills