{
"id": "space.highport.manage.getConsumption",
"defs": {
"main": {
"type": "query",
"errors": [
{
"name": "InvalidRequest",
"description": "The period is not a UTC calendar month formatted YYYY-MM."
}
],
"output": {
"schema": {
"type": "object",
"required": [
"consumption"
],
"properties": {
"approvals": {
"type": "array",
"items": {
"type": "object",
"required": [
"domain",
"approvedAt"
],
"properties": {
"domain": {
"type": "string",
"description": "The domain approved."
},
"capBytes": {
"type": "integer",
"description": "The ceiling the identity chose for this domain. Absent means no ceiling of its own."
},
"approvedAt": {
"type": "string",
"format": "datetime",
"description": "When the identity agreed."
}
},
"description": "One identity's standing consent to spend its allowance on one domain."
},
"description": "Domains this identity agreed to spend its allowance on, with the cap it chose."
},
"consumption": {
"type": "object",
"required": [
"period",
"periodEndsAt",
"grantedBytes",
"usedBytes",
"remainingBytes",
"freeBytes",
"entitledBytes",
"headerEstimateBytes"
],
"properties": {
"period": {
"type": "string",
"description": "The UTC calendar month, YYYY-MM."
},
"byDomain": {
"type": "array",
"items": {
"type": "object",
"required": [
"domain",
"bytesBilled"
],
"properties": {
"domain": {
"type": "string",
"description": "The domain."
},
"asVisitor": {
"type": "boolean",
"description": "Whether this was somebody else's sender-pays site rather than the caller's own."
},
"bytesBilled": {
"type": "integer",
"description": "Billed bytes."
}
},
"description": "Where an identity's allowance went."
},
"description": "Spend by domain."
},
"freeBytes": {
"type": "integer",
"description": "The free grant's contribution."
},
"usedBytes": {
"type": "integer",
"description": "Billable bytes spent so far."
},
"entitlements": {
"type": "array",
"items": {
"type": "object",
"required": [
"bytesPerPeriod",
"startsAt"
],
"properties": {
"endsAt": {
"type": "string",
"format": "datetime",
"description": "When it ends. Absent for an open-ended grant."
},
"startsAt": {
"type": "string",
"format": "datetime",
"description": "When it started."
},
"bytesPerPeriod": {
"type": "integer",
"description": "Bytes this entitlement adds per period."
}
},
"description": "One grant contributing to the allowance. The payment processor's reference is deliberately not exposed."
}
},
"grantedBytes": {
"type": "integer",
"description": "The free grant plus every active entitlement."
},
"periodEndsAt": {
"type": "string",
"format": "datetime",
"description": "When the allowance resets."
},
"reconciledAt": {
"type": "string",
"format": "datetime",
"description": "When the rollup last confirmed usedBytes against the recorded requests. Absent for a period still in progress."
},
"entitledBytes": {
"type": "integer",
"description": "What entitlements contributed."
},
"remainingBytes": {
"type": "integer",
"description": "What is left, floored at zero."
},
"freePerDomainBytes": {
"type": "integer",
"description": "The ceiling on what the free grant may spend at any one domain in this period. Purchased quota is not capped this way, and zero means the free grant may not be spent on a third party's site at all. It is the limit that refuses a reader at one domain while their allowance still shows headroom."
},
"headerEstimateBytes": {
"type": "integer",
"description": "The flat per-response constant included in usedBytes. Every byte figure here is an estimate by this much per response, because the edge's access log records the response body only."
}
},
"description": "One identity's allowance for one period."
}
}
},
"encoding": "application/json"
},
"parameters": {
"type": "params",
"properties": {
"period": {
"type": "string",
"description": "A UTC calendar month as YYYY-MM. Defaults to the current one."
}
}
},
"description": "The calling identity's allowance for a period: what it was granted, what it has spent, what remains, which entitlements contributed, and which domains it has approved to draw on it. One wallet, spent by the identity's own sites and by its browsing of sender-pays sites alike."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}