{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/placestack-com/json-schema/placestack-com-usage-summary-schema.json",
  "title": "UsageSummary",
  "description": "Requests and credits over a period.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/placestack-com-usage-api-openapi.yml#/components/schemas/UsageSummary",
  "properties": {
    "object": {
      "type": "string",
      "const": "usage_summary",
      "title": "Object",
      "description": "The object's type. Always `usage_summary`.",
      "default": "usage_summary"
    },
    "organization_id": {
      "type": "string",
      "title": "Organization Id",
      "description": "The organization's id."
    },
    "since": {
      "type": "string",
      "format": "date-time",
      "title": "Since",
      "description": "The start of the period."
    },
    "until": {
      "type": "string",
      "format": "date-time",
      "title": "Until",
      "description": "The end of the period: the time of the request."
    },
    "requests": {
      "type": "integer",
      "title": "Requests",
      "description": "Requests made in the period."
    },
    "credits_spent": {
      "type": "integer",
      "title": "Credits Spent",
      "description": "Credits spent in the period."
    },
    "free_requests": {
      "type": "integer",
      "title": "Free Requests",
      "description": "Successful requests that cost no credits: free endpoints, repeat requests within a day, empty results and reads in Explorer."
    },
    "credit_balance": {
      "type": "integer",
      "title": "Credit Balance",
      "description": "The current credit balance."
    },
    "included_credits": {
      "type": "integer",
      "title": "Included Credits",
      "description": "Credits included with the plan each billing period. `0` without a plan."
    },
    "daily": {
      "items": {
        "$ref": "#/$defs/usage__Point"
      },
      "type": "array",
      "title": "Daily",
      "description": "Requests and credits by day, oldest first."
    },
    "by_endpoint": {
      "items": {
        "$ref": "#/$defs/Breakdown"
      },
      "type": "array",
      "title": "By Endpoint",
      "description": "Requests and credits by endpoint, most credits first. At most 20."
    },
    "by_key": {
      "items": {
        "$ref": "#/$defs/Breakdown"
      },
      "type": "array",
      "title": "By Key",
      "description": "Requests and credits by API key, most credits first. At most 20. Requests made without a key are grouped as `Console`, `MCP` or `OAuth`."
    }
  },
  "type": "object",
  "required": [
    "object",
    "organization_id",
    "since",
    "until",
    "requests",
    "credits_spent",
    "free_requests",
    "credit_balance",
    "included_credits",
    "daily",
    "by_endpoint",
    "by_key"
  ],
  "$defs": {
    "Breakdown": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name",
          "description": "The endpoint, such as `/v1/parcel`, or the API key's name. `Console`, `MCP` or `OAuth` for requests made without an API key."
        },
        "requests": {
          "type": "integer",
          "title": "Requests",
          "description": "Requests made."
        },
        "credits": {
          "type": "integer",
          "title": "Credits",
          "description": "Credits spent."
        }
      },
      "type": "object",
      "required": [
        "name",
        "requests",
        "credits"
      ],
      "title": "Breakdown"
    },
    "usage__Point": {
      "properties": {
        "day": {
          "type": "string",
          "format": "date-time",
          "title": "Day",
          "description": "The day, at midnight UTC."
        },
        "requests": {
          "type": "integer",
          "title": "Requests",
          "description": "Requests made that day."
        },
        "credits": {
          "type": "integer",
          "title": "Credits",
          "description": "Credits spent that day."
        }
      },
      "type": "object",
      "required": [
        "day",
        "requests",
        "credits"
      ],
      "title": "Point",
      "description": "One day's totals."
    }
  }
}