{
  "openapi": "3.1.0",
  "info": {
    "title": "ClipQuill public site lookup",
    "version": "1.0.0",
    "summary": "Read-only facts about ClipQuill, taken from https://clipquill.com/",
    "description": "Anonymous, bounded, read-only retrieval of the facts ClipQuill publishes on its own homepage: supported input and output formats, size and length limits, privacy model, language behaviour, measured timings and the one accuracy sample. No authentication exists and none is required. There are no write operations and no arbitrary-URL fetching. If a question is not covered by the returned data, ClipQuill has not published an answer for it.",
    "contact": {
      "url": "https://clipquill.com/ai/"
    }
  },
  "servers": [
    {
      "url": "https://clipquill.com"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "lookup"
    }
  ],
  "paths": {
    "/api/agent/lookup": {
      "get": {
        "tags": [
          "lookup"
        ],
        "operationId": "siteLookup",
        "security": [],
        "summary": "Search the published facts",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Free-text question, or a stable topic id such as limits, timings, privacy, input-formats, output-formats, accuracy, language-count. Empty or omitted returns the whole list."
          }
        ],
        "responses": {
          "200": {
            "description": "Matches, newest-first by relevance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LookupResult"
                }
              }
            }
          },
          "404": {
            "description": "Never returned. A query with no match returns 200 with count 0 and a notFound message."
          }
        }
      }
    },
    "/api/agent/facts": {
      "get": {
        "tags": [
          "lookup"
        ],
        "operationId": "siteFacts",
        "security": [],
        "summary": "The complete public dataset (16 entries)",
        "responses": {
          "200": {
            "description": "All published facts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FactList"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Fact": {
        "type": "object",
        "required": [
          "id",
          "topic",
          "answer",
          "source_url",
          "updated"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "Stable identifier; usable as ?q=<id>."
          },
          "topic": {
            "type": "string"
          },
          "answer": {
            "type": "string",
            "description": "The published answer, verbatim in substance."
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "updated": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "LookupResult": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          },
          "matches": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fact"
            }
          },
          "notFound": {
            "type": "string"
          }
        }
      },
      "FactList": {
        "type": "object",
        "properties": {
          "count": {
            "type": "integer"
          },
          "facts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Fact"
            }
          }
        }
      }
    }
  }
}
