{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/okareo/json-schema/okareo-usage-metrics-response-schema.json",
  "title": "UsageMetricsResponse",
  "description": "Complete response for usage metrics request.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/okareo-usage-api-openapi.yml#/components/schemas/UsageMetricsResponse",
  "properties": {
    "organization_id": {
      "type": "string",
      "format": "uuid",
      "title": "Organization Id"
    },
    "period": {
      "$ref": "#/$defs/UsageMetricsPeriod"
    },
    "totals": {
      "$ref": "#/$defs/Metrics"
    },
    "details": {
      "items": {
        "$ref": "#/$defs/MetricDetail"
      },
      "type": "array",
      "title": "Details",
      "description": "Breakdown of metrics by time period based on precision"
    }
  },
  "type": "object",
  "required": [
    "organization_id",
    "period",
    "totals",
    "details"
  ],
  "$defs": {
    "MetricDetail": {
      "properties": {
        "period_start": {
          "type": "string",
          "format": "date-time",
          "title": "Period Start",
          "description": "Start of this time period"
        },
        "period_end": {
          "type": "string",
          "format": "date-time",
          "title": "Period End",
          "description": "End of this time period"
        },
        "voice_minutes": {
          "type": "number",
          "title": "Voice Minutes",
          "description": "Voice minutes for this period"
        },
        "simulations": {
          "type": "integer",
          "title": "Simulations",
          "description": "Simulations for this period"
        },
        "datapoints": {
          "type": "integer",
          "title": "Datapoints",
          "description": "Datapoints for this period"
        },
        "checks": {
          "type": "integer",
          "title": "Checks",
          "description": "Checks for this period"
        }
      },
      "type": "object",
      "required": [
        "period_start",
        "period_end",
        "voice_minutes",
        "simulations",
        "datapoints",
        "checks"
      ],
      "title": "MetricDetail",
      "description": "Metrics for a specific time period."
    },
    "Metrics": {
      "properties": {
        "voice_minutes": {
          "type": "number",
          "title": "Voice Minutes",
          "description": "Total voice/audio minutes captured (completed sessions only)"
        },
        "simulations": {
          "type": "integer",
          "title": "Simulations",
          "description": "Count of completed test runs (all types: voice and non-voice)"
        },
        "datapoints": {
          "type": "integer",
          "title": "Datapoints",
          "description": "Count of non-error datapoints (completed only)"
        },
        "checks": {
          "type": "integer",
          "title": "Checks",
          "description": "Total check executions (from completed test runs and monitors)"
        }
      },
      "type": "object",
      "required": [
        "voice_minutes",
        "simulations",
        "datapoints",
        "checks"
      ],
      "title": "Metrics",
      "description": "Individual usage metrics."
    },
    "UsageMetricsPeriod": {
      "properties": {
        "start_date": {
          "type": "string",
          "format": "date-time",
          "title": "Start Date"
        },
        "end_date": {
          "type": "string",
          "format": "date-time",
          "title": "End Date"
        }
      },
      "type": "object",
      "required": [
        "start_date",
        "end_date"
      ],
      "title": "UsageMetricsPeriod",
      "description": "Period information for metrics response."
    }
  }
}