{
  "openapi": "3.1.0",
  "info": {
    "title": "bitemporal.dev Point-in-Time Parquet Catalog & Query API",
    "version": "1.1.1",
    "description": "Release-indexed bitemporal Parquet datasets across 49 catalogs (690048 rows). Free metadata, 3-row live previews (10/day/IP), and metered PIT slices via x402 v2 (eip155:8453) or Stripe Bearer key.",
    "contact": {
      "email": "support@bitemporal.dev"
    }
  },
  "servers": [
    {
      "url": "https://bitemporal.dev"
    }
  ],
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "bt_live_key"
      },
      "X402PaymentSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "PAYMENT-SIGNATURE"
      }
    }
  },
  "paths": {
    "/.well-known/x402.json": {
      "get": {
        "summary": "Machine-readable x402 v2 pricing & schema manifest",
        "responses": {
          "200": {
            "description": "Free discovery manifest"
          }
        }
      }
    },
    "/v1/catalog": {
      "get": {
        "summary": "Full catalog index JSON (datasets, bounds, URLs)",
        "responses": {
          "200": {
            "description": "Free catalog index"
          }
        }
      }
    },
    "/v1/datasets/{dataset_id}/meta": {
      "get": {
        "summary": "Free Arrow schema, temporal bounds, 5-row sample & x402_access hint",
        "responses": {
          "200": {
            "description": "Dataset metadata"
          }
        }
      }
    },
    "/v1/pit/preview": {
      "get": {
        "summary": "Free 3-row live preview of latest records (10/day/IP; rejects as_of_utc/aggregation with 402)",
        "responses": {
          "200": {
            "description": "Free preview rows"
          },
          "402": {
            "description": "Payment Required (x402 v2 PAYMENT-REQUIRED / Tempo MPP WWW-Authenticate)"
          }
        }
      },
      "post": {
        "summary": "Free 3-row live preview of latest records (10/day/IP; rejects as_of_utc/aggregation with 402)",
        "responses": {
          "200": {
            "description": "Free preview rows"
          },
          "402": {
            "description": "Payment Required (x402 v2 PAYMENT-REQUIRED / Tempo MPP WWW-Authenticate)"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "summary": "Streamable-HTTP MCP server (discovery & preview_pit_rows free; query_pit_snapshot paid)",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "X402PaymentSignature": []
          }
        ],
        "x-x402-pricing": {
          "currency": "USDC",
          "network": "eip155:8453"
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "402": {
            "description": "Payment Required (x402 v2 PAYMENT-REQUIRED / Tempo MPP WWW-Authenticate)"
          }
        }
      }
    },
    "/v1/pit/slice": {
      "post": {
        "summary": "Point-in-time slice <= 1000 rows ($0.02 USDC)",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "X402PaymentSignature": []
          }
        ],
        "x-x402-pricing": {
          "priceUsd": "0.02",
          "maxAmountRequired": "20000",
          "currency": "USDC",
          "network": "eip155:8453"
        },
        "responses": {
          "200": {
            "description": "PIT slice rows"
          },
          "402": {
            "description": "Payment Required (x402 v2 PAYMENT-REQUIRED / Tempo MPP WWW-Authenticate)"
          }
        }
      }
    },
    "/v1/pit/aggregate": {
      "post": {
        "summary": "Analytical aggregation or <= 25000-row slice ($0.08 USDC)",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "X402PaymentSignature": []
          }
        ],
        "x-x402-pricing": {
          "priceUsd": "0.08",
          "maxAmountRequired": "80000",
          "currency": "USDC",
          "network": "eip155:8453"
        },
        "responses": {
          "200": {
            "description": "Aggregation result"
          },
          "402": {
            "description": "Payment Required (x402 v2 PAYMENT-REQUIRED / Tempo MPP WWW-Authenticate)"
          }
        }
      }
    },
    "/v1/records/{dataset_id}": {
      "get": {
        "summary": "Point-in-time entity lookup by dataset ($0.02 USDC)",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "X402PaymentSignature": []
          }
        ],
        "x-x402-pricing": {
          "priceUsd": "0.02",
          "maxAmountRequired": "20000",
          "currency": "USDC",
          "network": "eip155:8453"
        },
        "responses": {
          "200": {
            "description": "Lookup rows"
          },
          "402": {
            "description": "Payment Required (x402 v2 PAYMENT-REQUIRED / Tempo MPP WWW-Authenticate)"
          }
        }
      }
    }
  }
}
