{
  "openapi": "3.1.0",
  "info": {
    "title": "TSINGHU Public Knowledge & Compliance API",
    "version": "1.0.0",
    "description": "Read-only APIs and agent endpoints for new-energy product testing, global certification routes, technical standards, and published regulatory insights from Shenzhen Tsinghu Technology Co., Ltd. (TSINGHU).",
    "contact": {
      "name": "TSINGHU",
      "url": "https://tsinghu.com/en/contact/",
      "email": "hg@tsinghu.com"
    }
  },
  "servers": [
    {
      "url": "https://tsinghu.com"
    }
  ],
  "paths": {
    "/api/insights/": {
      "get": {
        "operationId": "listInsights",
        "summary": "List published technical insights",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 12,
              "default": 3
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Optional opaque pagination cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "JSON list of published insight articles",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InsightList"
                }
              }
            }
          }
        }
      }
    },
    "/ask": {
      "get": {
        "operationId": "askNlwebGet",
        "summary": "NLWeb conversational query across certification routes, standards, labs, and articles",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "en"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 15,
              "default": 8
            }
          }
        ],
        "responses": {
          "200": {
            "description": "NLWeb Schema.org JSON-LD result list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NlwebResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "askNlwebPost",
        "summary": "NLWeb conversational query (JSON body)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "properties": {
                  "query": {
                    "type": "string"
                  },
                  "locale": {
                    "type": "string",
                    "default": "en"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 15,
                    "default": 8
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "NLWeb Schema.org JSON-LD result list",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NlwebResponse"
                }
              }
            }
          }
        }
      }
    },
    "/feed.json": {
      "get": {
        "operationId": "getJsonFeed",
        "summary": "JSON Feed 1.1 of latest technical insights",
        "responses": {
          "200": {
            "description": "JSON Feed 1.1 document",
            "content": {
              "application/feed+json": {
                "schema": {
                  "$ref": "#/components/schemas/JsonObject"
                }
              }
            }
          }
        }
      }
    },
    "/rss.xml": {
      "get": {
        "operationId": "getRssFeed",
        "summary": "RSS 2.0 feed of latest technical insights",
        "responses": {
          "200": {
            "description": "RSS 2.0 XML document",
            "content": {
              "application/rss+xml": {
                "schema": {
                  "$ref": "#/components/schemas/TextDocument"
                }
              }
            }
          }
        }
      }
    },
    "/.well-known/search": {
      "get": {
        "operationId": "searchForAgents",
        "summary": "Semantic Search for Agents across tsinghu.com",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown search results",
            "content": {
              "text/markdown": {
                "schema": {
                  "$ref": "#/components/schemas/TextDocument"
                }
              }
            }
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "callMcpRpc",
        "summary": "Streamable HTTP MCP JSON-RPC 2.0 endpoint",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpRpcRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response for initialize, tools/list, tools/call, resources/list, resources/read",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpRpcResponse"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxtEn",
        "summary": "Compact site map for LLMs (English)",
        "responses": {
          "200": {
            "description": "Plain text Markdown map",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TextDocument"
                }
              }
            }
          }
        }
      }
    },
    "/zh/llms.txt": {
      "get": {
        "operationId": "getLlmsTxtZh",
        "summary": "Compact site map for LLMs (Simplified Chinese)",
        "responses": {
          "200": {
            "description": "Plain text Markdown map",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TextDocument"
                }
              }
            }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "operationId": "getLlmsFullTxt",
        "summary": "Expanded single-file reference for LLMs",
        "responses": {
          "200": {
            "description": "Full service, standard, route, and article reference",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TextDocument"
                }
              }
            }
          }
        }
      }
    },
    "/{locale}/insights/{slug}.md": {
      "get": {
        "operationId": "getArticleMarkdown",
        "summary": "Plain-Markdown twin of an insight article",
        "parameters": [
          {
            "name": "locale",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown article with key takeaways, FAQ, and official citations",
            "content": {
              "text/markdown": {
                "schema": {
                  "$ref": "#/components/schemas/TextDocument"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TextDocument": {
        "type": "string"
      },
      "JsonObject": {
        "type": "object"
      },
      "InsightList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "NlwebResponse": {
        "type": "object",
        "properties": {
          "protocol": {
            "type": "string"
          },
          "query": {
            "type": "string"
          },
          "query_id": {
            "type": "string"
          },
          "totalResults": {
            "type": "integer"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object"
            }
          }
        }
      },
      "McpRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "properties": {
          "jsonrpc": {
            "type": "string",
            "default": "2.0"
          },
          "id": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "method": {
            "type": "string"
          },
          "params": {
            "type": "object"
          }
        }
      },
      "McpRpcResponse": {
        "type": "object",
        "properties": {
          "jsonrpc": {
            "type": "string"
          },
          "id": {
            "type": [
              "string",
              "integer",
              "null"
            ]
          },
          "result": {
            "type": "object"
          },
          "error": {
            "type": "object"
          }
        }
      }
    }
  }
}