{
  "openapi": "3.1.0",
  "info": {
    "title": "FreshGate",
    "version": "0.7.0",
    "description": "Pay-per-call web freshness and change detection API for AI agents."
  },
  "servers": [
    {
      "url": "https://freshgate-api.franktherecensor.workers.dev"
    }
  ],
  "paths": {
    "/api/check-freshness": {
      "get": {
        "operationId": "checkFreshness",
        "summary": "Check whether a web page changed",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uri"
            }
          },
          {
            "name": "ttl",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 300
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful freshness check"
          },
          "402": {
            "description": "x402 Payment Required"
          }
        }
      }
    }
  }
}