{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rumoro-dev/json-schema/rumoro-dev-usage-summary-schema.json",
  "title": "UsageSummary",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rumoro-dev-usage-api-openapi.yml#/components/schemas/UsageSummary",
  "type": "object",
  "properties": {
    "balance": {
      "type": "object",
      "properties": {
        "cents": {
          "type": "integer",
          "description": "The ledger balance, all credits minus all settled debits."
        },
        "pendingCents": {
          "type": "integer",
          "description": "Cost of mentions matched after the last daily settlement. Not debited yet."
        },
        "effectiveCents": {
          "type": "integer",
          "description": "cents minus pendingCents. Pausing at zero and the check before adding keywords both use this number."
        },
        "currency": {
          "type": "string",
          "enum": [
            "USD"
          ]
        }
      },
      "required": [
        "cents",
        "pendingCents",
        "effectiveCents",
        "currency"
      ],
      "description": "The prepaid balance."
    },
    "burn": {
      "type": "object",
      "properties": {
        "perDayCents": {
          "type": "integer",
          "description": "Mean daily debit across the past 7 days, or the workspace's lifetime if shorter."
        },
        "daysLeft": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "description": "effectiveCents over perDayCents, rounded down. Null when perDayCents is 0."
        }
      },
      "required": [
        "perDayCents",
        "daysLeft"
      ],
      "description": "How quickly the balance is being spent."
    },
    "keywords": {
      "type": "object",
      "properties": {
        "active": {
          "type": "integer",
          "minimum": 0,
          "description": "Keywords that are not muted. These are charged each day."
        },
        "paused": {
          "type": "integer",
          "minimum": 0,
          "description": "Keywords paused because the balance ran out. A top-up resumes them."
        },
        "capped": {
          "type": "integer",
          "minimum": 0,
          "description": "Keywords that are not muted but reached their monthly mention cap. They are still charged each day and are not matched until the next month or until the cap is raised."
        },
        "limit": {
          "type": "integer",
          "minimum": 0,
          "description": "Keywords the workspace may run now. 0 if the balance can't cover one more keyword-day, otherwise the self-serve maximum."
        },
        "dayCents": {
          "type": "integer",
          "description": "Daily cost of the active keywords."
        }
      },
      "required": [
        "active",
        "paused",
        "capped",
        "limit",
        "dayCents"
      ],
      "description": "Keyword counts compared with the balance."
    },
    "mentions": {
      "type": "object",
      "properties": {
        "today": {
          "type": "integer",
          "minimum": 0,
          "description": "Count of matches since midnight UTC, relevant or not."
        },
        "last30d": {
          "type": "integer",
          "minimum": 0,
          "description": "Match count for the past 30 days."
        }
      },
      "required": [
        "today",
        "last30d"
      ],
      "description": "Matched mentions, which are billed along with keyword-days."
    },
    "stopped": {
      "type": "boolean",
      "description": "True when tracking is paused because the balance ran out. It resumes after a top-up that covers one day of every keyword."
    },
    "lowBalance": {
      "type": "boolean",
      "description": "true when 20 percent or less of the last credit remains (effective balance) and tracking is on."
    },
    "lastTopUpAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "Latest paid top-up time, or null if there is none."
    }
  },
  "required": [
    "balance",
    "burn",
    "keywords",
    "mentions",
    "stopped",
    "lowBalance",
    "lastTopUpAt"
  ]
}