{
  "openapi": "3.1.0",
  "info": {
    "title": "PlatPhorm Vanlife API",
    "version": "1.0.0",
    "description": "Public Vanlife resources, current network events, honest sensor state, protected road updates, and a read-only MCP server."
  },
  "servers": [
    { "url": "https://vanlife.platphormnews.com" }
  ],
  "components": {
    "securitySchemes": {
      "PlatPhormBearer": { "type": "http", "scheme": "bearer" },
      "PlatPhormApiKey": { "type": "apiKey", "in": "header", "name": "X-PlatPhorm-API-Key" }
    }
  },
  "paths": {
    "/api/health": {
      "get": { "operationId": "getHealth", "summary": "Get public service health", "responses": { "200": { "description": "Health response" } } }
    },
    "/api/v1/health": {
      "get": { "operationId": "getHealthV1", "summary": "Get versioned public service health", "responses": { "200": { "description": "Health response" } } }
    },
    "/api/docs": {
      "get": { "operationId": "getApiDocs", "summary": "Get API documentation", "responses": { "200": { "description": "OpenAPI document" } } }
    },
    "/api/resources": {
      "get": { "operationId": "listVanlifeResources", "summary": "List curated Vanlife resources", "responses": { "200": { "description": "Resource catalog" } } }
    },
    "/api/events": {
      "get": { "operationId": "listVanlifeEvents", "summary": "List current events from PlatPhorm Calendar", "responses": { "200": { "description": "Active or empty event result" }, "503": { "description": "Calendar degraded state" } } }
    },
    "/api/sensors": {
      "get": { "operationId": "getSensorState", "summary": "Get honest current or empty sensor state", "responses": { "200": { "description": "Sensor state" } } },
      "post": { "operationId": "updateSensorState", "summary": "Update ephemeral sensor state", "security": [{ "PlatPhormBearer": [] }, { "PlatPhormApiKey": [] }], "responses": { "200": { "description": "Sensor state updated" }, "401": { "description": "Unauthorized" }, "503": { "description": "Platform auth is not configured" } } }
    },
    "/api/update": {
      "get": { "operationId": "getRoadUpdateMetadata", "summary": "Get road update endpoint metadata", "responses": { "200": { "description": "Endpoint metadata" } } },
      "post": { "operationId": "createRoadUpdate", "summary": "Create an ephemeral road update", "security": [{ "PlatPhormBearer": [] }, { "PlatPhormApiKey": [] }], "responses": { "200": { "description": "Update accepted by this runtime" }, "401": { "description": "Unauthorized" }, "503": { "description": "Platform auth is not configured" } } }
    },
    "/api/chat": {
      "post": { "operationId": "chatWithVanlifeGuide", "summary": "Stream a Vanlife assistant response", "responses": { "200": { "description": "AI SDK message stream" } } }
    },
    "/api/mcp": {
      "get": { "operationId": "getMcpMetadata", "summary": "Get public Vanlife MCP metadata", "responses": { "200": { "description": "MCP metadata and usage" } } },
      "post": { "operationId": "callVanlifeMcp", "summary": "Call the public read-only MCP JSON-RPC server", "description": "Supports initialize, ping, tools, resources, and prompts. No mutation tools are exposed.", "responses": { "200": { "description": "JSON-RPC response" }, "400": { "description": "JSON parse error" } } }
    }
  }
}
