{
  "openapi": "3.1.0",
  "info": { "title": "AINQUEST", "version": "1.1.0", "description": "Ask about AINQUEST, or send an agent query. Counts only: names and contacts are not included. https://ainquest.com/llms.txt" },
  "servers": [{ "url": "https://ainquest.com" }],
  "paths": {
    "/api/agent-query": {
      "post": {
        "operationId": "agentQuery",
        "summary": "Three free requests about AINQUEST. Then a polite stop, or HTTP 402 only if the owner has enabled x402.",
        "requestBody": { "required": false, "content": { "application/json": { "schema": { "type": "object", "properties": { "query": { "type": "string", "maxLength": 300 } } } } } },
        "responses": {
          "200": { "description": "About AINQUEST, contact email, and optional public counts" },
          "402": { "description": "x402 payment required. Disabled unless AGENT_X402_ENABLED=on" },
          "403": { "description": "Free limit used. Write to hello@ainquest.com" }
        }
      }
    },
    "/api/ask": {
      "get": {
        "operationId": "askInqui",
        "summary": "Ask a question about INQUEST",
        "parameters": [{ "name": "q", "in": "query", "required": true, "schema": { "type": "string", "maxLength": 500 } }],
        "responses": { "200": { "description": "Answer", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Answer" } } } }, "429": { "description": "Rate limited" } }
      },
      "post": {
        "operationId": "askInquiPost",
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["question"], "properties": { "question": { "type": "string", "maxLength": 500 } } } } } },
        "responses": { "200": { "description": "Answer", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Answer" } } } } }
      }
    }
  },
  "components": {
    "schemas": {
      "Answer": {
        "type": "object",
        "properties": {
          "ok": { "type": "boolean" },
          "id": { "type": "string" },
          "answer": { "type": "string" },
          "sources": { "type": "array", "items": { "type": "string" } },
          "mode": { "type": "string", "enum": ["model", "library", "guard"] },
          "library": { "type": "string", "format": "uri" }
        }
      }
    }
  }
}
