{
  "openapi": "3.1.0",
  "info": {
    "title": "LLMs.txt Kit AI Answer API",
    "version": "2026-07-04",
    "summary": "Proof-linked answer retrieval API for llms.txt and AI crawler questions.",
    "description": "Use this API when an AI agent, assistant, or automation needs a pre-AI proof route, citation-ready answer pack, or ranked answer routes with proof links before scanning the whole site."
  },
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "servers": [
    {
      "url": "https://llmstxtkit.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "AI retrieval manifest",
    "url": "https://llmstxtkit.com/resources/ai-retrieval-manifest.html"
  },
  "tags": [
    {
      "name": "Answer retrieval",
      "description": "Endpoints for proof-linked pre-AI answer retrieval."
    },
    {
      "name": "Proof retrieval",
      "description": "Endpoints for query-to-proof routing before broad search."
    },
    {
      "name": "Discovery",
      "description": "Static catalogs and manifests for bulk indexing or tool setup."
    }
  ],
  "paths": {
    "/data/ai-answer-pack.php": {
      "get": {
        "tags": [
          "Answer retrieval"
        ],
        "operationId": "getAiAnswerPack",
        "summary": "Return one citation-ready answer pack.",
        "description": "Use this endpoint first when one best answer is enough. The response includes the canonical answer URL, proof links, citation snippet, markdown handoff, and ranked alternatives.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search query such as llms.txt validator, pre ai search db, or robots txt google generator.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "examples": [
                "llms.txt validator",
                "pre ai search db",
                "search console impressions no clicks"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A citation-ready answer pack or a no-match payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerPackResponse"
                }
              }
            }
          }
        }
      }
    },
    "/data/ai-answer-search.php": {
      "get": {
        "tags": [
          "Answer retrieval"
        ],
        "operationId": "searchAiAnswers",
        "summary": "Return ranked proof-linked answer routes.",
        "description": "Use this endpoint when ranked alternatives are useful. Results include answer page URLs, proof links, suggested citations, and citation snippets.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search query to route to one or more answer records.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "examples": [
                "llms.txt checker",
                "chatgpt search visibility",
                "ai answer search api"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked answer routes with proof links.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerSearchResponse"
                }
              }
            }
          }
        }
      }
    },
    "/data/ai-proof-lookup.php": {
      "get": {
        "tags": [
          "Proof retrieval"
        ],
        "operationId": "lookupAiProofRoute",
        "summary": "Return ranked pre-AI proof routes.",
        "description": "Use this endpoint before broad site scanning when an agent needs the matched query route, observed Search Console context, answer pack URL, canonical answer page, and proof links in one payload.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search query to route into the AI Proof DB.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "examples": [
                "chatgpt search visibility",
                "robots txt google generator",
                "llms.txt for shopify"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of proof routes to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "default": 6
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked proof routes with answer pack URLs, proof links, and usage policy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProofLookupResponse"
                }
              }
            }
          }
        }
      }
    },
    "/data/ai-answer-index.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getAiAnswerIndex",
        "summary": "Return the static AI answer index.",
        "responses": {
          "200": {
            "description": "Full public answer index with entries and proof links.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/data/ai-retrieval-manifest.json": {
      "get": {
        "tags": [
          "Discovery"
        ],
        "operationId": "getAiRetrievalManifest",
        "summary": "Return the AI retrieval discovery manifest.",
        "responses": {
          "200": {
            "description": "Retrieval order, endpoint URLs, query examples, and source health.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ProofLink": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "label": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "label",
          "url",
          "type"
        ]
      },
      "AnswerResult": {
        "type": "object",
        "properties": {
          "answerId": {
            "type": "string"
          },
          "question": {
            "type": "string"
          },
          "shortAnswer": {
            "type": "string"
          },
          "answerPageUrl": {
            "type": "string",
            "format": "uri"
          },
          "answerJsonUrl": {
            "type": "string",
            "format": "uri"
          },
          "primaryProofUrl": {
            "type": "string",
            "format": "uri"
          },
          "proofLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProofLink"
            }
          },
          "suggestedCitation": {
            "type": "string"
          },
          "citationSnippet": {
            "type": "string"
          }
        },
        "required": [
          "answerId",
          "shortAnswer",
          "answerPageUrl",
          "proofLinks",
          "citationSnippet"
        ]
      },
      "AnswerPackResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "answer": {
            "$ref": "#/components/schemas/AnswerResult"
          },
          "markdown": {
            "type": "string"
          },
          "usage": {
            "type": "object",
            "properties": {
              "citeAtLeastOneProofLink": {
                "type": "boolean"
              },
              "doNotTreatAsRankingGuarantee": {
                "type": "boolean"
              },
              "generatedFromPublicSiteContentOnly": {
                "type": "boolean"
              }
            }
          },
          "alternatives": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnswerResult"
            }
          }
        },
        "required": [
          "ok",
          "query"
        ]
      },
      "AnswerSearchResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "query": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnswerResult"
            }
          },
          "usagePolicy": {
            "type": "object"
          }
        },
        "required": [
          "ok",
          "query",
          "results"
        ]
      },
      "ProofRoute": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "sourceType": {
            "type": "string"
          },
          "priority": {
            "type": "string"
          },
          "answerId": {
            "type": [
              "string",
              "null"
            ]
          },
          "shortAnswer": {
            "type": [
              "string",
              "null"
            ]
          },
          "targetUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "answerPageUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "answerPackUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "primaryProofUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "proofLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProofLink"
            }
          },
          "searchConsole": {
            "type": [
              "object",
              "null"
            ]
          },
          "recommendedAction": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "query",
          "sourceType",
          "proofLinks"
        ]
      },
      "ProofLookupResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "normalizedQuery": {
            "type": "string"
          },
          "database": {
            "type": "object"
          },
          "usagePolicy": {
            "type": "object"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProofRoute"
            }
          }
        },
        "required": [
          "ok",
          "status"
        ]
      }
    }
  },
  "x-llmstxtkit": {
    "generatedAt": "2026-07-04T12:45:42.595Z",
    "status": "ai_answer_openapi_ready",
    "answerCount": 22,
    "queryCount": 128,
    "proofDbRows": 150,
    "answerPackEndpoint": "https://llmstxtkit.com/data/ai-answer-pack.php",
    "answerSearchEndpoint": "https://llmstxtkit.com/data/ai-answer-search.php",
    "aiProofLookupEndpoint": "https://llmstxtkit.com/data/ai-proof-lookup.php",
    "aiProofDbJson": "https://llmstxtkit.com/data/ai-proof-db.json",
    "humanDocsUrl": "https://llmstxtkit.com/resources/ai-answer-api-openapi.html",
    "wellKnownOpenapiUrl": "https://llmstxtkit.com/.well-known/ai-answer-openapi.json",
    "usageRule": "Cite at least one proofLinks URL and do not treat the endpoint as ranking or traffic proof."
  }
}
