{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/parallel-ai/json-schema/parallel-ai-usage-response-schema.json",
  "title": "UsageResponse",
  "description": "Usage spans for the authenticated organization.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/parallel-ai-account-api-openapi.yml#/components/schemas/UsageResponse",
  "properties": {
    "usage": {
      "items": {
        "$ref": "#/$defs/UsageSpanResponse"
      },
      "type": "array",
      "title": "Usage",
      "description": "Usage spans, ascending by start time"
    }
  },
  "type": "object",
  "$defs": {
    "UsageLineItemResponse": {
      "properties": {
        "product": {
          "type": "string",
          "title": "Product",
          "description": "Billed product name, as it appears on invoices"
        },
        "api_key_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Api Key Id",
          "description": "API key the usage was billed under; null when the usage is not attributed to a specific key"
        },
        "api_key_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Api Key Name",
          "description": "Display name of that API key; null when the usage is not attributed to a key or the key has since been deleted or rotated"
        },
        "app_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "App Name",
          "description": "App the usage was billed under, when grouped"
        },
        "processor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Processor",
          "description": "Processor the usage was billed under, when grouped"
        },
        "quantity": {
          "type": "number",
          "title": "Quantity",
          "description": "Billed usage quantity"
        },
        "total_cost_cents": {
          "type": "number",
          "title": "Total Cost Cents",
          "description": "Total cost of this line item in cents (quantity already applied)"
        },
        "currency": {
          "type": "string",
          "title": "Currency",
          "description": "Currency code, e.g. USD"
        }
      },
      "type": "object",
      "required": [
        "product",
        "quantity",
        "total_cost_cents",
        "currency"
      ],
      "title": "UsageLineItemResponse",
      "description": "One billed usage line item within a time span."
    },
    "UsageSpanResponse": {
      "properties": {
        "start_time": {
          "type": "string",
          "format": "date-time",
          "title": "Start Time",
          "description": "Span start, inclusive (UTC)"
        },
        "end_time": {
          "type": "string",
          "format": "date-time",
          "title": "End Time",
          "description": "Span end, exclusive (UTC)"
        },
        "line_items": {
          "items": {
            "$ref": "#/$defs/UsageLineItemResponse"
          },
          "type": "array",
          "title": "Line Items",
          "description": "Usage breakdown for this span"
        }
      },
      "type": "object",
      "required": [
        "start_time",
        "end_time"
      ],
      "title": "UsageSpanResponse",
      "description": "Usage line items for one UTC day or calendar month."
    }
  }
}