Communitygithub.com

API 속도 제한 및 조절 전문가

토큰 버킷, 슬라이딩 윈도우, 고정 윈도우 알고리즘을 사용한 공정하고 효율적인 속도 제한을 구현합니다. Redis 기반 분산 카운터를 지원합니다.

API 속도 제한 및 조절 전문가란 무엇인가요?

이 기술은 API 보호를 위한 속도 제한 및 조절을 구현하는 전문가 기술입니다. 토큰 버킷, 슬라이딩 윈도우 로그, 슬라이딩 윈도우 카운터, 고정 윈도우 등 다양한 알고리즘을 지원하며, Redis 7.4+, Valkey, DragonflyDB 같은 분산 저장소를 사용하여 여러 인스턴스에 걸쳐 일관된 속도 제한을 적용합니다. rate-limiter-flexible, @upstash/ratelimit, express-rate-limit 같은 라이브러리와 Kong, Nginx, Traefik 같은 게이트웨이 플러그인도 활용할 수 있습니다. RFC 6585(429 상태 코드)와 IETF 초안 표준 RateLimit 헤더를 준수하여 올바른 응답 헤더를 반환하며, 인-메모리 카운터 사용, Retry-After 헤더 누락, IP 기반 단일 제한, 버스트 미지원, 내부 API 미보호 같은 안티 패턴을 피하도록 돕습니다. Claude Code, Cursor, Cline, WindSurf 등 다양한 AI 에이전트 플랫폼에서 'rate limiting', 'throttling', 'token bucket', 'sliding window', 'API abuse', 'DDoS protection', 'quota management' 같은 키워드로 활성화됩니다. API 게이트웨이 설정이나 캐싱 전략과는 관련이 없으므로 다른 전문가 기술이 필요합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/curiositech/windags-skills/tree/HEAD/skills/api-rate-limiting-throttling-expert

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

API 속도 제한 및 조절 전문가은(는) 무엇을 하나요?

토큰 버킷, 슬라이딩 윈도우, 고정 윈도우 알고리즘과 Redis 기반 분산 카운터를 사용하여 공정하고 효율적인 속도 제한을 구현합니다.

활성화 트리거

활성화 키워드: "rate limiting", "throttling", "token bucket", "sliding window", "API abuse", "DDoS protection", "quota management", "429 Too Many Requests", "request limits"

사용하지 않을 때: API 게이트웨이 설정 → api-gateway-reverse-proxy-expert | 캐싱 전략 → cache-strategy-invalidation-expert | WAF/방화벽 규칙 → 관련 보안 기술

빠른 시작

  1. 제한 정의 — API 키, IP, 또는 사용자 계층별 분당 요청 수 설정
  2. 알고리즘 선택 — 슬라이딩 윈도우 로그 (정확), 토큰 버킷 (버스트 처리), 고정 윈도우 (간단)
  3. Redis 사용 — 분산 속도 제한을 위한 MULTI/EXEC 또는 Lua 스크립트의 원자적 연산 활용
  4. 올바른 헤더 반환 — X-RateLimit-Limit, X-RateLimit-Remaining, Retry-After
  5. 계층 구분 — 무료/프로/엔터프라이즈에 다른 제한 적용

핵심 기능

도메인기술
알고리즘토큰 버킷, 슬라이딩 윈도우 로그, 슬라이딩 윈도우 카운터, 고정 윈도우
저장소Redis 7.4+, Valkey, DragonflyDB, 인-메모리 (단일 노드)
라이브러리rate-limiter-flexible, @upstash/ratelimit, express-rate-limit
게이트웨이 플러그인Kong rate-limiting, Nginx limit_req, Traefik ratelimit
표준RFC 6585 (429), RateLimit 헤더 (draft-ietf-httpapi-ratelimit)

아키텍처 패턴

슬라이딩 윈도우 카운터 (Redis Lua)

-- Redis Lua 스크립트: 슬라이딩 윈도우 속도 제한기
-- KEYS[1] = 속도 제한 키
-- ARGV[1] = 윈도우 크기 (초)
-- ARGV[2] = 최대 요청 수
-- ARGV[3] = 현재 타임스탬프

local key = KEYS[1]
local window = tonumber(ARGV[1])
local limit = tonumber(ARGV[2])
local now = tonumber(ARGV[3])

-- 만료된 항목 제거
redis.call('ZREMRANGEBYSCORE', key, 0, now - window)

-- 현재 윈도우 카운트
local count = redis.call('ZCARD', key)

if count < limit then
  redis.call('ZADD', key, now, now .. '-' .. math.random(1000000))
  redis.call('EXPIRE', key, window)
  return {1, limit - count - 1}  -- 허용, 남은 횟수
else
  return {0, 0}  -- 거부, 0회 남음
end

다중 계층 속도 제한

요청 → IP 속도 제한 (100/분)
              │ 통과
              ↓
         인증 확인 → API 키 속도 제한 (계층 기반)
              │           무료:  60/분
              │           프로:   600/분
              │           엔터프라이즈: 6000/분
              ↓ 통과
         엔드포인트 속도 제한 (경로별)
              │   POST /upload: 10/분
              │   GET /search:  120/분
              ↓ 통과
         요청 처리

응답 헤더 (IETF 초안 표준)

// 미들웨어: 속도 제한 헤더 첨부
function rateLimitHeaders(limit: number, remaining: number, resetAt: number) {
  return {
    'RateLimit-Limit': limit.toString(),
    'RateLimit-Remaining': Math.max(0, remaining).toString(),
    'RateLimit-Reset': Math.ceil((resetAt - Date.now()) / 1000).toString(),
  };
}

// 429 응답 시:
res.status(429).set({
  ...rateLimitHeaders(limit, 0, resetAt),
  'Retry-After': Math.ceil((resetAt - Date.now()) / 1000).toString(),
}).json({ error: 'Too Many Requests', retryAfter: resetAt });

안티 패턴

  1. 분산 시스템에서의 인-메모리 카운터 — 속도 제한은 인스턴스 간에 공유되어야 합니다. Redis 또는 동등한 저장소를 사용하세요.
  2. Retry-After 헤더 누락 — Retry-After 없이 429 응답을 보내면 클라이언트가 추측하여 썬더링 허드(동시 폭주)를 유발합니다.
  3. IP 기반 단일 속도 제한 — IP 제한만으로는 인증된 남용을 놓치고 공유 IP(NAT, VPN)를 사용하는 사용자를 처벌합니다. API 키 제한과 결합하세요.
  4. 버스트 없이 하드 컷오프 — 토큰 버킷은 평균 속도를 유지하면서 작은 버스트를 허용합니다. 순수 고정 윈도우는 너무 경직됩니다.
  5. 내부 API에 속도 제한 없음 — 잘못 동작하는 내부 서비스가 데이터베이스에 연속 장애를 일으킬 수 있습니다. 항상 제한을 두세요.

품질 체크리스트

  • 속도 제한은 분산 저장소(Redis/Valkey)를 사용하며, 인-메모리를 사용하지 않습니다.
  • 모든 응답에 RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset 헤더를 포함합니다.
  • 429 응답에 Retry-After 헤더를 포함합니다.
  • 인증 계층별로 다른 제한을 적용합니다 (무료/프로/엔터프라이즈).
  • 비용이 많이 드는 작업(업로드, 검색)에 대해 엔드포인트별 제한을 둡니다.
  • 카운터 증가에 Lua 스크립트 또는 원자적 파이프라인을 사용합니다 (경쟁 조건 없음).
  • 속도 제한 키에는 ID(API 키)와 범위(엔드포인트)가 모두 포함됩니다.
  • 모니터링 대시보드에서 속도 제한 적중, 거부, 상위 소비자를 확인할 수 있습니다.
  • 정격 저하: 가능한 경우 하드 리젝트 대신 큐에 넣거나 속도를 늦춥니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

curiositech/windags-skills

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

curiositech/windags-skills

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

curiositech/windags-skills

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

curiositech/windags-skills

Implement WCAG 2.2 AA/AAA compliance with automated testing, keyboard navigation, screen reader support, and focus management. Activate on: accessibility audit, WCAG compliance, keyboard navigation, screen reader, aria attributes, axe-core, focus trap. NOT for: design-level accessibility review (use design-accessibility-auditor), color contrast only (use css-in-js-architect).

curiositech/windags-skills

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

curiositech/windags-skills

Designs digital experiences for ADHD brains using neuroscience research and UX principles. Expert in reducing cognitive load, time blindness solutions, dopamine-driven engagement, and compassionate design patterns. Activate on 'ADHD design', 'cognitive load', 'accessibility', 'neurodivergent UX', 'time blindness', 'dopamine-driven', 'executive function'. NOT for general accessibility (WCAG only), neurotypical UX design, or simple UI styling without ADHD context.

curiositech/windags-skills

>- Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

curiositech/windags-skills

Extend and modify the admin dashboard, developer portal, and operations console. Use when adding new admin tabs, metrics, monitoring features, or internal tools. Activates for dashboard development, analytics, user management, and internal tooling.

curiositech/windags-skills

Conversation patterns and interaction protocols for multi-agent systems. Covers request/response, pub/sub, blackboard, delegation chains, debate, critique, consensus, fan-out/fan-in, supervisor-worker, and peer negotiation. Deep analysis of AutoGen conversation patterns, CrewAI delegation, LangGraph state passing, and FIPA-ACL performatives. Teaches how to design what agents say to each other and in what order. Activate on: "agent conversation", "agent protocol", "multi-agent debate", "agent delegation", "supervisor worker pattern", "agent voting", "consensus protocol", "fan-out fan-in", "agent negotiation", "blackboard pattern", "agent dialogue", "conversation topology", "agent handoff". NOT for: wire format or serialization (use agent-interchange-formats), orchestration infrastructure (use agentic-infrastructure-2026), single agent behavior (use agentic-patterns).

curiositech/windags-skills

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use language-specific skills), or infrastructure setup (use deployment-engineer).

curiositech/windags-skills

AI-powered calendar management and agent-based scheduling coordination. Covers calendar APIs (Google Calendar, CalDAV/iCal), AI scheduling assistants (Reclaim, Clockwise, Motion, Cal.com), building custom calendar agents with MCP, multi-calendar merging, timezone management, focus block protection, meeting fatigue detection, and agent-to-agent meeting negotiation protocols. Activate on: "calendar agent", "AI scheduling", "calendar coordination", "meeting scheduling", "calendar API", "focus time protection", "calendar optimization", "Google Calendar MCP", "Reclaim", "Clockwise", "Motion", "Cal.com", "smart scheduling", "calendar-aware agent", "timezone scheduling", "agent negotiation meetings". NOT for: manual calendar UI component design (use form-validation-architect), project management scheduling or Gantt charts (use project-management-guru-adhd), general time-tracking or pomodoro apps (use adhd-daily-planner for time-awareness), building the agent itself from scratch (use agent-creator).

curiositech/windags-skills

Build and adopt production AI agent infrastructure in 2026. Covers framework selection (LangGraph, CrewAI, AutoGen, MCP), orchestration patterns, evaluation, observability, memory systems, and tool use. Also covers the SOCIAL dimension: how to sell agent infrastructure internally, change management, measuring ROI, building trust in autonomous systems, and scaling adoption across teams. Activate on: "agent infrastructure", "agent framework comparison", "which agent framework", "sell AI tools internally", "agent adoption", "agent observability", "agent evaluation", "MCP architecture", "agentic mesh", "enterprise AI agents", "AI change management", "agent ROI". NOT for: building specific agents (use ai-engineer), designing agent behavior patterns (use agentic-patterns), prompt tuning (use prompt-engineer).

curiositech/windags-skills

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

curiositech/windags-skills

Automated discovery and matching of agent skills for dynamic task routing and capability assessment

curiositech/windags-skills

Cryptographic security for agentic systems — zero-trust agent networking, signed message envelopes (JWS/JWE), capability-based security (ocaps), Merkle tree audit trails, WASM sandboxing, and formal verification. Covers CLI dev tool security, mTLS between agents, permission boundaries (least privilege for AI agents), and supply chain security for skills/plugins. Activate on: "agent security", "zero trust agents", "secure agent communication", "capability-based security", "ocap", "signed messages between agents", "agent audit trail", "sandbox agent execution", "agent permissions", "mTLS agents", "cryptographic verification", "agent supply chain", "OWASP agentic", "prove agent did X", "tamper-proof agent logs". NOT for: application-level SAST scanning (use security-auditor), network firewall rules (use infrastructure), SOC2/HIPAA compliance (organizational), or prompt injection defense (use prompt-engineer).

curiositech/windags-skills

Data structures and serialization formats for agent-to-agent communication. Covers message envelopes, structured output schemas, capability declarations, task handoff payloads, error/retry signaling, and context windows as data structures. Deep comparison of A2A protocol, MCP, OpenAI function calling, and LangChain message types. Teaches when to use rigid schemas vs free-form with validation, typed vs untyped, streaming vs batch. Activate on: "agent message format", "agent communication schema", "agent-to-agent protocol", "A2A protocol", "MCP message format", "structured output for agents", "agent interop", "interchange format", "agent serialization", "task handoff format", "capability declaration". NOT for: what agents say to each other (use agent-conversation-protocols), orchestration topology (use multi-agent-coordination), building agent infrastructure (use agentic-infrastructure-2026).

curiositech/windags-skills

Logic-based agent programming language implementing BDI architecture for practical autonomous agent development

curiositech/windags-skills

>- Design AgentSpeak(L)-style BDI agents with context-guarded plans, selection functions, and intention stacks. Use for interruptible autonomy, agent policy, and multi-agent orchestration in dynamic environments. NOT for simple rule engines, static planners, or centralized workflows.

curiositech/windags-skills

Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing

curiositech/windags-skills

license: Apache-2.0 NOT for unrelated tasks outside this domain.

관련 스킬