{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/klisten-co-kr/json-schema/klisten-co-kr-meter-usage-schema.json",
  "title": "MeterUsage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/klisten-co-kr-metermcp-api-openapi.yml#/components/schemas/MeterUsage",
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "string",
      "const": "klisten.metermcp.usage.v1"
    },
    "live_usage": {
      "type": "boolean",
      "const": true
    },
    "external_settlement": {
      "type": "boolean",
      "const": false
    },
    "currency": {
      "type": "string",
      "const": "USD"
    },
    "basis": {
      "type": "string",
      "const": "current_reservation_state_by_budget_day_utc"
    },
    "scope": {
      "type": "object",
      "properties": {
        "organization_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "key_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        }
      },
      "required": [
        "organization_id",
        "key_id"
      ],
      "additionalProperties": false
    },
    "range": {
      "type": "object",
      "properties": {
        "from": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        },
        "to": {
          "type": "string",
          "format": "date",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
        }
      },
      "required": [
        "from",
        "to"
      ],
      "additionalProperties": false
    },
    "as_of": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
    },
    "totals": {
      "type": "object",
      "properties": {
        "reservation_count": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "reserved_count": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "held_count": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "captured_count": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "released_count": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "reserved_micro_usd": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "held_micro_usd": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "captured_micro_usd": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        },
        "released_micro_usd": {
          "type": "string",
          "pattern": "^(0|[1-9][0-9]*)$"
        }
      },
      "required": [
        "reservation_count",
        "reserved_count",
        "held_count",
        "captured_count",
        "released_count",
        "reserved_micro_usd",
        "held_micro_usd",
        "captured_micro_usd",
        "released_micro_usd"
      ],
      "additionalProperties": false
    },
    "daily": {
      "maxItems": 31,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "reservation_count": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "reserved_count": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "held_count": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "captured_count": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "released_count": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "reserved_micro_usd": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "held_micro_usd": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "captured_micro_usd": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "released_micro_usd": {
            "type": "string",
            "pattern": "^(0|[1-9][0-9]*)$"
          },
          "day": {
            "type": "string",
            "format": "date",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
          }
        },
        "required": [
          "reservation_count",
          "reserved_count",
          "held_count",
          "captured_count",
          "released_count",
          "reserved_micro_usd",
          "held_micro_usd",
          "captured_micro_usd",
          "released_micro_usd",
          "day"
        ],
        "additionalProperties": false
      }
    }
  },
  "required": [
    "schema_version",
    "live_usage",
    "external_settlement",
    "currency",
    "basis",
    "scope",
    "range",
    "as_of",
    "totals",
    "daily"
  ],
  "additionalProperties": false
}