{
  "openapi": "3.1.0",
  "info": {
    "title": "OpenKUAI Public APIs",
    "version": "1.2.0",
    "description": "Build-time read-only JSON APIs for this public site. The Ask/MCP endpoints are not configured on this deployment."
  },
  "servers": [
    {
      "url": "https://openkuai.com/"
    }
  ],
  "paths": {
    "/api/profile.json": {
      "get": {
        "operationId": "getProfile",
        "responses": {
          "200": {
            "description": "公开个人资料",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                }
              }
            }
          }
        }
      }
    },
    "/api/articles.json": {
      "get": {
        "operationId": "getArticles",
        "responses": {
          "200": {
            "description": "公开文章索引",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/topics.json": {
      "get": {
        "operationId": "getTopics",
        "responses": {
          "200": {
            "description": "公开主题索引",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/api/search-index.json": {
      "get": {
        "operationId": "getSearchIndex",
        "responses": {
          "200": {
            "description": "公开静态搜索索引",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Profile": {
        "type": "object",
        "required": [
          "id",
          "name",
          "url",
          "sameAs"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uri"
          },
          "name": {
            "type": "string"
          },
          "jobTitle": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "sameAs": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "wechat": {
            "type": "string",
            "description": "微信号"
          }
        }
      },
      "NlWebAskRequest": {
        "type": "object",
        "description": "NLWeb v0.55-compatible restricted /ask subset. Supports POST /ask with conversational_search, list, summarize, buffered SSE, and MCP ask over Streamable HTTP. Does not support /await, promise responses, elicitation, chatgpt_app, arbitrary extension fields, result actions, or long-term memory.",
        "required": [
          "query"
        ],
        "additionalProperties": false,
        "properties": {
          "query": {
            "type": "object",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              }
            },
            "additionalProperties": false
          },
          "context": {
            "type": "object",
            "maxProperties": 0,
            "additionalProperties": false
          },
          "prefer": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "streaming": {
                "type": "boolean"
              },
              "response_format": {
                "const": "conversational_search"
              },
              "mode": {
                "enum": [
                  "list",
                  "summarize",
                  "list, summarize"
                ]
              },
              "accept-language": {
                "type": "string"
              },
              "user-agent": {
                "type": "string"
              }
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "version": {
                "const": "0.55"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "NlWebResponse": {
        "type": "object",
        "required": [
          "_meta"
        ],
        "properties": {
          "_meta": {
            "type": "object",
            "required": [
              "response_type",
              "version"
            ],
            "properties": {
              "response_type": {
                "enum": [
                  "answer",
                  "failure"
                ]
              },
              "version": {
                "const": "0.55"
              }
            }
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "error": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  }
}
