Agent skill

Building API Gateway

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Create API gateways with routing, load balancing, rate limiting, and authentication.

MITAuto-check passedBackend & APIs

Install Building API Gateway

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-api-gateway -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace building-api-gateway --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/building-api-gateway .claude/skills/building-api-gateway && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
building-api-gateway
GitHub stars
2.8k
Token cost
~1.5k tokens
SKILL.md length
591 words
Files
4 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Create API gateways with routing, load balancing, rate limiting, and authentication.

  • Works in 9 steps: Inventory all backend services using… → Define routing rules that map… → Implement authentication at the gateway… → …
  • Routing and managing multiple API services
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Building API Gateway is an agent skill from jeremylongshore/tons-of-skills-marketplace. Create API gateways with routing, load balancing, rate limiting, and authentication. Use when routing and managing multiple API services. Trigger with phrases like "build API gateway", "create API router", or "setup API gateway".

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/errors.md`, `references/examples.md` and `references/implementation.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Microservices and Cloud networking. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Routing and managing multiple API services
  • With phrases like build API gateway
  • Create API router
  • Setup API gateway

Example prompts

  • “build API gateway”
  • “create API router”
  • “setup API gateway”
  • “/building-api-gateway”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Grep, Glob, Bash(api:gateway-*)

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Inventory all backend services using Read and Grep, documenting their base URLs, endpoint paths, authentication requirements, and health…
  2. Define routing rules that map public-facing URL patterns to backend service endpoints: path-based (/users/* -> user-service), header-based…
  3. Implement authentication at the gateway layer: validate JWT tokens, API keys, or OAuth2 tokens once at the gateway and forward…
  4. Add rate limiting at the gateway level with per-consumer quotas, applying limits before requests reach backend services to protect all…
  5. Configure request transformation: strip internal headers from incoming requests, add correlation IDs, rewrite URL paths for backend…
  6. Implement response aggregation for composite endpoints that fan out to multiple backend services, merge responses, and return a unified…
  7. Add circuit breaker protection per backend service: open the circuit after configurable failure thresholds, return 503 with the failed…
  8. Configure health check aggregation: gateway /health endpoint reports overall status based on individual backend service health, with…
  9. Write integration tests covering routing correctness, auth enforcement, rate limiting, circuit breaker behavior, and response aggregation.

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Grep
    • Glob
    • Bash(api:gateway-*)

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • konghq.com
    • express-gateway.io
    • krakend.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Building API Gateway loads about 1.5k tokens when it runs, and up to ~3.4k if it reads all its reference files. Until then it costs about 63 tokens; SKILL.md has 591 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 591 words, ~1,463 tokens.

Download SKILL.mdSave it as .claude/skills/building-api-gateway/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
building-api-gateway
description
Create API gateways with routing, load balancing, rate limiting, and authentication. Use when routing and managing multiple API services. Trigger with phrases like "build API gateway", "create API router", or "setup API gateway".
allowed-tools
Read, Write, Edit, Grep, Glob, Bash(api:gateway-*)
compatibility
Designed for Claude Code
version
1.24.0
author
Jeremy Longshore <jeremy@intentsolutions.io>
license
MIT
tags
api, authentication, api-gateway

Building API Gateway

Overview

Create an API gateway that provides unified entry point routing, load balancing, authentication enforcement, rate limiting, request transformation, and response aggregation across multiple backend microservices. Support path-based and header-based routing, circuit breaker protection for downstream services, and centralized cross-cutting concern management.

Prerequisites

  • Multiple backend API services with known endpoints, health check URLs, and authentication requirements
  • Gateway framework: Express Gateway, Kong (declarative config), KrakenD, or custom Node.js/Go implementation
  • Service registry or static upstream configuration for backend service discovery
  • TLS certificates for gateway termination and optional mTLS for backend communication
  • Centralized logging and metrics collection for gateway-level observability

Instructions

  1. Inventory all backend services using Read and Grep, documenting their base URLs, endpoint paths, authentication requirements, and health check endpoints.
  2. Define routing rules that map public-facing URL patterns to backend service endpoints: path-based (/users/* -> user-service), header-based (X-API-Version: 2 -> v2-service), or method-based routing.
  3. Implement authentication at the gateway layer: validate JWT tokens, API keys, or OAuth2 tokens once at the gateway and forward authenticated user context to backend services via headers (X-User-ID, X-User-Roles).
  4. Add rate limiting at the gateway level with per-consumer quotas, applying limits before requests reach backend services to protect all downstream services uniformly.
  5. Configure request transformation: strip internal headers from incoming requests, add correlation IDs, rewrite URL paths for backend routing, and inject service-specific headers.
  6. Implement response aggregation for composite endpoints that fan out to multiple backend services, merge responses, and return a unified payload to the client.
  7. Add circuit breaker protection per backend service: open the circuit after configurable failure thresholds, return 503 with the failed service identified, and auto-recover after health check success.
  8. Configure health check aggregation: gateway /health endpoint reports overall status based on individual backend service health, with degraded state support for non-critical service failures.
  9. Write integration tests covering routing correctness, auth enforcement, rate limiting, circuit breaker behavior, and response aggregation.

See ${CLAUDE_SKILL_DIR}/references/implementation.md for the full implementation guide.

Output

  • ${CLAUDE_SKILL_DIR}/gateway/config/routes.yaml - Route mapping definitions (path -> service)
  • ${CLAUDE_SKILL_DIR}/gateway/middleware/auth.js - Gateway-level authentication enforcement
  • ${CLAUDE_SKILL_DIR}/gateway/middleware/rate-limiter.js - Centralized rate limiting
  • ${CLAUDE_SKILL_DIR}/gateway/middleware/circuit-breaker.js - Per-service circuit breaker
  • ${CLAUDE_SKILL_DIR}/gateway/middleware/transform.js - Request/response transformation logic
  • ${CLAUDE_SKILL_DIR}/gateway/aggregators/ - Response aggregation for composite endpoints
  • ${CLAUDE_SKILL_DIR}/gateway/health.js - Aggregated health check endpoint
  • ${CLAUDE_SKILL_DIR}/tests/gateway/ - Gateway integration test suite
Show full SKILL.md (228 more words)Show less

Error Handling

ErrorCauseSolution
502 Bad GatewayBackend service returned invalid response or connection refusedReturn descriptive error identifying the failed backend; trigger circuit breaker if threshold met
503 Circuit OpenBackend service circuit breaker is open due to repeated failuresReturn Retry-After header; serve cached response if available; route to fallback service if configured
504 Gateway TimeoutBackend service response exceeded gateway timeout thresholdConfigure per-route timeout limits; implement timeout cascading shorter than client timeout
Routing missRequest path does not match any configured routeReturn 404 with list of available API paths; log unmatched routes for route configuration review
Auth header strippingProxy strips Authorization header before forwarding to backendConfigure gateway to preserve or transform auth headers; verify proxy proxy_pass_header settings

Refer to ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error patterns.

Examples

Microservices gateway: Route /users/* to user-service (port 3001), /orders/* to order-service (port 3002), and /products/* to product-service (port 3003), with unified JWT validation and per-service circuit breakers.

BFF (Backend for Frontend): Gateway aggregates data from user-service, preferences-service, and notification-service into a single /dashboard response, reducing frontend API calls from 3 to 1.

API versioning gateway: Route requests to different backend deployments based on Accept-Version header, enabling blue-green deployments and gradual version migration without client-side URL changes.

See ${CLAUDE_SKILL_DIR}/references/examples.md for additional examples.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/.curated/building-api-gateway of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/errors.md
  • references/examples.md
  • references/implementation.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Building API Gateway next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Building API Gateway compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Building API Gateway this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.5kAutomated safety check: PassMIT
Intrinsic Core Service Authoringintrinsic-ai/intrinsic-core562—~2.2kAutomated safety check: PassApache-2.0
LLM Gatewaysickn33/agentic-awesome-skills47k1 repos~2.1kAutomated safety check: PassMIT
Google Cloud Solution N Tier Serverless Web Appgoogle/skills21k—~5.5kAutomated safety check: PassApache-2.0
System Designninehills/skills280—~4.7kAutomated safety check: PassMIT
System Designwondelai/skills2.4k—~4kAutomated safety check: PassMIT

Similar skills

  • Intrinsic Core Service Authoring

    intrinsic-ai/intrinsic-core

    Intrinsic Core microservice authoring, ServiceManifest definitions (realspec vs simspec), RuntimeContext port bindings (gRPC port 1 vs HTTP port 7), SIGTERM lifecycle handling, and .binpb sideloading.

    562 GitHub stars~2.2k tokensUpdated today
    Backend & APIsAuto-check passed
  • LLM Gateway

    sickn33/agentic-awesome-skills

    Deploy an API gateway for LLM traffic with load balancing, rate limiting, key management, semantic caching, fallback routing, and cost tracking.

    47k GitHub starsUsed in 1 repo~2.1k tokens
    Backend & APIsAuto-check passed
  • Assists in designing and implementing secure n-tier serverless web applications and microservices on Google Cloud.

    21k GitHub stars~5.5k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • System Design

    ninehills/skills

    Design scalable distributed systems using structured approaches for load balancing, caching, database scaling, and message queues.

    280 GitHub stars~4.7k tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • System Design

    wondelai/skills

    Design scalable distributed systems using structured approaches for load balancing, caching, database scaling, and message queues.

    2.4k GitHub stars~4k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Microservice API Endpoint Routing 404

    divinevideo/divine-mobile

    Debug 404 errors for API endpoints in microservice architectures where code exists but routing sends requests to wrong service.

    266 GitHub stars~1k tokensUpdated yesterday
    Backend & APIsAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Categories

Questions about Building API Gateway

What does Building API Gateway do?

Create API gateways with routing, load balancing, rate limiting, and authentication. Building API Gateway is an agent skill from jeremylongshore/tons-of-skills-marketplace. Create API gateways with routing, load balancing, rate limiting, and authentication.

When should I use Building API Gateway?

Building API Gateway fits situations like: routing and managing multiple API services; with phrases like build API gateway; create API router; setup API gateway.

How do I install Building API Gateway in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-api-gateway -a claude-code`. Or copy the skill folder (skills/.curated/building-api-gateway in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/building-api-gateway in your project. Claude Code loads it when a task matches its description.

How do I install Building API Gateway in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-api-gateway -a codex`. Or copy the skill folder (skills/.curated/building-api-gateway in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/building-api-gateway in your project. Codex loads it when a task matches its description.

Can I use Building API Gateway in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill building-api-gateway -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/building-api-gateway, .gemini/skills/building-api-gateway, .github/skills/building-api-gateway and .opencode/skills/building-api-gateway in your project.

What does Building API Gateway need to run?

SKILL.md names no scripts, command-line tools or credentials: Building API Gateway is instructions for the agent only. Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Grep, Glob, Bash(api:gateway-*). Compatibility (from SKILL.md): Designed for Claude Code.

Does Building API Gateway access the network?

SKILL.md names 3 domains. As links in the text: konghq.com, express-gateway.io and krakend.io. This is read from the text; nothing was executed.

Is Building API Gateway safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Building API Gateway use?

Building API Gateway is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Building API Gateway use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.9k tokens, read only when the agent opens those files.

What are the alternatives to Building API Gateway?

Skills that share tags, products or a category with Building API Gateway: Intrinsic Core Service Authoring (intrinsic-ai/intrinsic-core, 562 stars), LLM Gateway (sickn33/agentic-awesome-skills, 47k stars), Google Cloud Solution N Tier Serverless Web App (google/skills, 21k stars) and System Design (ninehills/skills, 280 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Building API Gateway?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.