{
  "openapi": "3.0.3",
  "info": {
    "title": "AGENTS FOR AN AGENT \u2014 Free Health Check API",
    "version": "1.0.0",
    "description": "Existing static validator; free, optional support, no account or payments."
  },
  "servers": [
    {
      "url": "https://agents-for-an-agent.lovable.app"
    }
  ],
  "security": [],
  "paths": {
    "/api/health-check": {
      "get": {
        "summary": "Free machine-readable usage instructions",
        "responses": {
          "200": {
            "description": "Usage JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Free static manifest validation",
        "description": "Entire request limited to 100,000 UTF-8 bytes. No persistence, logging by handler, execution, external fetches or payments. Not MCP/A2A compliance. Non-sensitive JSON only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "manifest"
                ],
                "properties": {
                  "manifest": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": true
                      },
                      {
                        "type": "string",
                        "maxLength": 100000
                      }
                    ]
                  }
                }
              },
              "example": {
                "manifest": {
                  "name": "Research helper",
                  "version": "1.0",
                  "description": "Summarizes public research.",
                  "capabilities": [
                    "summarize"
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "HealthReport, including manifest ERROR findings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid envelope JSON/schema",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Exceeds 100,000 bytes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Expected application/json",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "options": {
        "summary": "CORS preflight",
        "responses": {
          "204": {
            "description": "GET, POST, OPTIONS; Content-Type allowed; wildcard origin"
          }
        }
      }
    },
    "/api/public/health-check": {
      "get": {
        "summary": "Free machine-readable usage instructions",
        "responses": {
          "200": {
            "description": "Usage JSON",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "summary": "Free static manifest validation",
        "description": "Entire request limited to 100,000 UTF-8 bytes. No persistence, logging by handler, execution, external fetches or payments. Not MCP/A2A compliance. Non-sensitive JSON only.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "manifest"
                ],
                "properties": {
                  "manifest": {
                    "oneOf": [
                      {
                        "type": "object",
                        "additionalProperties": true
                      },
                      {
                        "type": "string",
                        "maxLength": 100000
                      }
                    ]
                  }
                }
              },
              "example": {
                "manifest": {
                  "name": "Research helper",
                  "version": "1.0",
                  "description": "Summarizes public research.",
                  "capabilities": [
                    "summarize"
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "HealthReport, including manifest ERROR findings",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid envelope JSON/schema",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "413": {
            "description": "Exceeds 100,000 bytes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "415": {
            "description": "Expected application/json",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "options": {
        "summary": "CORS preflight",
        "responses": {
          "204": {
            "description": "GET, POST, OPTIONS; Content-Type allowed; wildcard origin"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HealthReport": {
        "type": "object",
        "required": [
          "report_version",
          "validation",
          "status",
          "summary",
          "findings",
          "limitations"
        ],
        "properties": {
          "report_version": {
            "type": "string",
            "enum": [
              "1.0"
            ]
          },
          "validation": {
            "type": "string",
            "enum": [
              "static_only"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "PASS",
              "WARN",
              "ERROR"
            ]
          },
          "summary": {
            "type": "object",
            "required": [
              "PASS",
              "WARN",
              "ERROR"
            ],
            "properties": {
              "PASS": {
                "type": "integer",
                "minimum": 0
              },
              "WARN": {
                "type": "integer",
                "minimum": 0
              },
              "ERROR": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "findings": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "status",
                "field",
                "message"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "PASS",
                    "WARN",
                    "ERROR"
                  ]
                },
                "field": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            }
          },
          "limitations": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}
