{
  "openapi": "3.1.0",
  "info": {
    "title": "GRVY! Content API",
    "version": "1.0.0",
    "description": "Read-only access to GRVY!'s published article search index."
  },
  "servers": [
    {
      "url": "https://grvy.me"
    }
  ],
  "paths": {
    "/agent/auth": {
      "get": {
        "summary": "Discover anonymous agent provisioning metadata",
        "operationId": "getAgentAuthMetadata",
        "responses": {
          "200": {
            "description": "Anonymous registration flow metadata",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Acknowledge anonymous read-only provisioning",
        "description": "Idempotent and stateless. Creates no account and issues no credential.",
        "operationId": "provisionAnonymousAgent",
        "responses": {
          "200": {
            "description": "Anonymous read-only access acknowledged",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/search-index.json": {
      "get": {
        "summary": "List published articles for search and discovery",
        "operationId": "listPublishedArticles",
        "responses": {
          "200": {
            "description": "Published article search index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Article"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/health.json": {
      "get": {
        "summary": "Check Content API availability",
        "operationId": "getContentApiHealth",
        "responses": {
          "200": {
            "description": "API is available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Article": {
        "type": "object",
        "required": [
          "title",
          "description",
          "url",
          "pubDate",
          "author",
          "categories",
          "tags",
          "content"
        ],
        "properties": {
          "title": { "type": "string" },
          "description": { "type": "string" },
          "url": { "type": "string", "format": "uri-reference" },
          "pubDate": { "type": "string", "format": "date-time" },
          "author": { "type": "string" },
          "categories": {
            "type": "array",
            "items": { "type": "string" }
          },
          "tags": {
            "type": "array",
            "items": { "type": "string" }
          },
          "content": { "type": "string" }
        }
      },
      "Health": {
        "type": "object",
        "required": ["status", "service", "version"],
        "properties": {
          "status": { "type": "string", "const": "ok" },
          "service": { "type": "string" },
          "version": { "type": "string" }
        }
      }
    }
  }
}
