{
  "openapi": "3.1.0",
  "info": {
    "title": "Vibe Manufacturing API",
    "version": "1.0.0",
    "description": "Read-only public endpoints over the Vibe Manufacturing content. No authentication."
  },
  "servers": [
    {
      "url": "https://vibe-manufacturing.com"
    }
  ],
  "paths": {
    "/api/search": {
      "get": {
        "operationId": "searchSite",
        "summary": "Search playbook, guides, tools and comparisons",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Free-text search term"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "query": {
                      "type": "string"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "summary": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing query"
          }
        }
      }
    },
    "/api/cost": {
      "get": {
        "operationId": "estimateCost",
        "summary": "Estimate landed cost per unit and price for a target margin (USD)",
        "parameters": [
          {
            "name": "part",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "finishing",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "hardware",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "assembly_minutes",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "labor_rate_per_hour",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "packaging",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "shipping",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "returns_percent",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "payment_fee_percent",
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "target_margin_percent",
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Estimate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string"
                    },
                    "landed_cost_per_unit": {
                      "type": "number"
                    },
                    "price_for_target_margin": {
                      "type": "number"
                    },
                    "profit_per_unit_after_fees": {
                      "type": "number"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid margin and fee combination"
          }
        }
      }
    },
    "/api/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "Model Context Protocol endpoint (Streamable HTTP, JSON-RPC 2.0)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          },
          "202": {
            "description": "Notification accepted"
          }
        }
      }
    },
    "/api/subscribe": {
      "post": {
        "operationId": "subscribe",
        "summary": "Subscribe an email address to updates",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Subscribed"
          },
          "400": {
            "description": "Invalid email"
          }
        }
      }
    },
    "/api/contact": {
      "post": {
        "operationId": "sendEnquiry",
        "summary": "Send a message to the team by email",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "message"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "message": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 5000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent"
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/suppliers": {
      "get": {
        "operationId": "findSuppliers",
        "summary": "Find contract manufacturers by country and process",
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "ISO code or slug"
          },
          {
            "name": "process",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "city",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching manufacturers"
          },
          "400": {
            "description": "Unknown process"
          }
        }
      }
    },
    "/api/rfq": {
      "post": {
        "operationId": "requestQuote",
        "summary": "Submit a manufacturing quote request",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "description",
                  "consent"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "process": {
                    "type": "string"
                  },
                  "country": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "consent": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Received"
          },
          "400": {
            "description": "Invalid input"
          }
        }
      }
    },
    "/api/match": {
      "get": {
        "operationId": "matchManufacturers",
        "summary": "Rank manufacturers for a structured part spec",
        "parameters": [
          {
            "name": "process",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "materials",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma separated"
          },
          {
            "name": "certifications",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma separated"
          },
          {
            "name": "country",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "quantity",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "file_formats",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Comma separated: step,dxf,stl,..."
          }
        ],
        "responses": {
          "200": {
            "description": "Scored matches with reasons"
          },
          "400": {
            "description": "Missing or unknown process"
          }
        }
      }
    }
  }
}
