Token导航 LogoToken导航

Agent Skill · 开发

api-gateway(API gateway 文档)

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

api-gateway 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 14,329。

总安装 717周安装 29GitHub Stars 634下载 225核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:api-gateway(API gateway 文档)
来源仓库:https://github.com/awslabs/agent-plugins
仓库路径:skills/api-gateway
安装命令:
npx skills add https://github.com/awslabs/agent-plugins --skill api-gateway
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/awslabs/agent-plugins --skill api-gateway

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

协助设计 RESTful、HTTP 和 WebSocket 类型的 API 网关接口规范。适合生成 OpenAPI 文档、定义鉴权机制和错误响应格式。输出包含请求/响应示例、分页逻辑和限流策略的完整接口说明。建议结合现有业务代码提取真实字段,避免虚构数据结构。

api-gateway 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/api-gateway

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/awslabs/agent-plugins --skill api-gateway;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

api-gateway 怎么安装?

在终端执行 npx skills add https://github.com/awslabs/agent-plugins --skill api-gateway。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

api-gateway 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

api-gateway 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

api-gateway 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

api-gateway 用的人多吗?

公开数据是累计安装 717 次,近一周安装 29 次,下载 225 次,GitHub 634 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

api-gateway 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
api-gateway

API gateway 文档 · 本页

717634需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Amazon API Gateway Development

Expert guidance for building, managing, governing, and operating APIs with Amazon API Gateway. Covers REST APIs (v1), HTTP APIs (v2), and WebSocket APIs.

How to Use This Skill

When answering API Gateway questions:

  1. Read the relevant reference file(s) before responding, do not rely solely on this summary
  2. For tasks spanning multiple concerns (e.g., "private API with mTLS and custom domain"), read all relevant references
  3. When the user needs IaC templates, consult references/sam-cloudformation.md or references/sam-service-integrations.md and provide complete, working SAM/CloudFormation YAML
  4. Always mention relevant pitfalls and limits that affect the user's design

Quick Decision: Which API Type?

Choose the right API type first. This decision affects every downstream choice.

REST API is the full-featured API management platform for enterprises. It provides the governance, security, monetization, and operational controls that organizations need to build, publish, and manage APIs at scale, including usage plans with per-consumer throttling and quotas, API keys, request validation, WAF integration, resource policies, caching, canary deployments, and private endpoints.

HTTP API is the lightweight, low-cost proxy optimized for simpler API workloads. It offers ~70% lower cost and lower latency but trades away the API management features. Choose HTTP API when you need a fast, lightweight proxy to Lambda or HTTP backends and don't require the enterprise controls above.

FactorREST API (v1)HTTP API (v2)WebSocket API
PositioningFull API managementLow-cost proxyReal-time bidirectional
CostHigher~70% cheaperPer-message pricing
LatencyHigherLowerPersistent connection
Max timeout50ms-29s (up to 300s Regional/Private)30s hard limit29s
Payload10 MB10 MB128 KB message / 32 KB frame
API Management
Usage plans/API keysYesNoNo
Request validationYes (JSON Schema draft 4)NoNo
CachingYes (0.5-237 GB)NoNo
Custom gateway responsesYesNoNo
VTL mapping templatesYesNo (parameter mapping only)Yes
Security & Governance
WAFYesNo (use CloudFront + WAF)No
Resource policiesYesNoNo
Private endpointsYesNoNo
mTLSYes (Regional custom domain only)Yes (Regional custom domain only)Via CloudFront viewer mTLS
Auth
Lambda authorizerYes (TOKEN + REQUEST)Yes (REQUEST only, simple + IAM policy format)Yes (REQUEST on $connect only)
JWT authorizerNo (use Cognito authorizer)Yes (native)No
Cognito authorizerYes (native)Use JWT authorizerNo
Operations
Canary deploymentsYesNoNo
Response streamingYesNoNo
X-Ray tracingYesNoNo
Execution loggingYesNoYes
Custom domain sharingNot with WebSocketNot with WebSocketNot with REST/HTTP

Use REST API when: you are building APIs for external consumers, partners, or multi-tenant platforms; need to enforce per-consumer rate limits and quotas; require request validation, caching, or WAF at the API layer; need private endpoints, resource policies, or canary deployments; or are building an API product with monetization and governance requirements.

Use HTTP API when: you are building lightweight APIs or simple backend proxies; cost and latency are the primary concerns; you don't need per-consumer throttling, request validation, caching, or WAF at the API layer; and native JWT authorization with OIDC/OAuth 2.0 meets your auth needs. Accept the hard 30s timeout and lack of API management features. For WAF, edge caching, or edge compute, place a CloudFront distribution in front of the HTTP API.

Use WebSocket API when you need: persistent bidirectional connections for real-time use cases (chat, notifications, live dashboards).

Instructions

Step 1: Design the API

Before implementation, gather requirements systematically. Consult references/requirements-gathering.md for the full requirements workflow covering endpoints, auth, data models, performance, security, and deployment needs.

Key design decisions:

  1. API type: Use the decision table above
  2. Endpoint type: Edge-optimized (default for global clients; optimizes TCP connections via CloudFront POPs but does not cache at the edge), Regional (same-region clients, or global clients needing their own CloudFront distribution for edge caching, edge compute, granular WAF control, or geo-based routing), Private (VPC-only access, REST API only)
  3. Topology: Centralized (single domain, path-based routing) vs Distributed (subdomains per service)
  4. Authentication: See references/authentication.md for the decision tree

Step 2: Implement the API

Consult these references based on what you're building:

  • Architecture patterns: references/architecture-patterns.md: topology, multi-tenant SaaS, hybrid workloads, private APIs, multi-region, streaming
  • WebSocket API: references/websocket.md: route selection, @connections management, session management, client resilience, SAM templates, limits, multi-region
  • Service integrations: references/service-integrations.md: direct AWS service integrations (EventBridge, SQS, SNS, DynamoDB, Kinesis, Step Functions, S3), HTTP proxy, mock, VTL mapping templates, binary media types, Lambda sync/async invocation
  • Custom domains and routing: references/custom-domains-routing.md: base path mappings, routing rules, header-based versioning
  • Security: references/security.md: mTLS (API Gateway native + CloudFront viewer mTLS), TLS policies, resource policies, WAF, HttpOnly cookies, CRL checks
  • SAM/CloudFormation: references/sam-cloudformation.md: IaC patterns, OpenAPI extensions, VTL reference, binary data
  • SAM service integration templates: references/sam-service-integrations.md: EventBridge, SQS, DynamoDB CRUD, Kinesis, Step Functions (REST + WebSocket) templates

Step 3: Configure Performance and Scaling

  • Throttling: Account-level default is 10,000 rps / 5,000 burst (adjustable; request increases via AWS Support). Configure stage-level and method-level throttling via usage plans. See references/performance-scaling.md
  • Caching (REST only): Default TTL 300s, max 3600s. Only GET methods cached by default. Max cached response 1 MB
  • Edge caching (all API types): For edge caching, place a self-managed CloudFront distribution in front of a Regional API. CloudFront reduces latency, backend load, AND cost (cached responses never reach API Gateway). Also enables edge compute (CloudFront Functions, Lambda@Edge) and granular cache behaviors per path. Use a Regional endpoint, not edge-optimized, when pairing with your own CloudFront distribution
  • Scaling: API Gateway scales automatically but plan the entire stack (Lambda concurrency, DynamoDB capacity)

Step 4: Set Up Observability

Always configure access logging. For REST and WebSocket APIs, also enable execution logging (ERROR level for production, INFO only for debugging). HTTP API does not support execution logging; use access logs with enhanced observability variables instead.

Consult the observability references based on what you need:

  • Logging setup, log formats, retention: references/observability-logging.md
  • Metrics, alarms, metric filters, X-Ray tracing: references/observability-metrics-alarms.md
  • Log analysis and insights, analytics pipeline, cross-account, control plane logs: references/observability-analytics.md

Step 5: Deploy

  • Use Infrastructure as Code (SAM, CDK, CloudFormation, Terraform) for production
  • Canary deployments (REST only): Route a percentage of traffic to test new versions
  • Blue/green deployments: Use custom domain API mappings to switch between environments with zero downtime
  • Routing rules (preferred for new domains): Declarative header/path-based routing on custom domains for versioning, A/B testing, gradual rollouts, and cell-based routing
  • See references/deployment.md for detailed patterns

Step 6: Apply Governance

For organization-wide API standards, see references/governance.md covering:

  • Preventative controls (SCPs, IAM policies)
  • Proactive controls (CloudFormation Hooks, Guard rules)
  • Detective controls (AWS Config rules, EventBridge)
  • Specific enforcement examples for security, observability, and management

Response Format

When responding to API Gateway questions, structure your answer as:

  1. Recommendation: Lead with the recommended approach and why
  2. Code: Include SAM/CloudFormation YAML or code when the user needs implementation (always read the relevant reference file first)
  3. Pitfalls: Warn about relevant gotchas from the pitfalls below or from references/pitfalls.md
  4. Limits: Mention any service limits that constrain the design

Troubleshooting Quick Reference

When diagnosing API Gateway errors, consult references/troubleshooting.md for detailed resolution steps. Here are the most common issues:

ErrorMost Common CauseQuick Fix
400 Bad RequestProtocol mismatch (HTTP/HTTPS) with ALBMatch protocol to listener type
401 UnauthorizedWrong token type (ID vs access) or missing identity sourcesCheck token type matches scope config; verify all identity sources sent
403 Missing Auth TokenStage name in URL when using custom domainRemove stage name from URL path
403 from VPCPrivate DNS on VPC endpoint intercepts ALL API callsUse custom domain names for public APIs
403 Access DeniedResource policy + auth type mismatch or missing redeploymentReview policy, check auth type, redeploy API
403 mTLSCertificate issuer not in truststore or weak signature algorithmVerify CA in truststore, use SHA-256+
429 Too Many RequestsAccount/stage/method throttle limits exceededImplement jittered exponential backoff; request limit increase
500 Internal ErrorMissing Lambda invoke permission (especially with stage variables)Add resource-based policy to Lambda function
502 Bad GatewayLambda response not in required proxy formatReturn {statusCode, headers, body} from Lambda
504 TimeoutBackend exceeds 29s (REST, increasable) or 30s (HTTP, hard). HTTP API body says "Service Unavailable" but status is 504Optimize backend, request timeout increase (REST Regional/Private), or switch to async invocation
CORS errorsMissing CORS headers on Gateway Responses (4XX/5XX)Add CORS headers to DEFAULT_4XX and DEFAULT_5XX gateway responses
SSL/PKIX errorsIncomplete certificate chain on backendProvide full cert chain; use insecureSkipVerification only for testing

Critical Pitfalls

  1. REST API default timeout is 29 seconds (increasable up to 300s for Regional/Private endpoints via quota request). Lambda continues running but client gets 504. Request a timeout increase, or consider async patterns (SQS, EventBridge) for better user experience on long operations
  2. HTTP API hard timeout is 30 seconds. Returns {"message":"Service Unavailable"} while Lambda continues
  3. /ping and /sping are reserved paths. Do not use for API resources
  4. Execution log events truncated at 1,024 bytes. Use access logs for complete data
  5. 413 REQUEST_TOO_LARGE is the only gateway response that cannot be customized. Use DEFAULT_4XX as a catch-all to add CORS headers for all 4xx errors including 413
  6. maxItems/minItems not validated in REST API request validation
  7. Root-level security in OpenAPI is ignored. Must set per-operation
  8. JWT authorizer public keys cached 2 hours. Account for this in key rotation
  9. Management API rate limit: 10 rps / 40 burst. Heavy automation can hit this
  10. Always redeploy REST API after configuration changes. Changes don't take effect until deployed
  11. Edge-optimized endpoints do NOT cache at the edge — they only optimize TCP connections via CloudFront POPs. If you need edge caching, edge compute (CloudFront Functions, Lambda@Edge), or granular CloudFront control, use a Regional API with your own CloudFront distribution instead

For additional pitfalls (header handling, URL encoding, caching charges, canary deployments, usage plans), see references/pitfalls.md.

IaC Framework Selection

Default: CDK TypeScript

Override syntax:

  • "use SAM" → Generate SAM/CloudFormation YAML templates
  • "use CloudFormation" → Generate CloudFormation YAML templates
  • "use Terraform" → Generate Terraform HCL

When not specified, ALWAYS use CDK TypeScript.

Error Scenarios

MCP Server Unavailable

  • Inform user: "AWS Serverless MCP not responding"
  • Ask: "Proceed without MCP support?"
  • DO NOT continue without user confirmation

Service Limits Quick Reference

See references/service-limits.md for the complete table. Most numeric quotas below are default values and adjustable; check with your AWS account team and the latest quotas page before using them for architectural decisions. Key limits:

ResourceREST APIHTTP APIWebSocket
Payload size10 MB10 MB128 KB
Integration timeout50ms-29s (up to 300s Regional/Private)30s hard29s
APIs per region600 Regional/Private; 120 Edge-optimized600600
Stages per API101010
Routes/resources per API300300300
Custom domains (public)120120120
Account throttle10,000 rps / 5,000 burstSameSame (shared quota)
API keys per region10,000N/AN/A
Usage plans per region300N/AN/A
Cache sizes0.5 GB - 237 GBN/AN/A

平台分布

Codex

36.46%
按下载量换算82

Claude

27.22%
按下载量换算61

Cursor

18.7%
按下载量换算42

Gemini CLI

8.96%
按下载量换算20

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills