Blogs

Dive into our latest insights and tips on cloud technology.

AWS

Your comprehensive resource for mastering AWS services.

Contact

Contact Us in form of any enquiry and get served by our experts.

AWS API Gateway Pricing | REST vs HTTP vs WebSocket Cost Guide (2026)

HTTP API costs $1.00 per million requests. REST API costs

HTTP API costs $1.00 per million requests. REST API costs $3.50 per million. That’s a 250% price difference for the same data flow — receiving a JSON request, invoking a Lambda function, returning a JSON response. Teams that default to REST API because “it has more features” pay $2.50 per million requests they didn’t need to. Understanding AWS API Gateway Pricing helps teams make informed choices and avoid unnecessary costs. At 100 million monthly requests, that’s $250 wasted monthly or $3,000 annually for features sitting unused in the configuration panel.

API Gateway pricing splits across three fundamentally different API types — REST, HTTP, and WebSocket — each with distinct rate structures, volume discounts, and hidden charges that stack on top of base request costs. REST APIs add optional caching at $14.60-$2,774 monthly regardless of traffic volume. Private integrations require VPC Links billing $7.20-$216 monthly even with zero requests. CloudWatch execution logs accumulate $0.50 per GB ingested, often exceeding API Gateway request charges at high volumes. Most cost guides focus exclusively on per-request rates while ignoring these fixed monthly charges that dominate small-to-medium API bills.

AWS API Gateway Free Tier

AWS provides generous free tier allowances for all three API types during the first 12 months after account creation. These allowances renew monthly and cover basic usage for development, testing, and small production workloads.

Complete free tier allocation:

API TypeFree Tier AmountDuration
REST API calls1 million requests/monthFirst 12 months only
HTTP API calls1 million requests/monthFirst 12 months only
WebSocket messages1 million messages/monthFirst 12 months only
WebSocket connection minutes750,000 minutes/monthFirst 12 months only

After 12 months, all requests bill at standard rates. Small applications serving 500K-800K monthly requests can operate indefinitely within free tier limits during the first year, then transition to $0.50-$3.50 monthly depending on API type selection.

Services with NO free tier:

  • API Gateway REST caching (all cache sizes bill hourly from first enablement)
  • VPC Link for private integrations (bills continuously regardless of traffic)
  • Custom domain name SSL certificates via AWS Certificate Manager (actually free, but ACM validation requires Route 53 hosted zone at $0.50/month)
  • Developer portal for usage plan management
  • Data transfer out (egress charges apply from the first byte beyond AWS Free Tier’s 100GB monthly aggregate)
  • CloudWatch Logs ingestion (billed from first log entry)

The free tier applies per AWS account, not per API or per region. Ten HTTP APIs in us-east-1 share the single 1 million monthly request allowance. Organizations with multiple AWS accounts receive free tier in each account independently.

REST API Pricing — Full-Featured & Most Expensive

REST APIs represent API Gateway’s original full-featured offering with comprehensive request transformation, caching, usage plans, and AWS WAF integration. These capabilities come at premium pricing: $3.50 per million requests at baseline, declining with volume.

Complete REST API tiered pricing (all regions except Asia Pacific and Middle East):

Monthly VolumePrice per Million CallsEffective Discount vs Baseline
First 333 million$3.50Baseline (no discount)
333M – 1 billion$2.8020% discount
1B – 20 billion$2.3832% discount
Over 20 billion$1.5157% discount

Volume discounts apply per AWS account per region monthly, aggregating all REST API traffic regardless of API count. An organization with five REST APIs processing 100M requests each reaches 500M monthly volume, qualifying 167M requests for tier-2 pricing at $2.80/M.

Example calculation at 500M monthly requests:

  • First 333M: 333 × $3.50 = $1,165.50
  • Next 167M: 167 × $2.80 = $467.60
  • Total: $1,633.10 monthly

REST API exclusive features justifying premium pricing:

  • API response caching — Cache responses at API Gateway layer to reduce backend Lambda invocations and database queries
  • Usage plans and API keys — Rate limit and throttle per client, track usage across customers for billing
  • Request/response validation and transformation — Validate JSON schema before reaching backend, transform payloads between formats
  • AWS WAF integration — Attach Web Application Firewall rules directly to API stages for DDoS protection, IP filtering, SQL injection prevention
  • Request and response parameter mapping — Extract query parameters, headers, path variables and map to different backend parameters
  • Mock integrations — Return static responses without backend invocation for testing and prototyping
  • SDK generation — Auto-generate client SDKs in multiple languages (Java, JavaScript, iOS, Android)
  • API import/export — OpenAPI (Swagger) specification import and export for API versioning and documentation

Most teams require fewer than three of these features. HTTP APIs support Lambda integration, custom domains, CORS, and JWT authorization — covering 80% of serverless API needs at 71% lower cost.

REST API Caching — When Does It Make Sense?

REST API caching stores responses at the API Gateway layer based on configurable TTL (time-to-live) and cache keys, eliminating backend invocations for identical requests within the TTL window. Caching bills 24/7 at fixed hourly rates regardless of request volume or cache hit rate, making it expensive for low-traffic APIs and valuable only when backend costs exceed cache costs.

Complete REST API cache pricing (us-east-1):

Cache Size$/Hour$/Month (730 hrs)Break-Even Backend Savings Required
0.5 GB$0.020$14.60$14.60/month in Lambda+DB savings
1.6 GB$0.038$27.74$27.74/month in Lambda+DB savings
6.1 GB$0.200$146.00$146.00/month in Lambda+DB savings
13.5 GB$0.250$182.50$182.50/month in Lambda+DB savings
28.4 GB$0.500$365.00$365.00/month in Lambda+DB savings
58.2 GB$1.000$730.00$730.00/month in Lambda+DB savings
118 GB$1.900$1,387.00$1,387.00/month in Lambda+DB savings
237 GB$3.800$2,774.00$2,774.00/month in Lambda+DB savings

Critical consideration: Cache billing is continuous and independent of traffic. A 6.1GB cache costs $146 whether your API receives 1 request monthly or 1 billion requests monthly. The cache pays for itself only when eliminated backend costs exceed $146 monthly.

Example cost-benefit analysis:

Your API serves 50 million requests monthly with these backend costs:

  • Lambda: 50M × 0.5 GB × 0.2s = 5M GB-seconds × $0.0000166667 = $83.33
  • DynamoDB reads: 50M × $0.25/million = $12.50
  • Total backend cost: $95.83/month

With 80% cache hit rate, 40M requests serve from cache, 10M hit backend:

  • Lambda: 10M × 0.5 × 0.2 = 1M GB-sec × $0.0000166667 = $16.67
  • DynamoDB: 10M × $0.25/M = $2.50
  • Cache (6.1GB): $146.00
  • Total with cache: $165.17/month

Result: Caching increases costs by $69.34 monthly because backend savings ($76.66) don’t cover cache fees ($146). Cache only makes sense if backend costs exceed cache costs at your expected hit rate.

When REST API caching makes financial sense:

  • Backend costs (Lambda + database) exceed $150-300 monthly at current traffic
  • Cache hit rate will consistently exceed 70% based on actual access patterns
  • Response payloads are large (reducing data transfer costs proportionally)
  • TTL can be reasonably long (>30 seconds) without stale data concerns

Alternative: CloudFront caching in front of API Gateway often delivers better economics. CloudFront charges per-request with no fixed hourly cost, billing $0.0075 per 10,000 requests for the first 10TB traffic. At 50M requests monthly, CloudFront caching costs approximately $37.50 versus $146 for REST API cache, while simultaneously providing global edge caching improving latency for distant users. Learn more about CloudFront pricing strategies.

HTTP API Pricing — The Cost-Efficient Choice

HTTP APIs launched in 2019 as AWS’s response to developers demanding simpler, cheaper API management without REST API’s enterprise features. At $1.00 per million requests, HTTP APIs cost 71% less than REST while supporting the core functionality 80% of serverless APIs actually need: Lambda integration, JWT authorization, CORS, custom domains, and route-level throttling.

HTTP API tiered pricing (all regions except Asia Pacific and Middle East):

Monthly VolumePrice per Million CallsEffective Discount
First 300 million$1.00Baseline
Over 300 million$0.9010% volume discount

Volume discount threshold at 300M differs from REST API’s 333M threshold but applies identically — per account per region aggregating all HTTP API traffic monthly.

Cost comparison at common traffic levels:

At 10 million requests monthly:

  • HTTP API: 10 × $1.00 = $10.00
  • REST API: 10 × $3.50 = $35.00
  • Monthly savings: $25.00 ($300 annually)

At 100 million requests monthly:

  • HTTP API: 100 × $1.00 = $100.00
  • REST API: 100 × $3.50 = $350.00
  • Monthly savings: $250.00 ($3,000 annually)

At 500 million requests monthly:

  • HTTP API: (300 × $1.00) + (200 × $0.90) = $480.00
  • REST API: (333 × $3.50) + (167 × $2.80) = $1,633.10
  • Monthly savings: $1,153.10 ($13,837 annually)

The 71% cost reduction applies consistently across volume tiers. Organizations processing billions of monthly requests save tens of thousands annually by defaulting to HTTP APIs except when specific REST-only features are genuinely required.

HTTP API supported features:

  • JWT authorization — Native integration with Cognito, Auth0, Okta, and custom JWT issuers without Lambda authorizers
  • Lambda proxy integration — Pass requests directly to Lambda with full event context
  • HTTP proxy integration — Forward requests to HTTP endpoints (EC2, ECS, on-premises)
  • CORS configuration — Built-in CORS with wildcard or specific origin patterns
  • Route-level throttling — Configure rate limits per route per stage
  • Custom domain names — Map custom domains with ACM SSL certificates
  • CloudWatch metrics — Request count, latency percentiles, 4xx/5xx error rates
  • Mutual TLS authentication — Client certificate validation for B2B APIs
  • Private integrations — Connect to VPC resources via VPC Links

HTTP API does NOT support (REST-only features):

  • API response caching (use CloudFront instead)
  • Usage plans and API keys for per-client rate limiting
  • AWS WAF integration (use CloudFront + WAF instead)
  • Request/response validation and transformation
  • Custom authorizers with response caching
  • X-Ray active tracing (passive tracing available)
  • Mock integrations
  • SDK generation

Decision framework: Start with HTTP API by default. Upgrade to REST API only if you need caching, usage plans, WAF integration, or request transformation. Most serverless APIs implementing authentication via JWT and authorization via Lambda function attributes operate perfectly on HTTP APIs at $1/M instead of $3.50/M.

WebSocket API Pricing — Real-Time Applications

WebSocket APIs enable persistent bidirectional connections for real-time applications: chat systems, live dashboards, multiplayer games, collaborative editing, and IoT device communication. Unlike REST and HTTP APIs billing purely per request, WebSocket APIs charge for both connection duration and message volume independently.

WebSocket API dual billing model:

Charge TypeTierRateNotes
Connection minutesFirst 1 billion$0.25 per million minutesBilled continuously while connected
Connection minutesOver 1 billion$0.20 per million minutes20% volume discount
MessagesFirst 1 billion$1.00 per million messagesSent and received count separately
MessagesOver 1 billion$0.80 per million messages20% volume discount

 

Additional API Gateway Cost Components

Beyond per-request charges, API Gateway accrues additional costs through data transfer, VPC connectivity, custom domains, and optional features. These auxiliary costs often exceed base request charges for small-to-medium APIs.

Data Transfer Out (Egress)

API Gateway response payloads bill at standard EC2 data transfer rates: first 100GB monthly free (aggregated across all AWS services), then $0.09/GB for the first 10TB, declining to $0.05/GB beyond 150TB monthly.

Example calculation:

  • Request volume: 100 million monthly
  • Average response size: 500 bytes
  • Monthly egress: 100M × 500 bytes = 50GB
  • Cost: First 100GB free = $0.00

At larger payload sizes:

  • Request volume: 100 million monthly
  • Average response size: 5KB (uncompressed JSON)
  • Monthly egress: 100M × 5KB = 500GB
  • Cost: (500GB – 100GB free) × $0.09 = $36.00/month

Large response payloads — returning full database records, uncompressed JSON arrays, Base64-encoded images — accumulate substantial egress charges. A 50KB average response at 100M requests generates 5TB egress costing approximately $446 monthly, often exceeding API Gateway request charges.

Optimization strategies:

  • Enable response compression (gzip) in API Gateway settings — reduces payload 70-90% for text/JSON
  • Implement pagination for list endpoints returning hundreds of records
  • Use GraphQL-style field selection allowing clients to request only needed fields
  • Store large binaries (images, PDFs) in S3; return signed URLs instead of inline data
  • Deploy CloudFront in front of API Gateway — CloudFront-to-internet egress starts at $0.085/GB (4% cheaper) with global edge caching reducing origin egress volume 70-95%

VPC Link (Private APIs)

VPC Links enable private connectivity between API Gateway and backend services inside VPCs: Lambda functions in VPCs, ECS containers, Application Load Balancers, Network Load Balancers, and on-premises services via Direct Connect. VPC Links bill continuously 24/7 regardless of request volume.

VPC Link pricing by API type:

HTTP API VPC Link:

  • $0.01 per hour = $7.20 per month (730 hours)
  • Supports private integrations to ALB, NLB, Cloud Map services
  • Single VPC Link supports multiple HTTP APIs
  • Billed even with zero traffic

REST API VPC Link (requires Network Load Balancer):

  • $0.025 per hour = $18.25 per month
  • Requires NLB frontend (NLB adds $16.20/month base charge)
  • Total minimum cost: $18.25 (VPC Link) + $16.20 (NLB) = $34.45/month
  • Billed continuously regardless of request volume

Cost implication: A single HTTP API VPC Link costs $86.40 annually whether processing 1 request yearly or 10 billion requests monthly. REST API VPC Link plus required NLB costs $413.40 annually minimum. Evaluate whether private connectivity justifies fixed infrastructure charges before enabling.

Alternative: Lambda functions without VPC configuration access DynamoDB, S3, and most AWS services via public endpoints (traffic never leaves AWS network despite using service public endpoints). Reserve VPC integration for scenarios genuinely requiring private connectivity: accessing RDS databases, calling private microservices in ECS, integrating with on-premises APIs via Direct Connect.

Custom Domain Names

Custom domains (api.yourdomain.com) replace default API Gateway URLs (xxxxx.execute-api.region.amazonaws.com) with branded endpoints. API Gateway custom domain configuration itself is free, but supporting infrastructure incurs costs.

Custom domain cost components:

  • Route 53 hosted zone: $0.50/month for DNS hosting
  • ACM SSL certificate: Free via AWS Certificate Manager
  • Edge-optimized custom domain: Uses CloudFront distribution under the hood
    • CloudFront charges apply: $0.0075 per 10,000 requests plus standard egress
    • Effectively adds ~$0.75 per million requests for request distribution
  • Regional custom domain: No additional API Gateway charges beyond base request costs

Most teams use regional custom domains to avoid CloudFront charges. Edge-optimized domains make sense only for globally distributed user bases where CloudFront’s 450+ PoPs deliver substantial latency improvements justifying the ~75% request surcharge.

CloudWatch Logging & Monitoring

API Gateway integrates with CloudWatch for metrics and logs, with logging representing the most significant hidden cost component for high-traffic APIs.

CloudWatch Logs pricing:

  • Log ingestion: $0.50 per GB
  • Log storage: $0.03 per GB-month
  • Log retention configurable: 1 day to indefinite

Execution logging cost estimation:

Full execution logs (INFO level) capture complete request/response data:

  • Average log entry size: ~1KB per request (includes headers, body excerpts, timing)
  • At 100M requests: 100M × 1KB = 100GB monthly
  • Ingestion cost: 100GB × $0.50 = $50.00/month
  • Storage (30-day retention): 100GB × $0.03 = $3.00/month
  • Total: $53/month for 100M requests

At 1 billion requests:

  • 1B × 1KB = 1TB = 1,000GB
  • Ingestion: $500/month
  • Storage: $30/month
  • Total: $530/month in logging costs alone

Execution logging costs often exceed API Gateway request charges for high-traffic APIs. At 1 billion monthly HTTP API requests, API Gateway costs $900 (requests) + $530 (logging) = $1,430 total, with logging representing 37% of combined API Gateway + logging spend.

Optimization: Switch production logging to ERROR level only. Error-level logging captures only failed requests (4xx/5xx), reducing log volume 95-99% for healthy APIs while maintaining troubleshooting capability. Enable INFO-level logging temporarily during debugging, then disable after resolution.

Access logging (custom log format) offers cheaper alternative:

  • Configure minimal format: timestamp, request ID, status, latency
  • Typical size: ~200 bytes per request (5× smaller than execution logs)
  • At 100M requests: 20GB × $0.50 = $10/month (80% savings vs full execution logs)

AWS WAF Costs (REST API Only)

REST APIs integrate directly with AWS WAF for DDoS protection, IP filtering, rate limiting, and SQL injection prevention. WAF charges independently from API Gateway.

AWS WAF pricing components:

  • Web ACL: $5.00/month per ACL
  • Rules: $1.00/month per rule
  • Requests inspected: $0.60 per million requests

Example WAF cost at 100M requests with 10 rules:

  • Web ACL: $5.00
  • 10 rules: 10 × $1.00 = $10.00
  • Request inspection: 100M × $0.60/M = $60.00
  • Total WAF cost: $75.00/month

Combined with REST API charges: $350 (REST requests) + $75 (WAF) = $425 total for 100M requests, compared to $100 for HTTP API without WAF. The 325% cost premium (HTTP → REST + WAF) justifies itself only for applications requiring sophisticated threat protection beyond basic DDoS mitigation.

HTTP API alternative: HTTP APIs don’t support direct WAF integration. Deploy CloudFront in front of HTTP API, attach WAF to CloudFront distribution. CloudFront egress costs slightly more than API Gateway direct egress, but CloudFront caching typically reduces backend requests 70-95%, often delivering net savings despite WAF charges. Learn more about CloudFront WAF integration.

The True Cost of Your API — Beyond API Gateway

API Gateway request charges represent only 20-30% of total API infrastructure costs for typical serverless architectures. Understanding total stack costs prevents optimizing the wrong layer — saving $250 on API Gateway while ignoring $500 in wasteful Lambda execution or $300 in excessive logging.

Typical serverless API cost breakdown (100M requests/month):

ComponentCost ShareExample CostExplanation
API Gateway (HTTP)20–25%$100Base request charges
Lambda backend40–50%$200Function execution time & memory
CloudWatch Logs15–25%$75Execution logging at INFO level
Data Transfer Out10–20%$50Response payload egress
AWS WAF (REST only)5–15%$30Threat protection (if enabled)
DynamoDB / RDSVaries widely$100–$1,000+Database query costs
Total100%~$455–$1,455Full stack monthly cost

API Gateway vs AppSync vs Application Load Balancer

API Gateway isn’t the only API frontend option on AWS. AppSync specializes in GraphQL, and Application Load Balancer provides basic HTTP routing without API-specific features at potentially lower cost for high-throughput scenarios.

Complete service comparison:

ServicePricing ModelREST SupportGraphQLWebSocketBest Use Case
API Gateway HTTP$1.00/M requests✅ Yes❌ No❌ NoSimple REST, webhooks, serverless
API Gateway REST$3.50/M requests✅ Yes (full)❌ No❌ NoComplex REST, enterprise, caching
API Gateway WebSocket$1.00/M msgs + conn. time❌ No❌ No✅ YesChat, live feeds, real-time
AppSync$4.00/M queries + $2.00/M subscriptions❌ No✅ Yes✅ Yes (subscriptions)GraphQL, real-time sync, mobile
Application Load Balancer$16.20/mo + $0.008/LCU✅ Yes (basic)✅ Passthrough❌ NoHigh-throughput microservices
Lambda Function URLFree✅ Yes (basic)❌ No❌ NoSimple webhooks, internal tools

3 API Gateway Cost Optimization Strategies

Default to HTTP APIs unless REST features are required.

Start every new API as HTTP API at $1.00/M. Upgrade to REST only when you identify specific need for caching, usage plans, WAF integration, or request transformation. Most serverless APIs operate perfectly on HTTP APIs, saving $2.50 per million requests (71% reduction) compared to REST. At 100M monthly requests, this decision alone saves $250 monthly or $3,000 annually with zero functional impact.

Disable caching unless backend costs mathematically justify cache fees.

REST API caching bills $14.60-$2,774 monthly continuously regardless of traffic. Calculate: (current Lambda cost per million requests) × (monthly request volume) × (expected cache hit rate). If result exceeds cache cost, enable caching. Otherwise, don’t. For most APIs, CloudFront caching in front of API Gateway delivers better economics: no fixed hourly costs, bills per-request, provides global edge caching improving latency worldwide. Evaluate CloudFront before enabling REST caching.

Use ERROR-level CloudWatch logging in production environments.

Full execution logging (INFO level) costs $0.50 per GB ingested, accumulating $50-500 monthly for medium-to-high-traffic APIs. Error-level logging captures only failed requests (4xx/5xx status codes), reducing volume 95-99% for healthy APIs while maintaining troubleshooting capability. Enable INFO logging temporarily during debugging, then disable immediately after issue resolution. This single configuration change saves $45-495 monthly at 100M-1B request volumes.

API Gateway Pricing FAQs

Is API Gateway free?
AWS offers 1M free requests per month for the first 12 months; afterward, costs vary by API type.

REST API vs HTTP API?
HTTP API is cheaper ($1/M vs $3.50/M) but lacks some REST-only features like caching and usage plans.

Can I use Lambda without API Gateway?
Yes, Lambda Function URLs provide free HTTPS endpoints without per-request charges.

How to reduce API Gateway costs?
Use HTTP API, disable full logging, implement Lambda Function URLs, batch requests, or deploy CloudFront caching.

Is API Gateway cheaper than ALB?
For <500M requests/month, HTTP API is cheaper; for higher traffic, ALB may be cost-competitive.

Conclusion

AWS API Gateway offers flexible, pay-per-request pricing across REST, HTTP, and WebSocket APIs. Understanding request types, choosing HTTP API when possible, and leveraging strategies like Lambda Function URLs, caching, and batching can dramatically reduce costs. For a complete cost optimization approach, teams should also consider Amazon S3 Pricing to manage storage and request expenses alongside API usage. At GoCloud, we help organizations implement these strategies, ensuring predictable, efficient, and optimized cloud deployments.

Popular Post

Get the latest articles and news about AWS

Scroll to Top