{
  "openapi": "3.1.0",
  "info": {
    "title": "MCPDiet by RungLab — Discovery, Pricing & Conversion API",
    "version": "1.2.0",
    "description": "Machine-readable API & discovery specification for MCPDiet (client-side MCP token profiler, free tailored sample delivery, Creem checkout, and remote MCP profiling via dev.runglab/devtools).",
    "contact": {
      "name": "RungLab Support",
      "email": "support@runglab.dev",
      "url": "https://runglab.dev/support/"
    }
  },
  "servers": [
    { "url": "https://mcp.runglab.dev", "description": "MCPDiet Web & Static Discovery" },
    { "url": "https://api.runglab.dev", "description": "RungLab Lead & Creem Checkout API" },
    { "url": "https://mcp-server.runglab.dev", "description": "RungLab Remote MCP Server (dev.runglab/devtools)" }
  ],
  "paths": {
    "/api/pricing": {
      "get": {
        "operationId": "getPricing",
        "summary": "Retrieve structured MCPDiet pricing tiers, currencies, and rate limits",
        "responses": {
          "200": {
            "description": "JSON pricing tiers and quotas",
            "content": { "application/json": { "schema": { "type": "object" } } }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "getHealth",
        "summary": "Check MCPDiet static discovery health",
        "responses": {
          "200": { "description": "Service status JSON" }
        }
      }
    },
    "/api/lead": {
      "post": {
        "operationId": "requestFreeFixSample",
        "summary": "Request 1 free tailored MCP schema optimization fix file ($0 upfront)",
        "servers": [{ "url": "https://api.runglab.dev" }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["email", "target", "product"],
                "properties": {
                  "email": { "type": "string", "format": "email" },
                  "target": { "type": "string" },
                  "product": { "type": "string", "enum": ["mcpdiet"] },
                  "ref": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Lead accepted" }
        }
      }
    },
    "/api/checkout": {
      "post": {
        "operationId": "createCreemCheckoutSession",
        "summary": "Create pre-filled Creem checkout session for Pro ($15) or DFY Optimization PR ($49)",
        "servers": [{ "url": "https://api.runglab.dev" }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["productKey"],
                "properties": {
                  "productKey": { "type": "string", "enum": ["mcpdiet", "dfy_pr"] },
                  "target": { "type": "string" },
                  "email": { "type": "string", "format": "email" },
                  "ref": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Checkout URL returned" }
        }
      }
    }
  }
}
