{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mentio-dev/json-schema/mentio-dev-usage-summary-schema.json",
  "title": "UsageSummary",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mentio-dev-usage-api-openapi.yml#/components/schemas/UsageSummary",
  "type": "object",
  "properties": {
    "balance": {
      "type": "object",
      "properties": {
        "cents": {
          "type": "integer",
          "description": "Ledger balance: every credit minus every settled debit."
        },
        "pendingCents": {
          "type": "integer",
          "description": "Mentions and comments billed since the last daily settlement, priced but not yet debited."
        },
        "effectiveCents": {
          "type": "integer",
          "description": "cents minus pendingCents: what the stop rule and the keyword gate look at."
        },
        "currency": {
          "type": "string",
          "enum": [
            "USD"
          ]
        }
      },
      "required": [
        "cents",
        "pendingCents",
        "effectiveCents",
        "currency"
      ],
      "description": "The prepaid wallet."
    },
    "burn": {
      "type": "object",
      "properties": {
        "perDayCents": {
          "type": "integer",
          "description": "Average daily debit over the last 7 days (or since the workspace was created)."
        },
        "daysLeft": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "description": "effectiveCents divided by perDayCents; null when nothing is burning."
        }
      },
      "required": [
        "perDayCents",
        "daysLeft"
      ],
      "description": "How fast the balance goes."
    },
    "keywords": {
      "type": "object",
      "properties": {
        "active": {
          "type": "integer",
          "minimum": 0,
          "description": "Unmuted keywords, the ones charged daily."
        },
        "paused": {
          "type": "integer",
          "minimum": 0,
          "description": "Keywords the wallet paused for lack of balance; a top-up resumes them."
        },
        "capped": {
          "type": "integer",
          "minimum": 0,
          "description": "Unmuted keywords at their monthly mention cap: still charged daily, not matched until the month turns or the cap is raised."
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "description": "How many keywords the workspace may run right now: the self-serve ceiling when the balance covers one more keyword-day, else 0."
        },
        "dayCents": {
          "type": "integer",
          "description": "What one more day of the active keywords costs."
        }
      },
      "required": [
        "active",
        "paused",
        "capped",
        "limit",
        "dayCents"
      ],
      "description": "Keywords against the wallet."
    },
    "mentions": {
      "type": "object",
      "properties": {
        "today": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches recorded today (UTC), relevant or not: every one bills."
        },
        "last30d": {
          "type": "integer",
          "minimum": 0,
          "description": "Matches recorded in the last 30 days."
        }
      },
      "required": [
        "today",
        "last30d"
      ],
      "description": "Matched mentions, the other thing that bills."
    },
    "stopped": {
      "type": "boolean",
      "description": "The wallet paused tracking; a top-up that covers a day of every keyword resumes it."
    },
    "lowBalance": {
      "type": "boolean",
      "description": "Running, and the effective balance is at or under 20 percent of the last credit."
    },
    "lastTopUpAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "Newest paid top-up; null before the first."
    }
  },
  "required": [
    "balance",
    "burn",
    "keywords",
    "mentions",
    "stopped",
    "lowBalance",
    "lastTopUpAt"
  ]
}