{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dotsy-ai/json-schema/dotsy-ai-workspace-views-usage-schema.json",
  "title": "WorkspaceViewsUsage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dotsy-ai-account-api-openapi.yml#/components/schemas/WorkspaceViewsUsage",
  "type": "object",
  "properties": {
    "used": {
      "type": "integer",
      "description": "Human page views this month (UTC), from the nightly frozen analytics."
    },
    "max": {
      "type": [
        "integer",
        "null"
      ]
    },
    "pct": {
      "type": "integer"
    },
    "state": {
      "type": "string",
      "enum": [
        "ok",
        "near",
        "over"
      ],
      "description": "`near` from 80 %, `over` from 100 %. A soft limit: sites keep serving either way."
    },
    "periodStart": {
      "type": "string",
      "description": "First day of the month the count covers (YYYY-MM-DD)."
    },
    "overSince": {
      "type": [
        "string",
        "null"
      ],
      "description": "When this month's count first passed 100 %."
    },
    "spendLimit": {
      "type": "string",
      "enum": [
        "ask",
        "badge"
      ],
      "description": "`ask` (default): extra views on a paid plan are billed. `badge`: extra views are not billed and the sites show the dotsy badge until next month, an upgrade, or the limit is turned off."
    },
    "badge": {
      "type": "boolean",
      "description": "The spend limit is hit and the dotsy badge is on for every site."
    }
  },
  "required": [
    "used",
    "max",
    "pct",
    "state",
    "periodStart",
    "overSince",
    "spendLimit",
    "badge"
  ]
}