{
  "openapi": "3.1.0",
  "info": {
    "title": "Aibuku site search",
    "version": "1.0.0",
    "description": "Finds the pages of https://aibuku.com/ that match a question, as NLWeb 0.55. It returns pages and does not write answers. No key needed. Limit: at least 60 requests per 60 seconds for each network (an IPv4 address or an IPv6 /64). Versions: /v1/ask keeps its shape: fields may be added, never removed or renamed. A change that breaks it gets a new version, and the old one answers for at least 6 months with Deprecation and Sunset headers. /ask always answers as the newest version.",
    "contact": {
      "email": "info@aibuku.com",
      "url": "https://aibuku.com/contact"
    }
  },
  "externalDocs": {
    "url": "https://aibuku.com/developers"
  },
  "servers": [
    {
      "url": "https://aibuku.com"
    }
  ],
  "security": [],
  "paths": {
    "/v1/ask": {
      "post": {
        "operationId": "askSite",
        "summary": "Find pages that match a question",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The matching pages, best first, or a NO_RESULTS failure. Server-sent events when streaming was asked for.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Answer"
                    },
                    {
                      "$ref": "#/components/schemas/Failure"
                    }
                  ]
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The request cannot be answered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Failure"
                }
              }
            }
          },
          "429": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Too many requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Failure"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "askSiteByQuery",
        "summary": "Find pages that match a question, with the question in the address",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "The question.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer. Leave out for the first page.",
            "schema": {
              "type": "string",
              "description": "The next_cursor of the previous answer. Leave out for the first page."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many results to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 8,
              "description": "How many results to return."
            }
          },
          {
            "name": "streaming",
            "in": "query",
            "required": false,
            "description": "true for server-sent events.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The matching pages, best first, or a NO_RESULTS failure. Server-sent events when streaming was asked for.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Answer"
                    },
                    {
                      "$ref": "#/components/schemas/Failure"
                    }
                  ]
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The request cannot be answered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Failure"
                }
              }
            }
          },
          "429": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Too many requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Failure"
                }
              }
            }
          }
        }
      }
    },
    "/ask": {
      "post": {
        "operationId": "askSiteNlweb",
        "summary": "Find pages that match a question",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The matching pages, best first, or a NO_RESULTS failure. Server-sent events when streaming was asked for.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Answer"
                    },
                    {
                      "$ref": "#/components/schemas/Failure"
                    }
                  ]
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The request cannot be answered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Failure"
                }
              }
            }
          },
          "429": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Too many requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Failure"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "askSiteNlwebByQuery",
        "summary": "Find pages that match a question, with the question in the address",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "The question.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor of the previous answer. Leave out for the first page.",
            "schema": {
              "type": "string",
              "description": "The next_cursor of the previous answer. Leave out for the first page."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many results to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 8,
              "description": "How many results to return."
            }
          },
          {
            "name": "streaming",
            "in": "query",
            "required": false,
            "description": "true for server-sent events.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The matching pages, best first, or a NO_RESULTS failure. Server-sent events when streaming was asked for.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Answer"
                    },
                    {
                      "$ref": "#/components/schemas/Failure"
                    }
                  ]
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The request cannot be answered.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Failure"
                }
              }
            }
          },
          "429": {
            "headers": {
              "RateLimit": {
                "description": "What is left in this window (r) and the seconds until it ends (t).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Policy": {
                "description": "The limit (q) and the window in seconds (w).",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The limit.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "What is left in this window.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Seconds until the window ends.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Too many requests.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Failure"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AskRequest": {
        "type": "object",
        "required": [
          "query"
        ],
        "properties": {
          "cursor": {
            "type": "string",
            "description": "The next_cursor of the previous answer. Leave out for the first page."
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 20,
            "default": 8,
            "description": "How many results to return."
          },
          "query": {
            "type": "object",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500,
                "description": "The question."
              }
            }
          },
          "prefer": {
            "type": "object",
            "properties": {
              "streaming": {
                "type": "boolean",
                "description": "Answer as server-sent events."
              },
              "response_format": {
                "type": "string",
                "enum": [
                  "conversational_search"
                ]
              },
              "mode": {
                "type": "string",
                "description": "Must include list."
              }
            }
          }
        }
      },
      "Meta": {
        "type": "object",
        "required": [
          "response_type",
          "version"
        ],
        "properties": {
          "response_type": {
            "type": "string",
            "enum": [
              "answer",
              "failure"
            ]
          },
          "response_format": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "Result": {
        "type": "object",
        "required": [
          "@type",
          "url",
          "name",
          "description",
          "score"
        ],
        "properties": {
          "@type": {
            "type": "string",
            "const": "WebPage"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "score": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          }
        }
      },
      "Answer": {
        "type": "object",
        "required": [
          "_meta",
          "results",
          "next_cursor"
        ],
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Result"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Send as cursor for the next page. null on the last page."
          }
        }
      },
      "Failure": {
        "type": "object",
        "required": [
          "_meta",
          "error"
        ],
        "properties": {
          "_meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "INVALID_QUERY",
                  "INVALID_CURSOR",
                  "INVALID_LIMIT",
                  "RATE_LIMITED",
                  "NO_RESULTS",
                  "UNSUPPORTED_FORMAT",
                  "UNSUPPORTED_MODE"
                ]
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}