{
"$type": "com.atproto.lexicon.schema",
"defs": {
"main": {
"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.",
"errors": [
{
"description": "The period is not a UTC calendar month formatted YYYY-MM.",
"name": "InvalidRequest"
}
],
"output": {
"encoding": "application/json",
"schema": {
"properties": {
"approvals": {
"description": "Domains this identity agreed to spend its allowance on, with the cap it chose.",
"items": {
"description": "One identity's standing consent to spend its allowance on one domain.",
"properties": {
"approvedAt": {
"description": "When the identity agreed.",
"format": "datetime",
"type": "string"
},
"capBytes": {
"description": "The ceiling the identity chose for this domain. Absent means no ceiling of its own.",
"type": "integer"
},
"domain": {
"description": "The domain approved.",
"type": "string"
}
},
"required": [
"domain",
"approvedAt"
],
"type": "object"
},
"type": "array"
},
"consumption": {
"description": "One identity's allowance for one period.",
"properties": {
"byDomain": {
"description": "Spend by domain.",
"items": {
"description": "Where an identity's allowance went.",
"properties": {
"asVisitor": {
"description": "Whether this was somebody else's sender-pays site rather than the caller's own.",
"type": "boolean"
},
"bytesBilled": {
"description": "Billed bytes.",
"type": "integer"
},
"domain": {
"description": "The domain.",
"type": "string"
}
},
"required": [
"domain",
"bytesBilled"
],
"type": "object"
},
"type": "array"
},
"entitledBytes": {
"description": "What entitlements contributed.",
"type": "integer"
},
"entitlements": {
"items": {
"description": "One grant contributing to the allowance. The payment processor's reference is deliberately not exposed.",
"properties": {
"bytesPerPeriod": {
"description": "Bytes this entitlement adds per period.",
"type": "integer"
},
"endsAt": {
"description": "When it ends. Absent for an open-ended grant.",
"format": "datetime",
"type": "string"
},
"startsAt": {
"description": "When it started.",
"format": "datetime",
"type": "string"
}
},
"required": [
"bytesPerPeriod",
"startsAt"
],
"type": "object"
},
"type": "array"
},
"freeBytes": {
"description": "The free grant's contribution.",
"type": "integer"
},
"freePerDomainBytes": {
"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.",
"type": "integer"
},
"grantedBytes": {
"description": "The free grant plus every active entitlement.",
"type": "integer"
},
"headerEstimateBytes": {
"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.",
"type": "integer"
},
"period": {
"description": "The UTC calendar month, YYYY-MM.",
"type": "string"
},
"periodEndsAt": {
"description": "When the allowance resets.",
"format": "datetime",
"type": "string"
},
"reconciledAt": {
"description": "When the rollup last confirmed usedBytes against the recorded requests. Absent for a period still in progress.",
"format": "datetime",
"type": "string"
},
"remainingBytes": {
"description": "What is left, floored at zero.",
"type": "integer"
},
"usedBytes": {
"description": "Billable bytes spent so far.",
"type": "integer"
}
},
"required": [
"period",
"periodEndsAt",
"grantedBytes",
"usedBytes",
"remainingBytes",
"freeBytes",
"entitledBytes",
"headerEstimateBytes"
],
"type": "object"
}
},
"required": [
"consumption"
],
"type": "object"
}
},
"parameters": {
"properties": {
"period": {
"description": "A UTC calendar month as YYYY-MM. Defaults to the current one.",
"type": "string"
}
},
"type": "params"
},
"type": "query"
}
},
"id": "space.highport.manage.getConsumption",
"lexicon": 1
}