{
  "openapi": "3.1.0",
  "info": {
    "title": "ToolMint US Econ Rates JSON",
    "version": "0.1.0",
    "description": "Normalized US macro rates for AI agents: Treasury average interest rates, Debt to the Penny, Treasury reporting FX, daily par yield curve, and BLS CPI. Pay per call with USDC on Base via x402.",
    "x-guidance": "Use GET /rates for latest + history. Use GET /rates/latest for a smaller snapshot. Unpaid calls receive HTTP 402 with x402 payment requirements (USDC on Base). Free: /, /health, /openapi.json, /.well-known/x402.",
    "contact": {
      "email": "toolmint.dev@gmail.com",
      "name": "ToolMint"
    }
  },
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "security": [],
        "responses": {
          "200": {
            "description": "ok"
          }
        }
      }
    },
    "/rates": {
      "get": {
        "operationId": "us_econ_rates_feed",
        "summary": "Normalized US econ rates feed (latest + history)",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "10000"
        },
        "parameters": [
          {
            "name": "includeHistory",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "historyDays",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 60
            }
          },
          {
            "name": "historyMonths",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 12
            }
          },
          {
            "name": "historyQuarters",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 2
            }
          },
          {
            "name": "startYear",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endYear",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "strict",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "502 (not charged) if any source fails, instead of a partial 200"
          }
        ],
        "responses": {
          "200": {
            "description": "Rates feed JSON (partial=true + missing[] if some sources failed)"
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Upstream error (not charged)"
          }
        }
      }
    },
    "/rates/latest": {
      "get": {
        "operationId": "us_econ_rates_latest",
        "summary": "Latest-only US econ rates snapshot",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "10000"
        },
        "parameters": [
          {
            "name": "strict",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Latest rates JSON (partial=true + missing[] if some sources failed)"
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Upstream error (not charged)"
          }
        }
      }
    },
    "/rates/history": {
      "get": {
        "operationId": "us_econ_rates_history",
        "summary": "History window for US econ rates feed",
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.010000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ],
          "network": "eip155:8453",
          "payTo": "0xfbF7413bcB3a604936775C96FDbe0b0C9c9E37F5",
          "asset": "USDC",
          "scheme": "exact",
          "amountAtomic": "10000"
        },
        "parameters": [
          {
            "name": "historyDays",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 90
            }
          },
          {
            "name": "startYear",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "endYear",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "strict",
            "in": "query",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "502 (not charged) if any source fails, instead of a partial 200"
          }
        ],
        "responses": {
          "200": {
            "description": "History rates JSON (partial=true + missing[] if some sources failed)"
          },
          "400": {
            "description": "Invalid input (not charged)"
          },
          "402": {
            "description": "Payment Required"
          },
          "502": {
            "description": "Upstream error (not charged)"
          }
        }
      }
    }
  }
}