{
  "openapi": "3.1.0",
  "info": {
    "title": "Ask Jenks API",
    "version": "1.0.0",
    "description": "Public, read-only chat API about Jenks Guo. A tool-using agent grounded in https://jenksguo.xyz/llms-full.txt (structured: /experience.json) answers in plain text, streamed.",
    "contact": {
      "email": "jenksguo@gmail.com",
      "url": "https://jenksguo.xyz/agents"
    }
  },
  "servers": [
    {
      "url": "https://jenksguo.xyz"
    }
  ],
  "paths": {
    "/api/chat": {
      "post": {
        "operationId": "askJenks",
        "summary": "Ask a question about Jenks Guo",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "messages"
                ],
                "properties": {
                  "locale": {
                    "type": "string",
                    "enum": [
                      "en",
                      "zh",
                      "zh-hant",
                      "ja",
                      "fr",
                      "es",
                      "eo"
                    ],
                    "default": "en"
                  },
                  "messages": {
                    "type": "array",
                    "maxItems": 16,
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "type": "string",
                          "maxLength": 2000
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Streamed plain-text answer",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request"
          },
          "429": {
            "description": "Rate limited"
          },
          "503": {
            "description": "Chat not configured"
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
