{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/onclarity-com/json-schema/onclarity-com-src-managed-agents-costs-schemas-summary-response-schema.json",
  "title": "SummaryResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/onclarity-com-agent-costs-api-openapi.yml#/components/schemas/src__managed_agents__costs__schemas__SummaryResponse",
  "properties": {
    "from": {
      "type": "string",
      "format": "date-time",
      "title": "From"
    },
    "to": {
      "type": "string",
      "format": "date-time",
      "title": "To"
    },
    "current": {
      "$ref": "#/$defs/PeriodSummary"
    },
    "previous": {
      "$ref": "#/$defs/PeriodSummary"
    },
    "by_surface": {
      "additionalProperties": {
        "$ref": "#/$defs/CostTotals"
      },
      "type": "object",
      "title": "By Surface"
    }
  },
  "type": "object",
  "required": [
    "from",
    "to",
    "current",
    "previous",
    "by_surface"
  ],
  "$defs": {
    "CostTotals": {
      "properties": {
        "input_tokens": {
          "type": "integer",
          "title": "Input Tokens",
          "default": 0
        },
        "output_tokens": {
          "type": "integer",
          "title": "Output Tokens",
          "default": 0
        },
        "cache_read_tokens": {
          "type": "integer",
          "title": "Cache Read Tokens",
          "default": 0
        },
        "cache_5m_tokens": {
          "type": "integer",
          "title": "Cache 5M Tokens",
          "default": 0
        },
        "cache_1h_tokens": {
          "type": "integer",
          "title": "Cache 1H Tokens",
          "default": 0
        },
        "total_tokens": {
          "type": "integer",
          "title": "Total Tokens",
          "default": 0
        },
        "runtime_seconds": {
          "type": "number",
          "title": "Runtime Seconds",
          "default": 0.0
        },
        "usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Usd"
        },
        "unpriced_tokens": {
          "type": "integer",
          "title": "Unpriced Tokens",
          "default": 0
        },
        "list_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "List Usd"
        }
      },
      "type": "object",
      "title": "CostTotals",
      "description": "Token deltas + billed runtime + priced dollars for one bucket.\n\n``usd`` is ``None`` only when NOTHING in the bucket was priceable; ``unpriced_tokens``\ncounts tokens whose model had no pricing rule (surfaced, never silently $0)."
    },
    "PeriodSummary": {
      "properties": {
        "totals": {
          "$ref": "#/$defs/CostTotals"
        },
        "sessions": {
          "type": "integer",
          "title": "Sessions"
        },
        "list_priced_sessions": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "List Priced Sessions"
        }
      },
      "type": "object",
      "required": [
        "totals",
        "sessions"
      ],
      "title": "PeriodSummary"
    }
  }
}