{
    "name": "API Gateway Request Cost Calculator",
    "url": "https://calculators.geekmidst.com/calculators/api-gateway-request-cost-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/api-gateway-request-cost-calculator.md",
    "category": "Software, cloud & AI",
    "description": "Estimate a monthly API gateway bill from request volume, a free allowance, two per-million price tiers and response data transferred out.",
    "summary": "API gateways usually charge a price per million requests, often cheaper above a volume threshold, plus data transfer for responses. Enter your own rates.",
    "also_called": [
        "API request pricing calculator"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "requests_m",
            "label": "Requests per month",
            "type": "number",
            "default": "500",
            "unit": "million"
        },
        {
            "name": "free_m",
            "label": "Free requests",
            "type": "number",
            "default": "1",
            "unit": "million",
            "optional": true
        },
        {
            "name": "tier1_m",
            "label": "First price tier covers",
            "type": "number",
            "default": "300",
            "unit": "million",
            "optional": true
        },
        {
            "name": "tier1_price",
            "label": "Price per million (first tier)",
            "type": "number",
            "default": "3.50"
        },
        {
            "name": "tier2_price",
            "label": "Price per million above the first tier",
            "type": "number",
            "default": "2.80",
            "optional": true
        },
        {
            "name": "payload_kb",
            "label": "Average response size",
            "type": "number",
            "default": "2",
            "unit": "kB",
            "optional": true
        },
        {
            "name": "egress_price",
            "label": "Data transfer price per GB",
            "type": "number",
            "default": "0.09",
            "optional": true
        },
        {
            "name": "currency",
            "label": "Currency",
            "type": "currency",
            "default": "USD"
        }
    ],
    "outputs": [
        {
            "key": "estimated_cost",
            "label": "Monthly cost",
            "format": "currency"
        },
        {
            "key": "request_cost",
            "label": "Request charges",
            "format": "currency"
        },
        {
            "key": "transfer_gb",
            "label": "Data transferred out",
            "format": "number"
        },
        {
            "key": "transfer_cost",
            "label": "Data transfer charges",
            "format": "currency"
        },
        {
            "key": "effective_per_million",
            "label": "Effective price per million requests",
            "format": "decimal4"
        },
        {
            "key": "billable_m",
            "label": "Billable requests (million)",
            "format": "number"
        }
    ],
    "formula": {
        "text": "Billable = Requests − Free;  Request cost = min(Billable, Tier) × P1 + max(0, Billable − Tier) × P2;  Transfer GB = Requests × Response kB ÷ 1,000,000",
        "variables": {
            "Requests, Free, Tier": "in millions of requests",
            "P1, P2": "price per million requests",
            "Response kB": "average response size in kilobytes (1,000 bytes)"
        }
    },
    "worked_example": {
        "inputs": {
            "requests_m": "500",
            "free_m": "1",
            "tier1_m": "300",
            "tier1_price": "3.50",
            "tier2_price": "2.80",
            "payload_kb": "2",
            "egress_price": "0.09",
            "currency": "USD"
        },
        "steps": [
            "Billable: 500 − 1 = 499 million.",
            "Requests: 300 × 3.50 + 199 × 2.80 = 1,050 + 557.20 = 1,607.20.",
            "Transfer: 500,000,000 × 2,000 bytes = 1,000 GB × 0.09 = 90. Total 1,697.20."
        ],
        "result": "At these example rates, 500 million requests with 2 kB responses cost about 1,697 a month."
    },
    "interpretation": "Compare the effective price per million with alternatives such as a load balancer or a different gateway type; at high volume the per-request charge can exceed the compute behind it.",
    "assumptions": [
        "The free allowance is taken from the first tier.",
        "Every request returns the average response size."
    ],
    "limitations": [
        "Caching, WebSocket connection minutes, custom authorisers and the backend’s own costs are not included."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "Do request headers count towards data transfer?",
            "answer": "Usually yes. If you know the full response size on the wire, use that instead of the body size."
        },
        {
            "question": "Why is the effective price lower than the first-tier price?",
            "answer": "Requests above the tier are charged at the lower second price, so the average falls as volume rises."
        }
    ],
    "sources": [],
    "related": [
        {
            "name": "Serverless Function Cost Calculator",
            "url": "https://calculators.geekmidst.com/calculators/serverless-invocation-cost-calculator"
        },
        {
            "name": "API Rate Limit Throughput Calculator",
            "url": "https://calculators.geekmidst.com/calculators/api-rate-limit-throughput-calculator"
        },
        {
            "name": "CDN Bandwidth Cost Calculator",
            "url": "https://calculators.geekmidst.com/calculators/cdn-bandwidth-cost-calculator"
        },
        {
            "name": "Cloud Storage Cost Calculator",
            "url": "https://calculators.geekmidst.com/calculators/cloud-storage-monthly-cost-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}