Cloud API & Egress Cost Calculator

Estimate monthly cloud costs for an API or app from request volume, per-request price, serverless compute, data egress and storage.

Updated · Free · Runs in your browser

million
US$

e.g. HTTP API gateway ~$1.00; REST API ~$3.50 per million.

GB-s

Memory (GB) × duration (s), e.g. 0.5 GB × 125 ms = 0.0625.

US$
KB
GB / month
GB / month
US$
GB
US$
US$

Databases, load balancers, support plans…

Estimated monthly cost —
Annual cost —
Unit cost —
Data transfer out —
Breakdown —
    Was this calculator helpful?

    The formula

    Request cost = requests × price per million ÷ 1,000,000
    Compute cost = requests × GB-seconds per request × price per GB-second
    Egress (GB) = requests × response size + other transfer;  egress cost = max(0, egress − free allowance) × price per GB
    Storage cost = GB stored × price per GB-month
    Monthly total = requests + compute + egress + storage + fixed costs

    Worked example

    1. An API serving 50 million requests a month at $1.00 per million: $50.00.
    2. Compute: 50M × 0.0625 GB-s × $0.0000166667 = $52.08.
    3. Egress: 50M × 15 KB = 750 GB plus 200 GB other = 950 GB; after 100 GB free, 850 GB × $0.09 = $76.50.
    4. Storage: 500 GB × $0.023 = $11.50, plus $25 fixed.
    5. Total ≈ $215.08 a month, or $4.30 per million requests.

    Where cloud costs come from

    Cloud bills are made up of many small unit prices: charges per request, per GB-second of compute, per GB of data stored and per GB of data transferred out. Each looks tiny, but at scale they add up, and the biggest item isn't always the one you expect. This calculator models a typical API or web app running on serverless or managed services, so you can see how each part of the bill changes as traffic grows and test the effect of optimisations before you deploy them.

    Requests and serverless compute

    Managed API gateways typically charge per million requests, roughly $1 for HTTP-style APIs and $3.50 for fuller REST APIs on AWS at published 2025 list prices, with volume discounts. Serverless functions such as AWS Lambda, Google Cloud Run functions and Azure Functions add a charge for GB-seconds, the memory allocated multiplied by how long each invocation runs, plus a small per-invocation fee. Halving a function's duration or memory halves its compute cost, so profiling hot paths and right-sizing memory pays off quickly.

    Egress: the hidden cost

    Data coming into the cloud is usually free, but data going out to the internet is charged per GB after a monthly free allowance, often around $0.05–0.12 per GB depending on provider, region and volume. For APIs that return large responses, media sites and downloads, egress is frequently the biggest line on the bill. Compressing responses with gzip or Brotli, caching at a CDN, paginating results and serving static assets from providers with cheap or free egress can cut costs dramatically. Our Base64 calculator shows how encoding inflates payloads.

    Storage and fixed costs

    Object storage such as S3, Google Cloud Storage and Azure Blob Storage costs a few cents per GB per month in standard tiers, with cheaper infrequent-access and archive tiers for data you rarely read. Databases, load balancers, NAT gateways, monitoring and support plans often have fixed hourly or monthly charges regardless of traffic; include them in fixed costs. NAT gateway data processing charges in particular surprise many teams, so check your architecture's data paths.

    Using the results

    The cost per million requests is a useful unit metric for pricing your own product: if each customer makes 2 million requests a month, they cost you about twice the per-million figure to serve. Compare the annual figure with reserved capacity, savings plans or a fixed server, which can be cheaper for steady, predictable workloads. Prices here are inputs, not live quotes: check your provider's current pricing page and calculator, since prices vary by region and change over time.

    A quick optimisation example

    In the default example, egress is the largest cost at $76.50. Enabling Brotli compression, which commonly shrinks JSON responses by 70–80%, would cut the 750 GB of API responses to about 190 GB and save around $50 a month. Caching popular responses at a CDN could reduce both request and egress charges further, while trimming function memory from 512 MB to 256 MB, if performance allows, would halve the compute line.

    For estimating ad revenue to cover hosting costs, try the CPM and eCPM calculator. To size bandwidth for backups and migrations, use the data transfer time calculator, and for storage hardware on-premises, the RAID calculator. Business owners comparing subscriptions can audit recurring software spending with our subscription cost calculator.

    Frequently asked questions

    How is AWS Lambda priced?
    By the number of requests and by GB-seconds of compute: allocated memory in GB multiplied by execution time. There's also a monthly free tier. Check AWS's current price list for your region and architecture.
    What is cloud egress?
    Data transferred out of a cloud provider's network to the internet or another region. It's usually charged per GB, while inbound data is typically free.
    How can I reduce cloud egress costs?
    Compress responses, cache content on a CDN, avoid sending unnecessary data, keep traffic within one region and consider providers with lower or zero egress fees.
    What is a GB-second?
    A unit of serverless compute: 1 GB of memory used for 1 second. A 512 MB function running for 200 ms uses 0.1 GB-seconds.
    Is serverless cheaper than a server?
    For spiky or low traffic, usually yes, since you pay only for what you use. For steady high traffic, reserved servers or containers are often cheaper per request.

    ↑↓ to navigate · Enter to open