API Payload Size Calculator
Size an API request payload and check it against gateway limits.
About API Payload Size Calculator
Batch size is bounded by the gateway limit less the envelope, so the safe maximum is a division rather than a guess. Compression raises the effective item count proportionally. Choosing a batch size just under the limit maximises throughput per request while avoiding the rejections that come from hitting the cap.
Formula
API Payload Size
Payload = items × bytes per item + envelope; batch size = (limit − envelope) ÷ bytes per item
- gateway limit
- Hard cap enforced by the API gateway or load balancer
Worked example
With the default values below, API Payload Size Calculator returns Payload Size of 83.789. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Items in the requestminimum 0
- 250
- Bytes per itemminimum 0 bytes
- 340 bytes
- Envelope and metadata sizeminimum 0 bytes
- 800 bytes
- Gateway payload limitminimum 0.001 KB
- 1,024 KB
- Request compression savingaccepts 0–100 %
- 0 %
Results
- Payload Size
- 83.789 KB
- Payload After Compression
- 83.789 KB
- Share of the Gateway Limit Used
- 8.183%
- Maximum Items per Request
- 3,081
- Requests Needed for All Items
- 1
Step by step
- 1Values used
- 2API Payload Size
- 3Payload Size= 83.789 KB
- 4Payload After Compression= 83.789 KB
- 5Share of the Gateway Limit Used= 8.183
- 6Maximum Items per Request= 3,081
- 7Requests Needed for All Items= 1
Assumptions and limits
- The result is derived only from the 5 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax or compounding frequency into account.
- Figures are rounded for display to 3 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How is API Payload Size calculated?
Payload = items × bytes per item + envelope; batch size = (limit − envelope) ÷ bytes per item Batch size is bounded by the gateway limit less the envelope, so the safe maximum is a division rather than a guess. Compression raises the effective item count proportionally.
Why does API Payload Size matter?
Choosing a batch size just under the limit maximises throughput per request while avoiding the rejections that come from hitting the cap.
What values do I need to enter?
This calculator takes 5 inputs: Items in the request, Bytes per item, Envelope and metadata size, Gateway payload limit, Request compression saving. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
