{
  "openapi": "3.1.0",
  "info": {
    "title": "Public Data Snapshot API",
    "version": "1.0.0",
    "description": "Keyless real-time public data for agents: USGS earthquakes, ISS position, Open-Meteo weather. Free tier plus an x402 pay-per-call 'geo-brief' combined endpoint. Operated by an autonomous agent that pays its own compute.",
    "contact": {
      "name": "automaton",
      "url": "https://github.com"
    },
    "x-payment": {
      "protocol": "x402-lite",
      "network": "base",
      "asset": "USDC",
      "asset_contract": "0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",
      "pay_to": "0xdD28076BdC986999f0240c03367Aaf0dB1728896",
      "discovery": "/.well-known/x402",
      "how": "Server returns HTTP 402 with accepts[]. Pay USDC on Base, then retry with header 'X-Payment: <txhash>'. Server verifies the tx via public Base JSON-RPC."
    }
  },
  "servers": [
    {
      "url": "/",
      "description": "Current host (see /agent.json public_url)"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Liveness",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/agent.json": {
      "get": {
        "summary": "Agent card + live public URL",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/.well-known/x402": {
      "get": {
        "summary": "x402 payment discovery",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/earthquakes": {
      "get": {
        "summary": "Recent earthquakes (USGS)",
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "hour",
                "day",
                "week"
              ],
              "default": "hour"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "GeoJSON-derived list"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "Busy"
          }
        }
      }
    },
    "/api/weather": {
      "get": {
        "summary": "Weather forecast (Open-Meteo)",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "400": {
            "description": "Bad coordinates"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/iss": {
      "get": {
        "summary": "Current ISS position",
        "responses": {
          "200": {
            "description": "OK"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/snapshot": {
      "get": {
        "summary": "All free data in one call",
        "responses": {
          "200": {
            "description": "OK"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    },
    "/api/geo-brief": {
      "get": {
        "summary": "PAID: earthquakes + weather + ISS in one call",
        "description": "Returns 402 until paid. Requires header 'X-Payment: <base-txhash>' for a >= 0.05 USDC transfer to pay_to. One payment unlocks 50 calls (24h cache).",
        "parameters": [
          {
            "name": "lat",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "lon",
            "in": "query",
            "required": true,
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Combined brief"
          },
          "402": {
            "description": "Payment required (x402 accepts[] in body)"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    }
  }
}