{
  "openapi": "3.1.0",
  "info": {
    "title": "Clip to Text Public Resource API",
    "version": "1.0.0",
    "description": "Bounded, read-only discovery of public Clip to Text pages. It never accepts visitor media or arbitrary URLs."
  },
  "servers": [
    { "url": "https://clipstotext.com.co" }
  ],
  "paths": {
    "/api/agent": {
      "get": {
        "operationId": "searchSiteResources",
        "summary": "Search public Clip to Text resources",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "minLength": 1 }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching public resources, possibly an empty list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["query", "count", "results"],
                  "properties": {
                    "query": { "type": "string" },
                    "count": { "type": "integer", "minimum": 0 },
                    "results": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/SiteResource" }
                    }
                  }
                }
              }
            }
          },
          "400": { "description": "Missing or empty query" }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Read service health",
        "responses": { "200": { "description": "Service is available" } }
      }
    }
  },
  "components": {
    "schemas": {
      "SiteResource": {
        "type": "object",
        "required": ["id", "title", "summary", "source_url", "tags"],
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "summary": { "type": "string" },
          "source_url": { "type": "string", "format": "uri" },
          "tags": { "type": "array", "items": { "type": "string" } }
        }
      }
    }
  }
}
