API Gateway Throttle Optimizer
What this skill does
Translates an API Gateway's configuration and traffic patterns into a
concrete throttle and cost-optimization recommendation with a dollar-
denominated savings estimate. The verdict is the highest-leverage action
across seven dimensions — API type selection, throttle tuning, usage
plans, response caching, payload optimization, WAF/VPC endpoint overhead,
and data transfer — applied in priority order. Always pairs the
recommendation with exact CLI commands.
Quick navigation
| Section |
What it covers |
When to jump here |
| Quick start |
Five headline rules and the cost formula |
First read |
| Mindset |
Why API type is the #1 cost lever |
Understanding the approach |
| Quick reference — verdict thresholds |
Decision matrix at a glance |
Classifying an API |
| Pre-flight data gate |
CloudWatch metrics, stage config |
Before any recommendation |
| Step 0 non-obvious behaviours |
REST vs HTTP feature gaps, WAF, caching |
Edge cases |
| Step 1 API type selection |
REST to HTTP migration (3x cheaper) |
The headline savings dimension |
| Step 2 Throttle tuning |
Rate/burst, method vs stage level |
Noisy-neighbor protection |
| Step 3 Usage plans + API keys |
Per-client rate limiting |
Multi-client APIs |
| Step 4 Response caching |
TTL tuning, cache hit ratio |
Repeated-call workloads |
| Step 5 Payload optimization |
Compression, field filtering |
Large-payload APIs |
| Step 6 WAF / VPC endpoint cost |
Overhead analysis |
Private/protected APIs |
| Step 7 Impact estimation |
The cost formula and worked math |
Every recommendation |
| Output format |
VERDICT block + worked examples |
Emitting the result |
| Anti-Patterns — NEVER |
Common misclassifications |
Self-check before emit |
| Pre-flight safety checks |
CONFIRM gate, deployment safety |
Before any apply CLI |
Quick start
- API type is the #1 cost lever. REST API charges $3.50/M requests;
HTTP API charges $1.00/M requests (us-east-1). If the workload is
proxy-only (Lambda proxy, HTTP proxy, VPC Link), HTTP API is 3.5x
cheaper. REST API is only needed for request validation, mapping
templates, API Gateway features not in HTTP API.
- Cost formula (memorise this):
monthly_cost = (monthly_requests / 1,000,000) × $api_type_rate
where REST = $3.50/M and HTTP = $1.00/M (us-east-1).
- Caching eliminates 50-80% of integration calls. Response caching
($0.02/hour per GB) intercepts repeated identical requests at the API
Gateway layer. The backend (Lambda, ECS) never sees cached requests —
no compute cost for those calls.
- Usage plans prevent noisy-neighbor throttling. Without per-client
usage plans, a single aggressive client can consume the entire account-
level throttle quota. Usage plans + API keys enforce per-client rate
limits.
- WAF adds $5/rule/month + $1/M requests inspected. For low-traffic
APIs, WAF cost can exceed API Gateway cost. Evaluate WAF necessity per
stage.
Mindset
Mindset — an API-type and caching exercise, not a throttle-tuning exercise; four principles (API type is the biggest lever, caching is the second, throttle limits are protection not cost, payload size affects transfer cost): references/advanced-patterns.md.
Quick reference — verdict thresholds
| Observation (14-30 day window) |
Verdict |
Recommendation |
| REST API AND no REST-only features used (no mapping templates, no request validation, no method-level auth) AND proxy-only integration |
FURTHER_OPTIMIZATION_AVAILABLE (type) |
Step 1 — migrate to HTTP API (71% request cost reduction) |
| Caching disabled AND > 50% of requests are idempotent GETs with repeating params AND backend IntegrationLatency > 50 ms |
FURTHER_OPTIMIZATION_AVAILABLE (caching) |
Step 4 — enable stage-level caching with TTL |
| No usage plans AND > 3 distinct clients AND 4xx throttle errors > 1% of Count |
FURTHER_OPTIMIZATION_AVAILABLE (usage plans) |
Step 3 — create per-client usage plans with API keys |
| Payload avg > 100 KB AND compression disabled |
FURTHER_OPTIMIZATION_AVAILABLE (payload) |
Step 5 — enable gzip compression, filter response fields |
| WAF enabled AND request volume < 10M/month AND no compliance requirement |
FURTHER_OPTIMIZATION_AVAILABLE (WAF) |
Step 6 — evaluate WAF cost vs benefit |
| Private API via VPC endpoint AND < 1M requests/month |
FURTHER_OPTIMIZATION_AVAILABLE (VPC endpoint) |
Step 6 — evaluate VPC endpoint cost vs public API + auth |
| Account-level throttle only AND single client consuming > 80% of capacity |
FURTHER_OPTIMIZATION_AVAILABLE (throttle) |
Step 2 — set per-client throttle via usage plan |
| All dimensions verified AND no further savings-bearing action |
OPTIMIZED |
Continue monitoring |
| Metrics absent or window < 14 days |
NEED_MORE_INFO |
Pull 14-30 day CloudWatch data, re-evaluate |
Pre-flight: data gate (run before any optimization decision)
Optimization decisions are only as good as the underlying data. Pull
these metrics before any recommendation. Full CLI sequences are in
references/apigateway-pricing-and-throttle-reference.md.
Required data sources (summarized — see reference for full CLI):
- API configuration:
aws apigateway get-rest-apis / get-apis (HTTP)
- Stage configuration:
aws apigateway get-stages (throttle, cache)
- Usage plans:
aws apigateway get-usage-plans
- Resources/methods:
aws apigateway get-resources (auth, integration
type, method-level throttle)
- CloudWatch metrics (14-30 day):
aws cloudwatch get-metric-statistics
- Cost data:
aws ce get-cost-and-usage filtered by Service=APIGateway
Data-quality short-circuits
| Condition |
Effect on optimization |
Count metric absent (API never called) |
NEED_MORE_INFO. Verify stage deployment; skip until traffic exists. |
Count Sum = 0 over 14 days |
Emit OPTIMIZED with note "dormant API." |
| Observation window < 14 days |
NEED_MORE_INFO. Minimum 14 days; 30 days preferred. |
IntegrationLatency absent |
Fall back to Latency only; mark caching recommendation MEDIUM confidence. |
| Stage not deployed (no deployment) |
Surface as BLOCKED — API has no active deployment. |
| Cannot distinguish REST vs HTTP from API config |
Use get-rest-apis (REST) vs get-apis (HTTP) — they are separate API surfaces. |
When CloudWatch and Cost Explorer disagree, CloudWatch Count is the
source of truth (Cost Explorer may aggregate across APIs without
per-API tags).
Process — Optimization logic (apply in order)
Step 0: Non-obvious behaviours that change the recommendation
Step 0 non-obvious behaviours (REST/HTTP are different services, HTTP API feature gaps, REST-only stage caching, cache TTL vs capacity, usage plans require API keys, WAF per-rule and per-request cost, VPC endpoint hourly cost, DTO billing on response payload, account-level throttle scope, Lambda reserved concurrency returns 502, most-specific throttle wins): references/advanced-patterns.md.
Step 1: API type selection (REST to HTTP migration)
REST API ($3.50/M) vs HTTP API ($1.00/M). For proxy-only workloads
(Lambda proxy integration, HTTP proxy, VPC Link), HTTP API is 3.5x
cheaper and simpler.
Migration checklist:
| REST feature in use? |
Blocks HTTP API migration? |
| Lambda proxy integration |
NO — fully supported on HTTP API |
| HTTP proxy integration |
NO — fully supported |
| VPC Link integration |
NO — supported on HTTP API |
| Mapping templates (Velocity) |
YES — HTTP API has no mapping templates |
| Request validation (schema) |
YES — HTTP API has no request validation |
| Method-level authorization (Lambda authorizer) |
Partially — HTTP API supports JWT authorizers but not custom Lambda authorizers (added 2025 in select regions) |
| API Gateway-managed CORS |
YES — HTTP API has built-in CORS config, different model |
| Client certificates to backend |
YES — HTTP API does not support mutual TLS to backend (as of 2026) |
| Stage-level caching |
YES — HTTP API has no response caching |
| WAF Web ACL attachment |
Partially — HTTP API WAF support added 2024, REST API fully supported |
Decision gate:
| REST features in use |
Can migrate to HTTP? |
Verdict |
| Lambda proxy only |
YES |
FURTHER_OPTIMIZATION_AVAILABLE |
| Proxy + request validation |
NO (validation is REST-only) |
Not recommended; stay on REST |
| Proxy + mapping templates |
NO |
Not recommended; stay on REST |
| Proxy + stage caching |
Evaluate: cache savings vs type savings |
Run Step 4 first, then re-evaluate |
| Savings math (monthly_requests / 1M × $2.50): references/apigateway-pricing-and-throttle-reference.md — Step 1. |
|
|
Step 2: Throttle tuning (rate and burst limits)
Throttle tuning is primarily about availability protection, not cost.
The one cost impact: tighter throttles prevent cost runaway from
unauthorized traffic spikes.
Stage-level vs method-level:
| Throttle level |
Scope |
When to use |
| Account-level (default) |
All APIs in region |
Last-resort cap |
| Stage-level |
All methods in a stage |
Per-environment protection |
| Method-level |
Single method |
Per-endpoint tuning (e.g., expensive POST vs cheap GET) |
| Backend-capacity throttle math (max_rate = backend_max_concurrent / avg_integration_latency_s) and update-stage CLI: references/apigateway-pricing-and-throttle-reference.md — Step 2. |
|
|
Step 3: Usage plans + API keys (per-client throttling)
Usage plans enforce per-client rate and burst limits. Without them, a
single client can consume the entire stage/account throttle quota.
Decision gate:
| Condition |
Verdict |
Action |
| > 3 distinct clients AND no usage plans |
FURTHER_OPTIMIZATION_AVAILABLE |
Create usage plan per client tier |
| 1 client (internal service) |
No finding |
Usage plan adds overhead without benefit |
| Usage plans exist AND 4xx throttle rate < 0.1% |
No finding |
Per-client throttling is effective |
Usage plan tiers (example):
| Tier |
Rate |
Burst |
Quota |
Target |
| Free |
5 rps |
10 |
1M/month |
Trial users |
| Pro |
50 rps |
100 |
50M/month |
Paid customers |
| Enterprise |
500 rps |
1000 |
Unlimited |
Enterprise contracts |
aws apigateway create-usage-plan-key \
--usage-plan-id <plan-id> \
--key-id <api-key-id> \
--key-type API_KEY
Step 4: Response caching (TTL tuning)
Response caching is the single most effective cost reducer for read-
heavy APIs. Cache intercepts identical requests at the API Gateway layer;
the backend never sees cached requests.
REST-only feature. HTTP API does not support response caching (as
of 2026).
Cache cost vs benefit math (cache_cost = GB × $0.02 × 730; backend_saving = cached × cost/request): references/apigateway-pricing-and-throttle-reference.md — Step 4.
Decision gate:
| Condition |
Verdict |
Action |
| Caching disabled AND > 50% idempotent GETs AND IntegrationLatency > 50 ms |
FURTHER_OPTIMIZATION_AVAILABLE |
Enable stage-level caching |
| Caching enabled AND cache hit rate < 20% |
FURTHER_OPTIMIZATION_AVAILABLE |
Increase TTL or reduce cache scope to high-hit methods |
| Caching enabled AND cache hit rate > 50% |
No finding |
Cache is effective |
| TTL tuning guidance (300s default; 3600 catalog; 86400 config; 0 user-specific) and caching update-stage CLI: references/apigateway-pricing-and-throttle-reference.md — Step 4. |
|
|
Step 5: Payload optimization (compression and field filtering)
Large payloads increase data transfer cost and latency. API Gateway does
NOT compress responses by default; the backend or CloudFront must handle
gzip.
Compression math (gzip ratio ~0.3 on JSON): references/apigateway-pricing-and-throttle-reference.md — Step 5.
Decision gate:
| Condition |
Verdict |
Action |
| Avg payload > 100 KB AND compression disabled |
FURTHER_OPTIMIZATION_AVAILABLE |
Enable gzip at backend or CloudFront |
| Response includes unused fields (over-fetching) |
FURTHER_OPTIMIZATION_AVAILABLE |
Implement field filtering (GraphQL or sparse fieldsets) |
| Avg payload < 10 KB |
No finding |
Compression overhead not justified |
| Enable-gzip CLI (minimumCompressionSize=1024; backend must send Content-Encoding: gzip): references/apigateway-pricing-and-throttle-reference.md — Step 5. |
|
|
Step 6: WAF and VPC endpoint cost analysis
WAF cost math ((rules × $5/month) + (requests_inspected / 1M × $1)): references/apigateway-pricing-and-throttle-reference.md — Step 6.
VPC endpoint cost math (($0.01 × 730 hours) + (data_transfer_GB × $0.01)): references/apigateway-pricing-and-throttle-reference.md — Step 6.
Decision gate:
| Condition |
Verdict |
Action |
| WAF enabled AND < 10M requests/month AND no compliance mandate |
FURTHER_OPTIMIZATION_AVAILABLE |
Evaluate WAF cost vs security benefit |
| Private API via VPC endpoint AND < 1M requests/month |
FURTHER_OPTIMIZATION_AVAILABLE |
Evaluate public API + IAM/Cognito auth as alternative |
| WAF enabled AND > 100M requests/month AND compliance required |
No finding |
WAF is justified |
Step 7: Impact estimation
Compute the monthly savings for each recommendation:
current_monthly_cost =
(monthly_requests / 1M) × $api_type_rate
+ cache_cost (if enabled)
+ waf_cost (if enabled)
+ vpc_endpoint_cost (if private API)
+ data_transfer_cost (payload_GB × $0.09/GB)
projected_monthly_cost =
(projected_requests / 1M) × $projected_api_type_rate
+ projected_cache_cost
+ projected_waf_cost
+ projected_vpc_endpoint_cost
+ projected_data_transfer_cost
monthly_saving = current_monthly_cost - projected_monthly_cost
Always state assumptions: monthly request count, API type (current and
proposed), cache hit ratio, payload size, pricing region.
Step 8: Final verdict
- Any dimension recommends a change → FURTHER_OPTIMIZATION_AVAILABLE.
- All dimensions pass AND API is optimally configured → OPTIMIZED.
- Change applied and verified this session → OPTIMIZED (with post-
state verification note).
- Data insufficient (metrics absent, window < 14 days) →
NEED_MORE_INFO.
Output format
Output template block (identical labels to the Required output structure below): references/worked-examples.md.
Full worked examples in references/worked-examples.md.
STRICT output contract
The rules below are hard constraints. Violating any one produces a
misclassification or an arithmetic contradiction that breaks downstream
FinOps automation. Self-check EVERY emitted block against these rules
before returning the response.
Required output structure
Every response MUST be a single block using these literal labels, in this
order. Do NOT substitute markdown headings, camelCase, or bold variants.
TARGET: <api-name>
VERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE
REASON: <1-2 sentences naming the recommendation and the supporting data>
RECOMMENDATION:
Current: <api type>, <throttle>, <cache>, <usage plans>, <payload>
Proposed: <api type>, <throttle>, <cache>, <usage plans>, <payload>
Dimensions changed: <api-type | throttle | usage-plans | caching | payload | waf | vpc-endpoint>
Dimensions checked: <list ALL seven, each ✓ (no finding) or → (finding)>
Confidence: <HIGH/MEDIUM/LOW> — <one-line rationale>
ESTIMATED_SAVINGS:
Current monthly: $<amount> ← MUST show breakdown subtotals
Projected monthly: $<amount>
Monthly saving: $<amount> ← MUST equal Current − Projected, 2 decimals
Annual saving: $<amount> ← MUST equal Monthly × 12
MIGRATION_STEPS:
1. <specific action with CLI command>
2. <verification step>
CONFIRM: <confirmation prompt text>
FORBIDDEN output patterns
NEVER emit VERDICT: FURTHER_OPTIMIZATION_AVAILABLE with
Monthly saving: $0.00. If every dimension nets zero cost delta,
the verdict MUST be OPTIMIZED.
NEVER show savings math that does not balance.
Current monthly − Projected monthly MUST equal Monthly saving,
rounded to 2 decimal places.
NEVER emit scratch lines ("WAIT — recompute", "corrected:") in
the output. Finalize the math before emitting.
NEVER recommend REST-to-HTTP migration without verifying no REST-
only features are in use. Mapping templates, request validation,
and stage caching are REST-only. The REASON MUST name the feature
check.
NEVER omit a dimension from the RECOMMENDATION block. The
Dimensions checked line MUST list all seven dimensions, each marked
✓ (no finding) or → (finding).
NEVER recommend response caching on an HTTP API. HTTP API does
not support response caching (as of 2026). Recommend CloudFront or
backend caching instead.
NEVER round intermediate formula steps differently from the final
figure. Compute at full precision, round only the displayed result.
Perfect example output — FURTHER_OPTIMIZATION_AVAILABLE with verified math
TARGET: product-catalog-api
VERDICT: FURTHER_OPTIMIZATION_AVAILABLE
REASON: REST API used purely as a Lambda proxy (no mapping templates, no
request validation, no stage caching). HTTP API supports Lambda proxy
integration at $1.00/M vs REST $3.50/M (71% reduction). Additionally,
caching is disabled but 70% of requests are idempotent GETs to a
catalog that changes hourly — caching would eliminate 50% of backend
calls. No REST-only features block migration.
RECOMMENDATION:
Current: REST (REGIONAL), rate=10000/burst=5000, no cache, no usage plans, no compression
Proposed: HTTP API, rate=10000/burst=5000, CloudFront cache (1h TTL), no usage plans, gzip
Dimensions changed: api-type (Step 1) + caching (Step 4, via CloudFront) + payload (Step 5)
Dimensions checked: api-type → (REST to HTTP) throttle ✓ (10000 rps adequate)
usage-plans ✓ (single internal client) caching → (enable CloudFront cache)
payload → (enable gzip) waf ✓ (not configured) vpc-endpoint ✓ (regional, not private)
Confidence: HIGH — CloudWatch Count 200M/month directly measured; no
REST-only features found in resource/method inventory; catalog GETs
are idempotent with hourly change frequency.
ESTIMATED_SAVINGS:
Current monthly: $700.00
requests: 200M / 1M × $3.50 = $700.00
Projected monthly: $260.00
requests: 200M / 1M × $1.00 = $200.00
CloudFront cache: $18.98 (1.3 GB cache, 50% hit ratio saves 100M Lambda calls)
gzip: cost-neutral at API Gateway level; saves $1,230/mo DTO (credited at CloudFront)
Monthly saving: $440.00
($700.00 − $260.00 = $440.00 ✓)
Annual saving: $5,280.00
MIGRATION_STEPS:
1. Create HTTP API with Lambda proxy integration:
aws apigatewayv2 create-api --name product-catalog-http --protocol-type HTTP --target <lambda-arn>
2. Create a CloudFront distribution with the HTTP API as origin, cache TTL 3600s.
3. Configure CloudFront compression = true (gzip).
4. Deploy the new HTTP API and route traffic via CloudFront.
5. Monitor Count, 4xx, 5xx, Latency for 7 days post-cutover.
6. Decommission the REST API after verification.
CONFIRM: About to create a new HTTP API (product-catalog-http) and
CloudFront distribution for product-catalog-api. Monthly saving $440.00
(63% reduction). REST API will be decommissioned after 7-day
verification. Proceed? (yes/no)
Self-check before emit:
Verdict semantics
| Verdict |
When to emit |
FURTHER_OPTIMIZATION_AVAILABLE |
At least one dimension has a concrete, savings-bearing recommendation. |
OPTIMIZED |
All dimensions pass (optimal API type, throttle right-sized, caching effective, usage plans in place). |
NEED_MORE_INFO |
Data gate failed: metrics absent or window < 14 days. |
BLOCKED |
Hard precondition prevents evaluation: API not deployed, IAM denies apigateway:GET. |
Zero-savings rule: If MONTHLY_SAVING == $0.00 for every dimension,
verdict MUST be OPTIMIZED, never FURTHER_OPTIMIZATION_AVAILABLE.
Exception: a throttle improvement that prevents cost runaway (usage plan
on an unthrottled multi-client API) is surfaced in REASON as a risk
mitigation, not as dollar savings.
Configuration dependency graph
Configuration dependency graph (API type determines cost and available dimensions; throttle protects backend; usage plans prevent noisy neighbors; caching eliminates 50-80% of integration calls; WAF and VPC endpoint overhead): references/advanced-patterns.md.
Anti-Patterns — NEVER (top 5)
NEVER recommend REST-to-HTTP migration without verifying no REST-only
features are in use. Mapping templates, request validation, stage
caching, and custom Lambda authorizers are REST-only. The REASON MUST
name the feature check.
NEVER recommend response caching on an HTTP API. HTTP API does
not support response caching (as of 2026). Recommend CloudFront or
backend caching instead.
NEVER enable caching without verifying the working set fits in the
cache. If unique cache keys exceed cache capacity, the cache
thrashes and hit rate drops below 10%. Size the cache for the working
set.
NEVER add usage plans without warning the operator that clients MUST
include the x-api-key header. Adding usage plans to an existing
API requires a client-side change. Missing API key results in 403
Forbidden.
NEVER set stage throttle higher than the backend's max concurrency.
If Lambda reserved concurrency is 100 and stage throttle allows 5000
rps, API Gateway returns 502 (backend overload) at peak. Align
throttle to backend capacity.
Extended anti-patterns in references/worked-examples.md.
Pre-flight safety checks (run before any remediation CLI)
- MANDATORY CONFIRMATION GATE. Before any state-changing operation,
emit and await operator approval.
- REST-to-HTTP migration requires a new API deployment. Create HTTP
API alongside REST, route traffic, verify, then decommission REST.
- Caching changes affect all methods in the stage. Test on staging
first; verify cache hit rate and response freshness.
- Usage plan deployment requires client coordination. Clients must
add the
x-api-key header; notify before enforcing.
- Throttle decreases may reject valid traffic. Verify the new rate
covers peak observed traffic with headroom.
- WAF removal reduces security posture. Only recommend evaluation,
not automatic removal.
- Bulk-operation limit: Process at most 5 APIs per batch. Abort if
any API shows increased 5xx errors post-change.
Recent AWS features (2024-2026)
Recent AWS features 2024-2026 (HTTP API WAF support, HTTP API Lambda authorizers, data export, stage-variable canary migration, CloudFront compression): references/advanced-patterns.md.
References
references/apigateway-pricing-and-throttle-reference.md — pricing
tables for REST/HTTP APIs, cache sizing, WAF/VPC endpoint cost,
throttle limit ranges, regional pricing multipliers, cost calculation
worked examples, CLI quick reference.
references/worked-examples.md — full worked examples (REST-to-HTTP
migration, cache enablement, usage plan setup, payload compression,
already-optimal, NEED_MORE_INFO) plus error handling, CLI failure
recovery, and extended NEVER list.
- Advanced patterns - mindset, Step-0 non-obvious behaviours, configuration dependency graph, recent AWS features
Domain
AWS CloudOps / API Gateway Throttle & Cost Optimization, AppIntegration
family.
AWS documentation
1---2name: apigateway-throttle-optimizer3description: 'Optimises AWS API Gateway throttle and cost across seven dimensions: API type selection (REST $3.50/M vs HTTP $1.00/M requests), stage and method- level rate/burst throttle tuning, usage plans with API keys for per- client throttling, response caching (TTL tuning to eliminate 50-80% of integration calls), payload compression (gzip) and field filtering, WAF integration cost analysis, and private API VPC endpoint cost. Reads CloudWatch metrics (Count, 4xx, 5xx, Latency, IntegrationLatency) and projects monthly savings. Emits OPTIMIZED or FURTHER_OPTIMIZATION_AVAILABLE with an API-specific recommendation.'4license: Apache-2.05compatibility: Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). Offline recommendation classification works from pasted CloudWatch metrics. Live-account optimization uses aws apigateway get-rest-apis, get-stages, get-usage-plans, get-resources, aws cloudwatch get-metric-statistics (Count, 4xx, 5xx, Latency, IntegrationLatency), aws ce get-cost-and-usage (AWS CLI v2, SSO or key-based credentials). Pricing references us-east-1 published rates as of 2026; re-state regional...6metadata:7 source: https://skillmd.com/skills/jhkchan/apigateway-throttle-optimizer8 domain: aws-cloudops9 complexity: medium10 requires_llm: 'true'11 phase: '3'12 supports_pipeline: 'true'13 entry_point: 'false'14 family: AppIntegration15 task_type: optimize16 skill_class: capability17 lifecycle_status: active18 verdict_shape: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE19 when_to_use: Optimising API Gateway throttle settings, reducing per-request cost via REST-to-HTTP API migration, enabling response caching for repeated calls, setting up per-client throttling via usage plans, reducing payload size via compression, or reviewing WAF/VPC endpoint overhead.20 when_not_to_use: Lambda function cost behind the API (use lambda-cost-optimizer), Cloud- Front distribution cost (use cloudfront-optimizer), or functional API Gateway troubleshooting (5xx errors, deployment failures, CORS — use the API Gateway troubleshooter). This skill focuses on throttle and cost-driven optimization decisions, not functional debugging.21 activation_triggers: optimise API Gateway throttle, API Gateway cost optimization, REST to HTTP API migration, API Gateway caching, API Gateway usage plan, API Gateway rate limit, API Gateway burst limit, API Gateway per-client throttle, API Gateway payload compression, API Gateway WAF cost, API Gateway VPC endpoint cost, API Gateway FinOps savings, reduce API Gateway bill, API throttle review22 invocation_schema: 'Input: either (a) a REST/HTTP API identifier + live-account context, (b) a pasted set of CloudWatch API Gateway metrics with at least 14 days of observation, OR (c) an API configuration document (API type, stage throttle, usage plans, caching, method-level settings). Output: a deterministic TARGET/VERDICT/REASON/RECOMMENDATION/ESTIMATED_SAVINGS/MIGRATION_STEPS block per API, where VERDICT is one of OPTIMIZED, FURTHER_OPTIMIZATION_AVAILABLE.'23 invocation_example: "# Minimal valid input (offline metric classification): ApiName: product-catalog-api ApiType: REST (REGIONAL) Region: us-east-1 Stage: prod Stage throttle: rate=10000 rps, burst=5000 Caching: disabled Usage plans: none (account-level throttle only) Metrics (last 30 days):\n - Count: 200,000,000/month\n - 4xx: 5,000,000/month (2.5%)\n - 5xx: 100,000/month (0.05%)\n - Latency avg: 120 ms, p95: 250 ms\n - IntegrationLatency avg: 95 ms\nWorkload: product catalog lookup (read-only, idempotent). Emit the standard optimization block (TARGET, VERDICT, REASON, RECOMMENDATION, ESTIMATED_SAVINGS, MIGRATION_STEPS)."24 version: 0.1.025 author: Jacky Chan — AWS Community Builder26 keywords: API Gateway, throttle optimization, cost optimization, REST API, HTTP API, rate limit, burst limit, usage plan, API key, caching, stage throttle, method throttle, WAF, VPC endpoint, payload compression, gzip, data transfer, reserved concurrency, FinOps, AppIntegration27 tags: apigateway, api, app-integration, cost-optimization, finops, throttle28---2930# API Gateway Throttle Optimizer3132## What this skill does3334Translates an API Gateway's configuration and traffic patterns into a35concrete throttle and cost-optimization recommendation with a dollar-36denominated savings estimate. The verdict is the highest-leverage action37across seven dimensions — API type selection, throttle tuning, usage38plans, response caching, payload optimization, WAF/VPC endpoint overhead,39and data transfer — applied in priority order. Always pairs the40recommendation with exact CLI commands.4142## Quick navigation4344| Section | What it covers | When to jump here |45|---|---|---|46| Quick start | Five headline rules and the cost formula | First read |47| Mindset | Why API type is the #1 cost lever | Understanding the approach |48| Quick reference — verdict thresholds | Decision matrix at a glance | Classifying an API |49| Pre-flight data gate | CloudWatch metrics, stage config | Before any recommendation |50| Step 0 non-obvious behaviours | REST vs HTTP feature gaps, WAF, caching | Edge cases |51| Step 1 API type selection | REST to HTTP migration (3x cheaper) | The headline savings dimension |52| Step 2 Throttle tuning | Rate/burst, method vs stage level | Noisy-neighbor protection |53| Step 3 Usage plans + API keys | Per-client rate limiting | Multi-client APIs |54| Step 4 Response caching | TTL tuning, cache hit ratio | Repeated-call workloads |55| Step 5 Payload optimization | Compression, field filtering | Large-payload APIs |56| Step 6 WAF / VPC endpoint cost | Overhead analysis | Private/protected APIs |57| Step 7 Impact estimation | The cost formula and worked math | Every recommendation |58| Output format | VERDICT block + worked examples | Emitting the result |59| Anti-Patterns — NEVER | Common misclassifications | Self-check before emit |60| Pre-flight safety checks | CONFIRM gate, deployment safety | Before any apply CLI |6162## Quick start6364- **API type is the #1 cost lever.** REST API charges $3.50/M requests;65 HTTP API charges $1.00/M requests (us-east-1). If the workload is66 proxy-only (Lambda proxy, HTTP proxy, VPC Link), HTTP API is 3.5x67 cheaper. REST API is only needed for request validation, mapping68 templates, API Gateway features not in HTTP API.69- **Cost formula (memorise this):**70 `monthly_cost = (monthly_requests / 1,000,000) × $api_type_rate`71 where REST = $3.50/M and HTTP = $1.00/M (us-east-1).72- **Caching eliminates 50-80% of integration calls.** Response caching73 ($0.02/hour per GB) intercepts repeated identical requests at the API74 Gateway layer. The backend (Lambda, ECS) never sees cached requests —75 no compute cost for those calls.76- **Usage plans prevent noisy-neighbor throttling.** Without per-client77 usage plans, a single aggressive client can consume the entire account-78 level throttle quota. Usage plans + API keys enforce per-client rate79 limits.80- **WAF adds $5/rule/month + $1/M requests inspected.** For low-traffic81 APIs, WAF cost can exceed API Gateway cost. Evaluate WAF necessity per82 stage.8384## Mindset85Mindset — an API-type and caching exercise, not a throttle-tuning exercise; four principles (API type is the biggest lever, caching is the second, throttle limits are protection not cost, payload size affects transfer cost): [references/advanced-patterns.md](references/advanced-patterns.md).8687## Quick reference — verdict thresholds8889| Observation (14-30 day window) | Verdict | Recommendation |90|---|---|---|91| REST API AND no REST-only features used (no mapping templates, no request validation, no method-level auth) AND proxy-only integration | **FURTHER_OPTIMIZATION_AVAILABLE** (type) | Step 1 — migrate to HTTP API (71% request cost reduction) |92| Caching disabled AND > 50% of requests are idempotent GETs with repeating params AND backend IntegrationLatency > 50 ms | **FURTHER_OPTIMIZATION_AVAILABLE** (caching) | Step 4 — enable stage-level caching with TTL |93| No usage plans AND > 3 distinct clients AND 4xx throttle errors > 1% of Count | **FURTHER_OPTIMIZATION_AVAILABLE** (usage plans) | Step 3 — create per-client usage plans with API keys |94| Payload avg > 100 KB AND compression disabled | **FURTHER_OPTIMIZATION_AVAILABLE** (payload) | Step 5 — enable gzip compression, filter response fields |95| WAF enabled AND request volume < 10M/month AND no compliance requirement | **FURTHER_OPTIMIZATION_AVAILABLE** (WAF) | Step 6 — evaluate WAF cost vs benefit |96| Private API via VPC endpoint AND < 1M requests/month | **FURTHER_OPTIMIZATION_AVAILABLE** (VPC endpoint) | Step 6 — evaluate VPC endpoint cost vs public API + auth |97| Account-level throttle only AND single client consuming > 80% of capacity | **FURTHER_OPTIMIZATION_AVAILABLE** (throttle) | Step 2 — set per-client throttle via usage plan |98| All dimensions verified AND no further savings-bearing action | **OPTIMIZED** | Continue monitoring |99| Metrics absent or window < 14 days | **NEED_MORE_INFO** | Pull 14-30 day CloudWatch data, re-evaluate |100101## Pre-flight: data gate (run before any optimization decision)102103Optimization decisions are only as good as the underlying data. Pull104these metrics before any recommendation. Full CLI sequences are in105`references/apigateway-pricing-and-throttle-reference.md`.106107**Required data sources** (summarized — see reference for full CLI):1081. API configuration: `aws apigateway get-rest-apis` / `get-apis` (HTTP)1092. Stage configuration: `aws apigateway get-stages` (throttle, cache)1103. Usage plans: `aws apigateway get-usage-plans`1114. Resources/methods: `aws apigateway get-resources` (auth, integration112 type, method-level throttle)1135. CloudWatch metrics (14-30 day): `aws cloudwatch get-metric-statistics`1146. Cost data: `aws ce get-cost-and-usage` filtered by Service=APIGateway115116### Data-quality short-circuits117118| Condition | Effect on optimization |119|---|---|120| `Count` metric absent (API never called) | **NEED_MORE_INFO**. Verify stage deployment; skip until traffic exists. |121| `Count` Sum = 0 over 14 days | Emit **OPTIMIZED** with note "dormant API." |122| Observation window < 14 days | **NEED_MORE_INFO**. Minimum 14 days; 30 days preferred. |123| `IntegrationLatency` absent | Fall back to `Latency` only; mark caching recommendation MEDIUM confidence. |124| Stage not deployed (no deployment) | Surface as BLOCKED — API has no active deployment. |125| Cannot distinguish REST vs HTTP from API config | Use `get-rest-apis` (REST) vs `get-apis` (HTTP) — they are separate API surfaces. |126127When CloudWatch and Cost Explorer disagree, CloudWatch Count is the128source of truth (Cost Explorer may aggregate across APIs without129per-API tags).130131## Process — Optimization logic (apply in order)132133### Step 0: Non-obvious behaviours that change the recommendation134Step 0 non-obvious behaviours (REST/HTTP are different services, HTTP API feature gaps, REST-only stage caching, cache TTL vs capacity, usage plans require API keys, WAF per-rule and per-request cost, VPC endpoint hourly cost, DTO billing on response payload, account-level throttle scope, Lambda reserved concurrency returns 502, most-specific throttle wins): [references/advanced-patterns.md](references/advanced-patterns.md).135136### Step 1: API type selection (REST to HTTP migration)137138REST API ($3.50/M) vs HTTP API ($1.00/M). For proxy-only workloads139(Lambda proxy integration, HTTP proxy, VPC Link), HTTP API is 3.5x140cheaper and simpler.141142**Migration checklist:**143144| REST feature in use? | Blocks HTTP API migration? |145|---|---|146| Lambda proxy integration | NO — fully supported on HTTP API |147| HTTP proxy integration | NO — fully supported |148| VPC Link integration | NO — supported on HTTP API |149| Mapping templates (Velocity) | YES — HTTP API has no mapping templates |150| Request validation (schema) | YES — HTTP API has no request validation |151| Method-level authorization (Lambda authorizer) | Partially — HTTP API supports JWT authorizers but not custom Lambda authorizers (added 2025 in select regions) |152| API Gateway-managed CORS | YES — HTTP API has built-in CORS config, different model |153| Client certificates to backend | YES — HTTP API does not support mutual TLS to backend (as of 2026) |154| Stage-level caching | YES — HTTP API has no response caching |155| WAF Web ACL attachment | Partially — HTTP API WAF support added 2024, REST API fully supported |156157**Decision gate:**158159| REST features in use | Can migrate to HTTP? | Verdict |160|---|---|---|161| Lambda proxy only | YES | **FURTHER_OPTIMIZATION_AVAILABLE** |162| Proxy + request validation | NO (validation is REST-only) | Not recommended; stay on REST |163| Proxy + mapping templates | NO | Not recommended; stay on REST |164| Proxy + stage caching | Evaluate: cache savings vs type savings | Run Step 4 first, then re-evaluate |165Savings math (monthly_requests / 1M × $2.50): [references/apigateway-pricing-and-throttle-reference.md](references/apigateway-pricing-and-throttle-reference.md) — Step 1.166167### Step 2: Throttle tuning (rate and burst limits)168169Throttle tuning is primarily about availability protection, not cost.170The one cost impact: tighter throttles prevent cost runaway from171unauthorized traffic spikes.172173**Stage-level vs method-level:**174175| Throttle level | Scope | When to use |176|---|---|---|177| Account-level (default) | All APIs in region | Last-resort cap |178| Stage-level | All methods in a stage | Per-environment protection |179| Method-level | Single method | Per-endpoint tuning (e.g., expensive POST vs cheap GET) |180Backend-capacity throttle math (max_rate = backend_max_concurrent / avg_integration_latency_s) and update-stage CLI: [references/apigateway-pricing-and-throttle-reference.md](references/apigateway-pricing-and-throttle-reference.md) — Step 2.181182### Step 3: Usage plans + API keys (per-client throttling)183184Usage plans enforce per-client rate and burst limits. Without them, a185single client can consume the entire stage/account throttle quota.186187**Decision gate:**188189| Condition | Verdict | Action |190|---|---|---|191| > 3 distinct clients AND no usage plans | **FURTHER_OPTIMIZATION_AVAILABLE** | Create usage plan per client tier |192| 1 client (internal service) | No finding | Usage plan adds overhead without benefit |193| Usage plans exist AND 4xx throttle rate < 0.1% | No finding | Per-client throttling is effective |194195**Usage plan tiers (example):**196197| Tier | Rate | Burst | Quota | Target |198|---|---|---|---|---|199| Free | 5 rps | 10 | 1M/month | Trial users |200| Pro | 50 rps | 100 | 50M/month | Paid customers |201| Enterprise | 500 rps | 1000 | Unlimited | Enterprise contracts |202203```bash204aws apigateway create-usage-plan-key \205 --usage-plan-id <plan-id> \206 --key-id <api-key-id> \207 --key-type API_KEY208```209210### Step 4: Response caching (TTL tuning)211212Response caching is the single most effective cost reducer for read-213heavy APIs. Cache intercepts identical requests at the API Gateway layer;214the backend never sees cached requests.215216**REST-only feature.** HTTP API does not support response caching (as217of 2026).218Cache cost vs benefit math (cache_cost = GB × $0.02 × 730; backend_saving = cached × cost/request): [references/apigateway-pricing-and-throttle-reference.md](references/apigateway-pricing-and-throttle-reference.md) — Step 4.219220**Decision gate:**221222| Condition | Verdict | Action |223|---|---|---|224| Caching disabled AND > 50% idempotent GETs AND IntegrationLatency > 50 ms | **FURTHER_OPTIMIZATION_AVAILABLE** | Enable stage-level caching |225| Caching enabled AND cache hit rate < 20% | **FURTHER_OPTIMIZATION_AVAILABLE** | Increase TTL or reduce cache scope to high-hit methods |226| Caching enabled AND cache hit rate > 50% | No finding | Cache is effective |227TTL tuning guidance (300s default; 3600 catalog; 86400 config; 0 user-specific) and caching update-stage CLI: [references/apigateway-pricing-and-throttle-reference.md](references/apigateway-pricing-and-throttle-reference.md) — Step 4.228229### Step 5: Payload optimization (compression and field filtering)230231Large payloads increase data transfer cost and latency. API Gateway does232NOT compress responses by default; the backend or CloudFront must handle233gzip.234Compression math (gzip ratio ~0.3 on JSON): [references/apigateway-pricing-and-throttle-reference.md](references/apigateway-pricing-and-throttle-reference.md) — Step 5.235236**Decision gate:**237238| Condition | Verdict | Action |239|---|---|---|240| Avg payload > 100 KB AND compression disabled | **FURTHER_OPTIMIZATION_AVAILABLE** | Enable gzip at backend or CloudFront |241| Response includes unused fields (over-fetching) | **FURTHER_OPTIMIZATION_AVAILABLE** | Implement field filtering (GraphQL or sparse fieldsets) |242| Avg payload < 10 KB | No finding | Compression overhead not justified |243Enable-gzip CLI (minimumCompressionSize=1024; backend must send Content-Encoding: gzip): [references/apigateway-pricing-and-throttle-reference.md](references/apigateway-pricing-and-throttle-reference.md) — Step 5.244245### Step 6: WAF and VPC endpoint cost analysis246WAF cost math ((rules × $5/month) + (requests_inspected / 1M × $1)): [references/apigateway-pricing-and-throttle-reference.md](references/apigateway-pricing-and-throttle-reference.md) — Step 6.247248VPC endpoint cost math (($0.01 × 730 hours) + (data_transfer_GB × $0.01)): [references/apigateway-pricing-and-throttle-reference.md](references/apigateway-pricing-and-throttle-reference.md) — Step 6.249250**Decision gate:**251252| Condition | Verdict | Action |253|---|---|---|254| WAF enabled AND < 10M requests/month AND no compliance mandate | **FURTHER_OPTIMIZATION_AVAILABLE** | Evaluate WAF cost vs security benefit |255| Private API via VPC endpoint AND < 1M requests/month | **FURTHER_OPTIMIZATION_AVAILABLE** | Evaluate public API + IAM/Cognito auth as alternative |256| WAF enabled AND > 100M requests/month AND compliance required | No finding | WAF is justified |257258### Step 7: Impact estimation259260Compute the monthly savings for each recommendation:261262```263current_monthly_cost =264 (monthly_requests / 1M) × $api_type_rate265 + cache_cost (if enabled)266 + waf_cost (if enabled)267 + vpc_endpoint_cost (if private API)268 + data_transfer_cost (payload_GB × $0.09/GB)269270projected_monthly_cost =271 (projected_requests / 1M) × $projected_api_type_rate272 + projected_cache_cost273 + projected_waf_cost274 + projected_vpc_endpoint_cost275 + projected_data_transfer_cost276277monthly_saving = current_monthly_cost - projected_monthly_cost278```279280Always state assumptions: monthly request count, API type (current and281proposed), cache hit ratio, payload size, pricing region.282283### Step 8: Final verdict284285- Any dimension recommends a change → **FURTHER_OPTIMIZATION_AVAILABLE**.286- All dimensions pass AND API is optimally configured → **OPTIMIZED**.287- Change applied and verified this session → **OPTIMIZED** (with post-288 state verification note).289- Data insufficient (metrics absent, window < 14 days) →290 **NEED_MORE_INFO**.291292## Output format293Output template block (identical labels to the Required output structure below): [references/worked-examples.md](references/worked-examples.md).294295Full worked examples in `references/worked-examples.md`.296297## STRICT output contract298299The rules below are hard constraints. Violating any one produces a300misclassification or an arithmetic contradiction that breaks downstream301FinOps automation. Self-check EVERY emitted block against these rules302before returning the response.303304### Required output structure305306Every response MUST be a single block using these literal labels, in this307order. Do NOT substitute markdown headings, camelCase, or bold variants.308309```text310TARGET: <api-name>311VERDICT: OPTIMIZED | FURTHER_OPTIMIZATION_AVAILABLE312REASON: <1-2 sentences naming the recommendation and the supporting data>313RECOMMENDATION:314 Current: <api type>, <throttle>, <cache>, <usage plans>, <payload>315 Proposed: <api type>, <throttle>, <cache>, <usage plans>, <payload>316 Dimensions changed: <api-type | throttle | usage-plans | caching | payload | waf | vpc-endpoint>317 Dimensions checked: <list ALL seven, each ✓ (no finding) or → (finding)>318 Confidence: <HIGH/MEDIUM/LOW> — <one-line rationale>319ESTIMATED_SAVINGS:320 Current monthly: $<amount> ← MUST show breakdown subtotals321 Projected monthly: $<amount>322 Monthly saving: $<amount> ← MUST equal Current − Projected, 2 decimals323 Annual saving: $<amount> ← MUST equal Monthly × 12324MIGRATION_STEPS:325 1. <specific action with CLI command>326 2. <verification step>327CONFIRM: <confirmation prompt text>328```329330### FORBIDDEN output patterns3313321. **NEVER emit `VERDICT: FURTHER_OPTIMIZATION_AVAILABLE` with333 `Monthly saving: $0.00`.** If every dimension nets zero cost delta,334 the verdict MUST be `OPTIMIZED`.3353362. **NEVER show savings math that does not balance.**337 `Current monthly − Projected monthly` MUST equal `Monthly saving`,338 rounded to 2 decimal places.3393403. **NEVER emit scratch lines** ("WAIT — recompute", "corrected:") in341 the output. Finalize the math before emitting.3423434. **NEVER recommend REST-to-HTTP migration without verifying no REST-344 only features are in use.** Mapping templates, request validation,345 and stage caching are REST-only. The REASON MUST name the feature346 check.3473485. **NEVER omit a dimension from the RECOMMENDATION block.** The349 `Dimensions checked` line MUST list all seven dimensions, each marked350 ✓ (no finding) or → (finding).3513526. **NEVER recommend response caching on an HTTP API.** HTTP API does353 not support response caching (as of 2026). Recommend CloudFront or354 backend caching instead.3553567. **NEVER round intermediate formula steps differently from the final357 figure.** Compute at full precision, round only the displayed result.358359### Perfect example output — FURTHER_OPTIMIZATION_AVAILABLE with verified math360361```text362TARGET: product-catalog-api363VERDICT: FURTHER_OPTIMIZATION_AVAILABLE364REASON: REST API used purely as a Lambda proxy (no mapping templates, no365 request validation, no stage caching). HTTP API supports Lambda proxy366 integration at $1.00/M vs REST $3.50/M (71% reduction). Additionally,367 caching is disabled but 70% of requests are idempotent GETs to a368 catalog that changes hourly — caching would eliminate 50% of backend369 calls. No REST-only features block migration.370RECOMMENDATION:371 Current: REST (REGIONAL), rate=10000/burst=5000, no cache, no usage plans, no compression372 Proposed: HTTP API, rate=10000/burst=5000, CloudFront cache (1h TTL), no usage plans, gzip373 Dimensions changed: api-type (Step 1) + caching (Step 4, via CloudFront) + payload (Step 5)374 Dimensions checked: api-type → (REST to HTTP) throttle ✓ (10000 rps adequate)375 usage-plans ✓ (single internal client) caching → (enable CloudFront cache)376 payload → (enable gzip) waf ✓ (not configured) vpc-endpoint ✓ (regional, not private)377 Confidence: HIGH — CloudWatch Count 200M/month directly measured; no378 REST-only features found in resource/method inventory; catalog GETs379 are idempotent with hourly change frequency.380ESTIMATED_SAVINGS:381 Current monthly: $700.00382 requests: 200M / 1M × $3.50 = $700.00383 Projected monthly: $260.00384 requests: 200M / 1M × $1.00 = $200.00385 CloudFront cache: $18.98 (1.3 GB cache, 50% hit ratio saves 100M Lambda calls)386 gzip: cost-neutral at API Gateway level; saves $1,230/mo DTO (credited at CloudFront)387 Monthly saving: $440.00388 ($700.00 − $260.00 = $440.00 ✓)389 Annual saving: $5,280.00390MIGRATION_STEPS:391 1. Create HTTP API with Lambda proxy integration:392 aws apigatewayv2 create-api --name product-catalog-http --protocol-type HTTP --target <lambda-arn>393 2. Create a CloudFront distribution with the HTTP API as origin, cache TTL 3600s.394 3. Configure CloudFront compression = true (gzip).395 4. Deploy the new HTTP API and route traffic via CloudFront.396 5. Monitor Count, 4xx, 5xx, Latency for 7 days post-cutover.397 6. Decommission the REST API after verification.398CONFIRM: About to create a new HTTP API (product-catalog-http) and399 CloudFront distribution for product-catalog-api. Monthly saving $440.00400 (63% reduction). REST API will be decommissioned after 7-day401 verification. Proceed? (yes/no)402```403404**Self-check before emit:**405- [ ] `Current monthly − Projected monthly == Monthly saving` (2 decimals)?406- [ ] `Monthly saving × 12 == Annual saving`?407- [ ] All seven dimensions listed in `Dimensions checked`?408- [ ] Every `→` dimension has a corresponding MIGRATION_STEPS entry?409- [ ] REST-to-HTTP migration verified no REST-only features in use?410- [ ] No scratch/recompute text in the block?411412## Verdict semantics413414| Verdict | When to emit |415|---|---|416| `FURTHER_OPTIMIZATION_AVAILABLE` | At least one dimension has a concrete, savings-bearing recommendation. |417| `OPTIMIZED` | All dimensions pass (optimal API type, throttle right-sized, caching effective, usage plans in place). |418| `NEED_MORE_INFO` | Data gate failed: metrics absent or window < 14 days. |419| `BLOCKED` | Hard precondition prevents evaluation: API not deployed, IAM denies apigateway:GET. |420421**Zero-savings rule:** If MONTHLY_SAVING == $0.00 for every dimension,422verdict MUST be `OPTIMIZED`, never `FURTHER_OPTIMIZATION_AVAILABLE`.423Exception: a throttle improvement that prevents cost runaway (usage plan424on an unthrottled multi-client API) is surfaced in REASON as a risk425mitigation, not as dollar savings.426427## Configuration dependency graph428Configuration dependency graph (API type determines cost and available dimensions; throttle protects backend; usage plans prevent noisy neighbors; caching eliminates 50-80% of integration calls; WAF and VPC endpoint overhead): [references/advanced-patterns.md](references/advanced-patterns.md).429430## Anti-Patterns — NEVER (top 5)4314321. **NEVER recommend REST-to-HTTP migration without verifying no REST-only433 features are in use.** Mapping templates, request validation, stage434 caching, and custom Lambda authorizers are REST-only. The REASON MUST435 name the feature check.4364372. **NEVER recommend response caching on an HTTP API.** HTTP API does438 not support response caching (as of 2026). Recommend CloudFront or439 backend caching instead.4404413. **NEVER enable caching without verifying the working set fits in the442 cache.** If unique cache keys exceed cache capacity, the cache443 thrashes and hit rate drops below 10%. Size the cache for the working444 set.4454464. **NEVER add usage plans without warning the operator that clients MUST447 include the `x-api-key` header.** Adding usage plans to an existing448 API requires a client-side change. Missing API key results in 403449 Forbidden.4504515. **NEVER set stage throttle higher than the backend's max concurrency.**452 If Lambda reserved concurrency is 100 and stage throttle allows 5000453 rps, API Gateway returns 502 (backend overload) at peak. Align454 throttle to backend capacity.455456Extended anti-patterns in `references/worked-examples.md`.457458## Pre-flight safety checks (run before any remediation CLI)459460- **MANDATORY CONFIRMATION GATE.** Before any state-changing operation,461 emit and await operator approval.462- **REST-to-HTTP migration requires a new API deployment.** Create HTTP463 API alongside REST, route traffic, verify, then decommission REST.464- **Caching changes affect all methods in the stage.** Test on staging465 first; verify cache hit rate and response freshness.466- **Usage plan deployment requires client coordination.** Clients must467 add the `x-api-key` header; notify before enforcing.468- **Throttle decreases may reject valid traffic.** Verify the new rate469 covers peak observed traffic with headroom.470- **WAF removal reduces security posture.** Only recommend evaluation,471 not automatic removal.472- **Bulk-operation limit:** Process at most 5 APIs per batch. Abort if473 any API shows increased 5xx errors post-change.474475## Recent AWS features (2024-2026)476Recent AWS features 2024-2026 (HTTP API WAF support, HTTP API Lambda authorizers, data export, stage-variable canary migration, CloudFront compression): [references/advanced-patterns.md](references/advanced-patterns.md).477478## References479480- `references/apigateway-pricing-and-throttle-reference.md` — pricing481 tables for REST/HTTP APIs, cache sizing, WAF/VPC endpoint cost,482 throttle limit ranges, regional pricing multipliers, cost calculation483 worked examples, CLI quick reference.484- `references/worked-examples.md` — full worked examples (REST-to-HTTP485 migration, cache enablement, usage plan setup, payload compression,486 already-optimal, NEED_MORE_INFO) plus error handling, CLI failure487 recovery, and extended NEVER list.488- [Advanced patterns](references/advanced-patterns.md) - mindset, Step-0 non-obvious behaviours, configuration dependency graph, recent AWS features489490## Domain491492AWS CloudOps / API Gateway Throttle & Cost Optimization, AppIntegration493family.494495## AWS documentation496497- **Amazon API Gateway Developer Guide** — https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html498- **API Gateway pricing** — https://aws.amazon.com/api-gateway/pricing/499- **API Gateway quotas** — https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-limits.html500- **API Gateway REST vs HTTP API** — https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html501- **API Gateway caching** — https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html502- **API Gateway usage plans** — https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-api-usage-plans.html503- **API Gateway throttling** — https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html504- **API Gateway payload compression** — https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-enable-compression.html505- **WAF + API Gateway** — https://docs.aws.amazon.com/waf/latest/developerguide/apigateway-as-source.html506- **AWS CLI API Gateway reference** — https://docs.aws.amazon.com/cli/latest/reference/apigateway/507- **AWS Well-Architected Framework — Cost Optimization** — https://docs.aws.amazon.com/wellarchitected/latest/cost-optimization-pillar/welcome.html