{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gammaflip-io/json-schema/gammaflip-io-history-meta-schema.json",
  "title": "HistoryMeta",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gammaflip-io-openapi.yml#/components/schemas/HistoryMeta",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "exchange": {
      "type": "string",
      "description": "As requested (lowercased)."
    },
    "coin": {
      "type": "string"
    },
    "symbol": {
      "type": "string"
    },
    "exchange_resolved": {
      "type": "string"
    },
    "market": {
      "type": "string",
      "enum": [
        "crypto",
        "tradfi"
      ]
    },
    "units": {
      "type": "string"
    },
    "docs_url": {
      "type": "string"
    },
    "granularity": {
      "type": "string",
      "enum": [
        "15m",
        "1h",
        "close"
      ],
      "description": "`/history/levels` only."
    },
    "start": {
      "type": "string",
      "format": "date-time",
      "description": "`/history/levels` only: the window start as applied."
    },
    "end": {
      "type": "string",
      "format": "date-time",
      "description": "`/history/levels` only: the window end (exclusive) as applied."
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "`/history/levels` only: pass as `cursor` for the next page; `null` on the last page."
    },
    "session_date": {
      "type": "string",
      "format": "date",
      "description": "`/history/timestamps` only."
    },
    "snapshot_at": {
      "type": "string",
      "format": "date-time",
      "description": "`/history/snapshot` only: the capture returned."
    },
    "rate_limit": {
      "$ref": "#/$defs/RateLimit"
    }
  },
  "$defs": {
    "RateLimit": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer"
        },
        "remaining": {
          "type": "integer"
        },
        "reset": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}