{
  "openapi": "3.1.2",
  "info": {
    "title": "Hypermatic Agent API",
    "summary": "Read-only product discovery for Hypermatic Figma plugins.",
    "description": "Use this public API to identify Hypermatic products and retrieve canonical website, Markdown, and documentation links. It does not operate Figma, manage licenses, or expose Hypermatic's private operational endpoints.",
    "version": "1.0.0",
    "contact": {
      "name": "Hypermatic support",
      "url": "https://www.hypermatic.com/contact/"
    },
    "license": {
      "name": "Hypermatic Terms of Service",
      "url": "https://www.hypermatic.com/terms/"
    }
  },
  "jsonSchemaDialect": "https://spec.openapis.org/oas/3.1/dialect/base",
  "servers": [
    {
      "url": "https://www.hypermatic.com",
      "description": "Production"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "Discovery",
      "description": "Agent-oriented API metadata and product discovery."
    }
  ],
  "paths": {
    "/api/agent": {
      "get": {
        "operationId": "getAgentApiDiscovery",
        "summary": "Get public agent API discovery metadata",
        "tags": ["Discovery"],
        "responses": {
          "200": {
            "description": "Discovery metadata",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Discovery"
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agent/v1/products": {
      "get": {
        "operationId": "listHypermaticProducts",
        "summary": "List Hypermatic products",
        "description": "Returns first-party summaries and canonical links. Use q for plain-language matching or use_case for an exact workflow slug.",
        "tags": ["Discovery"],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Plain-language product or workflow search.",
            "schema": {
              "type": "string",
              "maxLength": 200
            },
            "example": "HTML email"
          },
          {
            "name": "use_case",
            "in": "query",
            "required": false,
            "description": "Exact use-case slug.",
            "schema": {
              "type": "string",
              "enum": [
                "banner-motion",
                "content-localization",
                "developer-handoff",
                "email-marketing",
                "feedback-review",
                "file-conversion",
                "image-export",
                "presentations",
                "secure-sharing",
                "website-qa"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching products",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agent/v1/products/{slug}": {
      "get": {
        "operationId": "getHypermaticProduct",
        "summary": "Get one Hypermatic product",
        "tags": ["Discovery"],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Canonical product slug.",
            "schema": {
              "type": "string",
              "enum": [
                "bannerify",
                "commentful",
                "convertify",
                "copydoc",
                "crypto",
                "emailify",
                "favvy",
                "hypercrop",
                "pitchdeck",
                "pixelay",
                "tinyimage",
                "weblify"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "405": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Discovery": {
        "type": "object",
        "properties": {
          "name": { "type": "string" },
          "version": { "type": "string" },
          "description": { "type": "string" },
          "documentation": { "type": "string", "format": "uri" },
          "openapi": { "type": "string", "format": "uri" },
          "mcp": { "type": "string", "format": "uri" },
          "endpoints": {
            "type": "object",
            "additionalProperties": { "type": "string" }
          }
        },
        "required": ["name", "version", "description", "documentation", "openapi", "mcp", "endpoints"],
        "additionalProperties": false
      },
      "Product": {
        "type": "object",
        "properties": {
          "slug": { "type": "string" },
          "name": { "type": "string" },
          "description": { "type": "string" },
          "outcome": { "type": "string" },
          "useCases": {
            "type": "array",
            "items": { "type": "string" }
          },
          "canonicalUrl": { "type": "string", "format": "uri" },
          "markdownUrl": { "type": "string", "format": "uri" },
          "documentationUrl": { "type": "string", "format": "uri" }
        },
        "required": ["slug", "name", "description", "outcome", "useCases", "canonicalUrl", "markdownUrl", "documentationUrl"],
        "additionalProperties": false
      },
      "ProductList": {
        "type": "object",
        "properties": {
          "count": { "type": "integer", "minimum": 0 },
          "products": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Product" }
          }
        },
        "required": ["count", "products"],
        "additionalProperties": false
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": { "type": "string" },
              "message": { "type": "string" },
              "hint": { "type": "string" },
              "details": {}
            },
            "required": ["code", "message", "hint"],
            "additionalProperties": false
          }
        },
        "required": ["error"],
        "additionalProperties": false
      }
    },
    "responses": {
      "Error": {
        "description": "Structured error with a stable code and recovery hint.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": {
                "code": "PRODUCT_NOT_FOUND",
                "message": "No Hypermatic product uses that slug.",
                "hint": "Call /api/agent/v1/products to retrieve the current product slugs."
              }
            }
          }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Agent instructions and complete machine-readable resource index",
    "url": "https://www.hypermatic.com/llms.txt"
  }
}
