{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/skribble/main/json-schema/skribble-billing-credit-usage-schema.json",
  "title": "BillingCreditUsage",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/skribble-validation-v1-openapi.yml#/components/schemas/BillingCreditUsage",
  "type": "object",
  "properties": {
    "period": {
      "type": "string",
      "description": "Billing period in YYYYMM format"
    },
    "usage": {
      "type": "array",
      "description": "Array of consumptions, each detailing an endpoint use and its credit usage",
      "items": {
        "$ref": "#/$defs/CreditUsage"
      }
    },
    "requests": {
      "type": "integer",
      "description": "Total of requests made"
    },
    "credits": {
      "type": "integer",
      "description": "Total of credits used"
    }
  },
  "$defs": {
    "CreditUsage": {
      "type": "object",
      "properties": {
        "endpoint": {
          "type": "string",
          "description": "The API endpoint being consumed"
        },
        "requests": {
          "type": "integer",
          "description": "Number of credits consumed by the endpoint call"
        },
        "credits": {
          "type": "integer",
          "description": "The number of credits consumed through the corresponding endpoint"
        }
      }
    }
  }
}