6 Tips to Control the Cost (2024)

In this article, you will learn:

  • Amazon API Gateway free tier
  • API Gateway on-demand pricing
  • Six Amazon API Gateway cost optimization tips

Amazon API Gateway is the Amazon Web Services(AWS) solution for connecting an API to the public Internet or a private network. In a lot of cases, it’s an important piece of AWS architecture and it’s therefore equally important to understand its pricing. API Gateway is often also the most expensive piece of AWS serverless infrastructure, though depending on how it is used and optimized, costs can be kept very low.

In this blog post, we will cover AWS’s API Gateway pricing, the free tier, and how to optimize its costs.

Amazon API Gateway free tier

API Gateway is billed based on the usage:

  • A number of requests per month to your API.
  • Connection minutes for Websocket APIs.
  • Cache memory size and minutes of its actual usage.
  • Additional charges, such as Data transfer out (DTO).

API Gateway free-tier

API Gateway provides a free tier that is available for 12 months after the initial sign-up date. When this 12-month term expires or if your application use exceeds the tiers, you simply pay standard rates.

The monthly free tier includes:

  • 1 million REST API calls
  • 1 million HTTP API calls
  • 1 million messages
  • 750,000 connection minutes

Amazon API Gateway on-demand pricing

HTTP APIs

HTTP APIs are charged based on the number of API calls made. HTTP APIs calls are metered in 512 KB increments, so for example, 513 KB is metered as two requests.

This is the pricing in the Europe (Ireland) region:

6 Tips to Control the Cost (1)

REST APIs

REST APIs are also charged based on the number of API calls made. This is the current pricing in the Europe (Ireland) region.

6 Tips to Control the Cost (2)

Websocket APIs*

Websocket APIs are charged based on the number of messages sent and received as well as the total number of connection minutes. Messages are metered in 32 KB increments, so for example, 33 KB is metered as two requests.

The table below shows the current pricing for messages in Europe (Ireland):

6 Tips to Control the Cost (3)

Connection Minutes are charged at $0.25 per million connection minutes.

API gateway cache pricing

REST APIs provide the ability to provision a dedicated cache to improve performance. The pricing for the cache is based on the amount of memory provisioned.

6 Tips to Control the Cost (4)

Additional charges

There might also be other additional charges depending on how the API Gateway is being used such as:

  • Data transfer: If you transfer data to the public Internet, you will be charged at the EC2 data transfer rate(0.09$ per GB). Learn more about it in the cost optimization tip.
  • Cloudwatch: Includes pricing for metrics and dashboards.
  • AWS Lambda and other services.

Six Amazon API Gateway cost optimization tips

The costs of Amazon API Gateway are often higher than of a Lambda itself and while these costs are adequate for the specific features (e.g. authentication management, caching, request/response transformation, proxying), there are a couple of ways to generally save on its costs or even not use it at all and choose other services from AWS.

6 Tips to Control the Cost (5)

1. Right type of API gateway

What you can do to optimize your API Gateway costs is to choose the right type of API Gateway. AWS offers both REST APIs and HTTP APIs. The HTTP API has more limited functionality but is also much cheaper. If it suits your needs you can save a lot of money by using it over the REST API.

For existing REST APIs, consider migrating to HTTP APIs. When planning for migration, see Choosing between HTTP APIs and REST APIs to compare HTTP API and REST API supported features.

2. API Gateway integration feature

Another great tip to save on your API Gateway bill is to use AWS service proxy integrations instead of combining a Lambda function to transfer/transform input data from the client. You can integrate API Gateway with other AWS services directly (e.g. Kinesis, DynamoDB, SQS, SNS, etc.) by using API Gateway integration features.

3. Cognito authentication

When your front-end is the only consumer of the backend APIs, you can leverage Cognito to obtain IAM credentials for your users. They can then invoke your Lambda functions safely using the AWS Javascript SDK and the temporary credentials. This solution allows you to achieve both authentication and authorization via IAM, avoiding the need for an API Gateway at the cost of reduced functionalities (you have to prepare your request on the frontend side, and also manage responses and errors in your Lambda code).

4. Replace API Gateway with ALB (Application Load Balancer)

As your application scales, consider replacing the API Gateway with an ALB (Application Load Balancer). Since ALB supports triggering the Lambda function, ALB could be a better choice for cost savings unless you’re using Amazon API Gateway’s unique features, such as authentication management, caching, and request/response transformation.

5. Reduce unnecessary API calls

Remove any unnecessary API calls and optimize your application to prevent them. As your application evolves we often end up with redundant and unnecessary API calls and these can add significantly to our costs.

6. Reduce data transfer costs

If you transfer data from API Gateway to the public Internet, you will be charged at the standard data transfer rate (0.09$ per GB).

6 Tips to Control the Cost (6)

At StormIT we have helped many customers to optimize their overall spending on data transfer (egress bandwidth) from different industries with a broad range of use cases from web applications and blogs to media streaming and gaming.

Using a content delivery network such as Amazon CloudFront is essential to keeping data transfer costs low. CloudFront moves your most accessed content to the “front” of the AWS network (i.e., PoPs), ensuring fast delivery to your end users. Data transfers into CloudFront from other AWS resources (S3, EC2, API Gateway) are free.

6 Tips to Control the Cost (7)

Obviously, every project/case is unique, but we are confident that by smartly using CloudFront it is possible to achieve overall lower costs and improved performance.

Estimate Your Monthly Bill

Save up to 60% on your CDN cost with StormIT optimized pricing. Just fill-in the information below and see an estimate of savings rightaway.

Estimate Your Monthly Bill

Save up to 60% on your CDN cost with StormIT optimized pricing

NaN%

Your Estimated Monthly Bill

$0

for TB of data transfer out and 0 requests per month

StormIT mothly data transfer costs

$0

StormIT mothly request costs

$0

Savings on AWS data transfer costs

NaN%

Savings on AWS requests costs

NaN%

Please note the amount above is only an estimate. We'll check your provided data and contact you for further discussion and a custom price offering.

Conclusion

Amazon API Gateway is one of the most popular serverless services from AWS. Customers are charged based on a pay-as-you-go model which is very cost efficient for some customers. This blog post introduced Amazon API Gateway pricing and should help you with the cost optimization of this service.

6 Tips to Control the Cost (2024)
Top Articles
What Do Hackers Want From Your Organization?
What Do Luxury Consumers Want From Brands? - The Olinger Group
3 Tick Granite Osrs
Time in Baltimore, Maryland, United States now
855-392-7812
Pangphip Application
Myexperience Login Northwell
Academic Integrity
Athletic Squad With Poles Crossword
Ogeechee Tech Blackboard
Ave Bradley, Global SVP of design and creative director at Kimpton Hotels & Restaurants | Hospitality Interiors
Whitley County Ky Mugshots Busted
5808 W 110Th St Overland Park Ks 66211 Directions
Oc Craiglsit
Nioh 2: Divine Gear [Hands-on Experience]
Nissan Rogue Tire Size
Mzinchaleft
Tygodnik Polityka - Polityka.pl
2024 INFINITI Q50 Specs, Trims, Dimensions & Prices
Aes Salt Lake City Showdown
Vernon Dursley To Harry Potter Nyt Crossword
Обзор Joxi: Что это такое? Отзывы, аналоги, сайт и инструкции | APS
Soul Eater Resonance Wavelength Tier List
HP PARTSURFER - spare part search portal
Valley Craigslist
The Creator Showtimes Near Baxter Avenue Theatres
Ehome America Coupon Code
Craigslist Texas Killeen
Craigslist Maryland Baltimore
Forager How-to Get Archaeology Items - Dino Egg, Anchor, Fossil, Frozen Relic, Frozen Squid, Kapala, Lava Eel, and More!
Nacho Libre Baptized Gif
AsROck Q1900B ITX und Ramverträglichkeit
Louisville Volleyball Team Leaks
Are you ready for some football? Zag Alum Justin Lange Forges Career in NFL
3400 Grams In Pounds
968 woorden beginnen met kruis
Davis Fire Friday live updates: Community meeting set for 7 p.m. with Lombardo
Clima De 10 Días Para 60120
Man Stuff Idaho
Ezpawn Online Payment
Pekin Soccer Tournament
Subdomain Finder
Shipping Container Storage Containers 40'HCs - general for sale - by dealer - craigslist
3 bis 4 Saison-Schlafsack - hier online kaufen bei Outwell
Www Craigslist Com Atlanta Ga
2017 Ford F550 Rear Axle Nut Torque Spec
The Sports Academy - 101 Glenwest Drive, Glen Carbon, Illinois 62034 - Guide
8 4 Study Guide And Intervention Trigonometry
Windy Bee Favor
Lesson 5 Homework 4.5 Answer Key
Black Adam Showtimes Near Cinemark Texarkana 14
Island Vibes Cafe Exeter Nh
Latest Posts
Article information

Author: Terrell Hackett

Last Updated:

Views: 5823

Rating: 4.1 / 5 (52 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Terrell Hackett

Birthday: 1992-03-17

Address: Suite 453 459 Gibson Squares, East Adriane, AK 71925-5692

Phone: +21811810803470

Job: Chief Representative

Hobby: Board games, Rock climbing, Ghost hunting, Origami, Kabaddi, Mushroom hunting, Gaming

Introduction: My name is Terrell Hackett, I am a gleaming, brainy, courageous, helpful, healthy, cooperative, graceful person who loves writing and wants to share my knowledge and understanding with you.