API Gateway Access Log Cost Calculator (CloudWatch Logs)
Estimate API Gateway access log cost by converting requests/month x bytes/log into GB/day, then pricing ingestion and retention. Compare baseline vs peak volume.
Inputs
Requests (per month)
Avg 19.04 req/sec.
Avg RPS
Use baseline API traffic.
Est 105,062,400 requests/month.
Avg log bytes per request
Retention (days)
Ingest price ($ / GB)
Storage price ($ / GB-month)
Use your actual log format size. If unsure, sample 100-1,000 log lines and compute average bytes.
Scenario presets
Results
Estimated ingestion volume
2.47 GB/day
Estimated monthly total
$39.72
Ingest cost
$37.50
Storage cost
$2.22
How to estimate bytes per log line (quick, reliable)
- Export 100-1,000 log lines from a representative day.
- Compute average bytes/line (and p95 if you want a peak scenario).
- Re-check after changing log format: adding headers, user agents, and long paths can materially increase bytes per request.
High-leverage fixes for access log costs
- Log only the fields you use (drop large headers and rarely-used fields).
- Sample noisy endpoints (health checks, bots) instead of logging every request.
- Shorten retention for high-volume access logs and archive cold data if required.
How to get your inputs
- Volume: start from measured ingestion (GB/day) if you have it, then convert to monthly/retention where needed.
- Retention: decide retention days and model steady-state GB-month.
- Queries: model scan/query volume if your tool bills by GB scanned.
Result interpretation
- Requests and bytes/log drive ingestion; retention multiplies storage.
- If ingestion dominates, cut log size or sampling before changing retention.
Common mistakes
- Modeling ingestion but forgetting retention (GB-month) and scan/query costs.
- Keeping noisy logs forever instead of setting explicit retention tiers.
Scenario planning
| Scenario | Requests | Bytes/log | Retention |
|---|---|---|---|
| Baseline | Expected | Typical | Standard |
| Peak | High | Same | Same |
Validate after changes
- Check ingestion GB/day and retention GB-month after changes.
- Check query scan GB and dashboard refresh frequency (common hidden driver).
Next steps
Advertisement
Example scenario
- 50M requests/month with 1.5 KB average access log line -> estimate GB/day and monthly ingestion + retention cost.
- Peak 220% scenario captures launch or incident spikes in request volume.
Included
- Estimated ingestion volume (GB/day) from request volume and average log bytes.
- Optional RPS-based request estimator.
- Ingestion and retention storage cost estimate from your pricing inputs.
- Baseline vs peak scenario table for request spikes.
Not included
- API Gateway request pricing and response transfer pricing.
- Logs Insights query scan/search costs (model separately if needed).
How we calculate
- GB/day ~ (requests/month / 30.4) x bytes/log / 1e9.
- Monthly ingestion cost ~ (GB/day x 30.4) x $/GB.
- Retention storage cost uses a steady-state GB-month model for the retention window.
FAQ
How do I estimate average log bytes per request?
Sample your access log output (100-1,000 lines) and compute average bytes per line. Log format fields and headers can change size materially.
Does this include API Gateway request charges?
No. Use an API Gateway cost calculator for request and transfer charges. This focuses only on access logs stored in a logging system.
What levers reduce access log cost?
Reduce log verbosity/fields, sample logs for high-volume endpoints, and shorten retention for noisy logs.
Related tools
Related guides
Estimate API requests per month (RPS, logs, and metrics)
How to estimate monthly API request volume for cost models: from CloudWatch metrics, from access logs, and from RPS charts (with common pitfalls like retries and health checks).
CloudWatch dashboards pricing: what to include (dashboard-month + API)
A practical guide to CloudWatch dashboard costs: dashboard-month charges plus the hidden drivers (metrics API requests, alarms, and high-cardinality metrics).
CloudWatch Logs Insights cost optimization (reduce GB scanned)
A practical playbook to reduce CloudWatch Logs Insights costs: measure GB scanned, fix query patterns, time-bound dashboards, and avoid repeated incident scans.
CloudWatch Logs Insights pricing: what to model (GB scanned)
A practical Logs Insights pricing checklist: the core unit is GB scanned. Model scanned GB from query habits, avoid dashboard re-scan traps, and validate with a measured baseline.
CloudWatch Logs pricing: ingestion, retention, and queries
A practical CloudWatch Logs pricing guide: model ingestion (GB/day), retention (GB-month), and query/scan costs (Insights/Athena). Includes pitfalls and a validation checklist.
Estimate CloudWatch metrics API requests (dashboards and polling)
How to estimate CloudWatch metrics API request volume for cost models: derive requests from dashboards and tooling polling, include refresh rates, and validate with measured usage.
Advertisement
Disclaimer
Educational use only. Not legal, financial, or professional advice. Results are estimates based on the inputs and assumptions shown on this page. Verify pricing and limits with your providers and documentation.
Last updated: 2026-01-29