api-gateway-patterns

api-gateway-patterns is a skill for Claude Code, Codex from camilooscargbaptista/cto-toolkit. It costs 24 tokens per session (1,567 once invoked), scanned A, original, MIT.

A collection of patterns for an API gateway, the service that sits between clients and several backend services. It covers request routing, authentication, rate limiting, load balancing, caching, logging, and circuit breaking.

In plain words
What is it for?
Use it when designing a gateway for microservices, controlling request rates, authenticating clients, routing requests, supporting a backend-for-frontend, or protecting calls to external services.
Why use it?
It helps organize common gateway responsibilities and reduce failures when backend services are slow, unavailable, or receiving too many requests.

Skill for Claude CodeCodex

Part of the cto-toolkit plugin — 54 skills, 6 agents, 3 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/camilooscargbaptista/cto-toolkit/api-gateway-patterns
Any agent
npx skills add camilooscargbaptista/cto-toolkit --skill api-gateway-patterns
Clone the repo
git clone --depth 1 https://github.com/camilooscargbaptista/cto-toolkit

Made for: Claude Code, Codex.

Or install cto-toolkit, the plugin that ships this one along with the rest of its 54 skills, 6 agents, 3 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-gateway-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/camilooscargbaptista/cto-toolkit/api-gateway-patterns.svg)](https://agentmods.dev/skills/camilooscargbaptista/cto-toolkit/api-gateway-patterns)
Your own site
<a href="https://agentmods.dev/skills/camilooscargbaptista/cto-toolkit/api-gateway-patterns"><img src="https://agentmods.dev/badge/skills/camilooscargbaptista/cto-toolkit/api-gateway-patterns.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,567 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.01567
Opus 5 $0.00012 $0.00783
Sonnet 5 $0.00005 $0.00313
Haiku 4.5 $0.00002 $0.00157

Measured 5d ago against content hash e4730607f749, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

api-gateway-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

api-gateway-patterns/SKILL.md · 206 lines

How it starts

The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API Gateway Patterns

When to Use

  • Designing an API gateway for microservices
  • Implementing rate limiting, authentication, or request routing
  • Evaluating BFF (Backend for Frontend) pattern
  • Adding circuit breaking to external service calls

Gateway Architecture

                    ┌─────────────────────┐
                    │    API Gateway       │
                    │                     │
  Clients ────────►│  1. Rate Limiting    │
                    │  2. Authentication   │
                    │  3. Request Routing  │
                    │  4. Load Balancing   │
                    │  5. Circuit Breaking │
                    │  6. Response Caching │
                    │  7. Logging/Tracing  │
                    └────┬────┬────┬──────┘
                         │    │    │
                    ┌────┘    │    └────┐
                    ▼         ▼         ▼
              ┌──────┐  ┌──────┐  ┌──────┐
              │Svc A │  │Svc B │  │Svc C │
              └──────┘  └──────┘  └──────┘

Rate Limiting Patterns

Token Bucket (recommended)

// Allows burst then throttles
const rateLimiter = {
  bucketSize: 100,      // Max tokens
  refillRate: 10,       // Tokens per second
  refillInterval: 1000, // ms
};
// Burst: 100 requests instantly, then 10/sec sustained

Sliding Window

// More accurate, no burst
// Count requests in last N seconds
// Redis implementation:
// ZADD rate:{userId} {timestamp} {requestId}
// ZREMRANGEBYSCORE rate:{userId} 0 {timestamp - window}
// ZCARD rate:{userId}

Rate Limit by Tier

Tier Rate Limit Burst
Free 100 req/hour 10 req/sec
Basic 1000 req/hour 50 req/sec
Pro 10000 req/hour 200 req/sec
Enterprise Custom Custom

Response Headers

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 42
X-RateLimit-Reset: 1619472000
Retry-After: 60

API Versioning Strategies

Strategy Example Pros Cons
URL path /v1/users Simple, clear URL pollution
Header Accept: application/vnd.api.v1+json Clean URLs Hidden, harder to test
Query param /users?version=1 Easy to switch Messy

Read the full file on GitHub · 206 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 206 lines · 24 tokens per session scan A e4730607f749

Subscribe to this mod's changes

api-gateway-patterns is a skill published in the GitHub repository camilooscargbaptista/cto-toolkit (7 stars, last pushed 5mo ago), licensed MIT. It adds 24 tokens to every session and 1,567 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

API Gateway Testing

API gateway testing skill covering rate limiting validation, request routing, authentication proxy testing, load balancing verification, circuit breaker testing, and gateway configuration validation for Kong, Envoy, and AWS API Gateway.

PramodDutta/qaskills · 43 tokens

implementing-api-abuse-detection-with-rate-limiting

Implement API abuse detection using token bucket, sliding window, and adaptive rate limiting algorithms to prevent DDoS, brute force, and credential stuffing attacks.

xalgorix/xalgorix · 43 tokens

implementing-api-gateway-security-controls

Implements security controls at the API gateway layer including authentication enforcement, rate limiting, request validation, IP allowlisting, TLS termination, and threat protection. The engineer configures API gateways (Kong, AWS API Gateway, Azure APIM, Apigee) to act as a centralized security enforcement point…

xalgorix/xalgorix · 106 tokens

securing-api-gateway-with-aws-waf

Securing API Gateway endpoints with AWS WAF by configuring managed rule groups for OWASP Top 10 protection, creating custom rate limiting rules, implementing bot control, setting up IP reputation filtering, and monitoring WAF metrics for security effectiveness.

xalgorix/xalgorix · 59 tokens

river-review-architecture

設計判断の妥当性、アーキテクチャ境界の整合性、データモデルの一貫性を検証する。.

s977043/river-review · 53 tokens

api-gateway-patterns

API Gateway patterns for routing, authentication, rate limiting, and service composition in microservices architectures. Use when implementing API gateways, building BFF layers, or managing service-to-service communication at scale.

NickCrew/Claude-Cortex · 45 tokens