{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/metricspot-com/json-schema/metricspot-com-usage-snapshot-schema.json",
  "title": "UsageSnapshot",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/metricspot-com-openapi.yaml#/components/schemas/UsageSnapshot",
  "type": "object",
  "required": [
    "used",
    "cap",
    "resets_at",
    "plan",
    "status",
    "trial_ends_at"
  ],
  "properties": {
    "used": {
      "type": "integer",
      "description": "Audits run by this user in the current calendar month."
    },
    "cap": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Monthly audit cap. null means unlimited (admin or trialing)."
    },
    "resets_at": {
      "type": "string",
      "format": "date-time",
      "description": "ISO timestamp at the start of next month."
    },
    "plan": {
      "$ref": "#/$defs/PlanId"
    },
    "status": {
      "type": [
        "string",
        "null"
      ],
      "description": "Active subscription status (e.g. `active`, `trialing`, `past_due`, `canceled`), or null if none."
    },
    "trial_ends_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "ISO timestamp; non-null only while `status` is `trialing`."
    }
  },
  "$defs": {
    "PlanId": {
      "type": "string",
      "enum": [
        "free",
        "starter",
        "premium",
        "pro"
      ]
    }
  }
}