{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bellatorsi-com/json-schema/bellatorsi-com-usage-me-response-schema.json",
  "title": "UsageMeResponse",
  "description": "Response for GET /api/v1/usage/me — current user's aggregate usage.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bellatorsi-com-usage-quota-api-openapi.yml#/components/schemas/UsageMeResponse",
  "properties": {
    "user_id": {
      "type": "string",
      "title": "User Id",
      "description": "User ID"
    },
    "tier": {
      "type": "string",
      "title": "Tier",
      "description": "Current account tier"
    },
    "period": {
      "$ref": "#/$defs/UsagePeriod",
      "description": "Current billing period"
    },
    "task_telemetry": {
      "additionalProperties": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "integer"
          }
        ]
      },
      "type": "object",
      "title": "Task Telemetry",
      "description": "Task analytics (informational, not a monthly quota gate)"
    },
    "calls": {
      "additionalProperties": {
        "anyOf": [
          {
            "type": "number"
          },
          {
            "type": "integer"
          }
        ]
      },
      "type": "object",
      "title": "Calls",
      "description": "Call quota usage and percentage"
    },
    "keys": {
      "items": {
        "$ref": "#/$defs/KeyUsageSummary"
      },
      "type": "array",
      "title": "Keys",
      "description": "Per-key breakdown"
    },
    "warnings": {
      "items": {
        "additionalProperties": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            }
          ]
        },
        "type": "object"
      },
      "type": "array",
      "title": "Warnings",
      "description": "Quota warning objects (70%/90% thresholds)"
    }
  },
  "type": "object",
  "required": [
    "user_id",
    "tier",
    "period",
    "calls"
  ],
  "$defs": {
    "KeyUsageSummary": {
      "properties": {
        "key_id": {
          "type": "string",
          "title": "Key Id",
          "description": "API key ID (UUID)"
        },
        "prefix": {
          "type": "string",
          "title": "Prefix",
          "description": "Key prefix (first 8 chars visible)"
        },
        "tasks": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Tasks",
          "description": "Tasks processed by this key this month"
        },
        "calls": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Calls",
          "description": "API calls made by this key this month"
        },
        "last_used": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Used",
          "description": "Last usage timestamp"
        }
      },
      "type": "object",
      "required": [
        "key_id",
        "prefix",
        "tasks",
        "calls"
      ],
      "title": "KeyUsageSummary",
      "description": "Per-key usage summary for dashboard display."
    },
    "UsagePeriod": {
      "properties": {
        "start": {
          "type": "string",
          "format": "date-time",
          "title": "Start",
          "description": "Period start (UTC)"
        },
        "end": {
          "type": "string",
          "format": "date-time",
          "title": "End",
          "description": "Period end (UTC)"
        }
      },
      "type": "object",
      "required": [
        "start",
        "end"
      ],
      "title": "UsagePeriod",
      "description": "Billing period window (UTC month boundaries)."
    }
  }
}