Metering
Both sides independently verify what was delivered. Token usage is estimated from HTTP content lengths and stream byte totals. Sellers generate EIP-191 signed receipts (using their secp256k1 identity key) after each request. Buyers independently verify receipts via ecrecover and flag disputes when estimates diverge.
Token Estimation
Provider-specific bytes-per-token ratios:
| Provider | Bytes/Token |
|---|---|
| anthropic | 4.2 |
| openai | 4.0 |
| 4.1 | |
| default | 4.0 |
For SSE streams, a factor of 0.82 is applied to account for framing overhead. Minimum thresholds: 100 tokens for requests, 10 tokens for responses.
Usage Receipts
{
"receiptId": "uuid-v4",
"sessionId": "session-uuid",
"eventId": "event-uuid",
"timestamp": 1708272000000,
"provider": "anthropic",
"sellerPeerId": "a1b2...40 hex (EVM address)",
"buyerPeerId": "c3d4...40 hex (EVM address)",
"tokens": {
"inputTokens": 1024,
"outputTokens": 512,
"totalTokens": 1536,
"method": "content-length",
"confidence": "high"
},
"unitPriceCentsPerThousandTokens": 300,
"costCents": 5,
"signature": "eip191...130 hex"
}
Cost Calculation
costUSD = (freshInputTokens * inputUsdPerMillion + cachedInputTokens * cachedInputUsdPerMillion + outputTokens * outputUsdPerMillion) / 1_000_000
cachedInputUsdPerMillion defaults to inputUsdPerMillion when not set by the seller. Non-zero usage always costs at least 1 cent. Zero tokens = zero cost.
Non-Token Unit Billing
Some protocols deliver billable units that are not tokens. Metadata v11 defines unit billing models; the first supported unit is output_images for openai-images services.
The seller announces one or more components with priceUsd and optional matching attributes such as size or quality. After the response arrives, both sides count non-empty delivered outputs and recompute the unit charge from the same model. Requested outputs that were not delivered are not charged.
If delivered positive usage matches no billing component, the seller rejects before forwarding when possible, and the buyer refuses payment authorization if it still receives an unpriceable response. Unit cost is added to any token cost for hybrid protocols.
Receipt Verification
Buyers verify the EIP-191 signature (recovering the seller's address via ecrecover) and compare token estimates. A dispute is flagged when the difference exceeds 15% or the signature is invalid. If their measurements diverge significantly, the transaction is disputed and the buyer is protected.