{
  "openapi": "3.1.0",
  "info": {
    "title": "丸子·张 Public APIs",
    "version": "1.3.0",
    "description": "Read-only public surfaces for indexing and mirrors: JSON APIs, per-page Markdown mirrors, llms.txt and RSS. Remote query endpoints are listed only when the operator has actually configured them. Site assistant proxy: POST https://blog.oneszhang.com/api/ask (same-origin, SSE, not NLWeb)."
  },
  "servers": [
    {
      "url": "https://blog.oneszhang.com/"
    }
  ],
  "paths": {
    "/api/ask": {
      "post": {
        "operationId": "askSiteAssistant",
        "summary": "站内 AI 问答（同源流式代理）",
        "description": "浏览器 /ask 页使用的同源问答代理：转发到站长配置的模型网关并以 SSE 流式返回。匿名可用、按 IP 限流；仅接受本站与本地来源，其他 Origin 返回 403。响应为 OpenAI 兼容 chunk，不是 NLWeb 结构，也不暴露任何工具调用语义。",
        "security": [
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "query"
                ],
                "additionalProperties": false,
                "properties": {
                  "query": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 800,
                    "description": "自然语言问题"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OpenAI 兼容 SSE 流（chat.completion.chunk）",
            "content": {
              "text/event-stream; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "query 缺失、为空或超长",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Origin 不在允许列表",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "405": {
            "description": "仅支持 POST",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "按 IP 限流（每分钟 8 次）",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "模型密钥未配置（KV 未绑定或缺少 makers_api_key）",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/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"
                }
              }
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "operationId": "getLlmsTxt",
        "summary": "llms.txt 站点入口目录",
        "responses": {
          "200": {
            "description": "站点导航、机器可读面清单与全量文章索引",
            "content": {
              "text/plain; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/llms-full.txt": {
      "get": {
        "operationId": "getLlmsFullTxt",
        "summary": "全量公开语料",
        "responses": {
          "200": {
            "description": "全部文章与策展问答正文（含 Markdown 镜像地址）",
            "content": {
              "text/plain; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/about.md": {
      "get": {
        "operationId": "getAboutMarkdown",
        "summary": "关于页 Markdown 镜像",
        "responses": {
          "200": {
            "description": "关于页纯文本正文",
            "content": {
              "text/markdown; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/{year}/{month}/{day}/{slug}.md": {
      "get": {
        "operationId": "getArticleMarkdown",
        "summary": "文章 Markdown 镜像",
        "description": "与 HTML 文章页一一对应的 Markdown 正文，含 title/description/pubDate/tags frontmatter。",
        "parameters": [
          {
            "name": "year",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "month",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "day",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "文章 Markdown",
            "content": {
              "text/markdown; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/answers/{slug}.md": {
      "get": {
        "operationId": "getAnswerMarkdown",
        "summary": "策展问答 Markdown 镜像",
        "description": "与 /answers/<slug>/ 对应的策展问答 Markdown，含 question/shortAnswer/tags frontmatter。",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "问答 Markdown",
            "content": {
              "text/markdown; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/rss.xml": {
      "get": {
        "operationId": "getRss",
        "summary": "RSS 订阅源",
        "responses": {
          "200": {
            "description": "站点 RSS 2.0 订阅源",
            "content": {
              "application/xml; charset=utf-8": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "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": "微信号"
          }
        }
      }
    },
    "securitySchemes": {}
  }
}
