{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/commareports-com/json-schema/commareports-com-usage-schema.json",
  "title": "Usage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/commareports-com-account-api-openapi.yml#/components/schemas/Usage",
  "type": "object",
  "properties": {
    "month_start": {
      "type": "string",
      "format": "date",
      "description": "First day of the current UTC month."
    },
    "plan": {
      "type": "string"
    },
    "credit_balance_usd": {
      "type": "number",
      "description": "Prepaid AI-compute balance."
    },
    "runs": {
      "type": "integer"
    },
    "input_tokens": {
      "type": "integer"
    },
    "output_tokens": {
      "type": "integer"
    },
    "raw_cost_usd": {
      "type": "number"
    },
    "billable_cost_usd": {
      "type": "number",
      "description": "raw_cost_usd × (1 + markup)."
    },
    "monthly_usd_cap": {
      "type": [
        "number",
        "null"
      ]
    },
    "by_skill": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UsageBySkill"
      }
    }
  },
  "required": [
    "month_start",
    "plan",
    "credit_balance_usd",
    "runs",
    "raw_cost_usd",
    "billable_cost_usd",
    "by_skill"
  ],
  "$defs": {
    "UsageBySkill": {
      "type": "object",
      "properties": {
        "skill_id": {
          "type": "string",
          "format": "uuid"
        },
        "skill_name": {
          "type": "string"
        },
        "runs": {
          "type": "integer"
        },
        "raw_cost_usd": {
          "type": "number"
        },
        "billable_cost_usd": {
          "type": "number"
        }
      },
      "required": [
        "skill_id",
        "skill_name",
        "runs",
        "raw_cost_usd",
        "billable_cost_usd"
      ]
    }
  }
}