{
  "openapi": "3.1.0",
  "info": {
    "title": "PlatPhorm Image Converter Discovery API",
    "version": "1.2.0",
    "description": "Public-safe health, documentation, discovery, and MCP introspection for the private in-browser image converter. Image bytes are never accepted by this API."
  },
  "servers": [
    {
      "url": "https://image.platphormnews.com"
    }
  ],
  "tags": [
    {
      "name": "Platform",
      "description": "Public health and discovery."
    },
    {
      "name": "MCP",
      "description": "Read-only capability, resource, and workflow guidance."
    }
  ],
  "paths": {
    "/api/health": {
      "get": {
        "tags": [
          "Platform"
        ],
        "summary": "Get public-safe service health",
        "responses": {
          "200": {
            "description": "Health envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "tags": [
          "Platform"
        ],
        "summary": "Get versioned public-safe service health",
        "responses": {
          "200": {
            "description": "Health envelope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/docs": {
      "get": {
        "tags": [
          "Platform"
        ],
        "summary": "Get this OpenAPI document as JSON",
        "responses": {
          "200": {
            "description": "OpenAPI 3.1 document"
          }
        }
      }
    },
    "/api/mcp": {
      "get": {
        "tags": [
          "MCP"
        ],
        "summary": "Get MCP transport metadata and usage",
        "responses": {
          "200": {
            "description": "MCP metadata"
          }
        }
      },
      "post": {
        "tags": [
          "MCP"
        ],
        "summary": "Call the read-only JSON-RPC MCP server",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/JsonRpcRequest"
                  },
                  {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "$ref": "#/components/schemas/JsonRpcRequest"
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response or response batch"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HealthResponse": {
        "type": "object",
        "required": [
          "ok",
          "data"
        ],
        "additionalProperties": false,
        "properties": {
          "ok": {
            "const": true
          },
          "data": {
            "type": "object",
            "required": [
              "service",
              "version",
              "environment",
              "status",
              "timestamp",
              "routeComplianceScore",
              "discoveryStatus",
              "trace",
              "vercelMetadataCaptured"
            ],
            "properties": {
              "service": {
                "const": "platphorm-image-processor"
              },
              "version": {
                "type": "string"
              },
              "environment": {
                "type": "string"
              },
              "status": {
                "enum": [
                  "healthy",
                  "degraded"
                ]
              },
              "timestamp": {
                "type": "string",
                "format": "date-time"
              },
              "routeComplianceScore": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100
              },
              "discoveryStatus": {
                "type": "string"
              },
              "trace": {
                "type": "object"
              },
              "vercelMetadataCaptured": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "JsonRpcRequest": {
        "type": "object",
        "required": [
          "jsonrpc",
          "method"
        ],
        "additionalProperties": false,
        "properties": {
          "jsonrpc": {
            "const": "2.0"
          },
          "id": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "method": {
            "type": "string"
          },
          "params": {}
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "For any future protected action, use PLATPHORM_API_KEY. Current image conversion remains browser-local and public."
      },
      "platphormApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-PlatPhorm-API-Key",
        "description": "For any future protected action, use PLATPHORM_API_KEY. Current image conversion remains browser-local and public."
      }
    }
  }
}