Metering
The metered amount is built from the response size and the handler runtime, in base units, then clamped to the cap:effectiveBytes is the response body size; when the endpoint sets a maxResponseBytes, it is min(bodyBytes, maxResponseBytes) so an oversize body cannot bill past the configured ceiling. All arithmetic is bigint base-unit math on USDC, and the cap the buyer signed is a hard ceiling: min(metered, cap) can never exceed it.
base, perKB, and computeMultiplier come from the endpoint’s pricing, quoted in the 402 pricing block. The buyer sees the model and the cap before signing, so the price is bounded and predictable even though the exact figure depends on the response. See pricing and bonds.Worked example
Worked example
Suppose
base = 100, perKB = 50, computeMultiplier = 10, a 3 KB response (effectiveBytes = 3072), and a 250 ms handler. Then ceil(3072/1024) = 3 size units and ceil(250/100) = 3 compute units, so metered = 100 + 50*3 + 10*3 = 280 base units. If the signed cap is 500, the buyer is charged min(280, 500) = 280. If the cap were 200, the buyer would be charged 200, the ceiling.Classification
A classifier compiled from the endpoint’sopenapi.json validates the response body and returns one of three grades. Metering only matters for a success; the other two grades never charge the metered amount.
1
Try the success schema
If the body validates against the endpoint’s declared success schema, the grade is
success.2
Try the error schema
Otherwise, if the body validates against the declared error schema, the grade is
declared_error. This is a well-formed “your input was bad” answer, not a broken endpoint.3
Everything else is a malfunction
Otherwise, or if the body is non-JSON or unparseable, or the handler timed out or threw, the grade is
malfunction.Three grades, three behaviors
Classification is the branch that the escrow response gate calls “the gate”. The reservation is already locked when the handler returns; the grade decides whether the facilitator debits
min(computed, cap), releases with no charge, or releases and records a strike.
Related
The escrow response gate
Where metering and classification sit in the full flow.
The utter-escrow scheme
The 402 quote and the capped authorization the buyer signs.
Reputation and strikes
What a strike does and how endpoints are deactivated.
Pricing and bonds
How a creator sets base, perKB, and the cap.