{
  "openapi": "3.1.0",
  "info": {
    "title": "Tidemill API",
    "version": "1.0.0",
    "summary": "Read-only, keyless API for Tidemill's tool catalogue and Pro license checks — for your own scripts and AI agents.",
    "description": "Tidemill has no accounts and no API keys by design: every tool runs free in the browser, so there is no per-customer state for an endpoint to gate. Every endpoint below is public and unauthenticated. GET /api/v1/tools and /api/v1/tools/{slug} read the same catalogue the website's /apps and /tools pages render from. POST /api/v1/license/verify checks whether a pasted Tidemill Pro license key is valid; it never issues or revokes a key, and never returns the key's contents. Lightly rate-limited per IP (see https://tidemill.io/docs/agents). The same jobs are available as MCP tools at https://tidemill.io/mcp and from the `tidemill` CLI (`npx tidemill --help`). Setup guide: https://tidemill.io/docs/agents.",
    "termsOfService": "https://tidemill.io/terms",
    "contact": {
      "name": "Tidemill support",
      "email": "support@tidemill.io",
      "url": "https://tidemill.io/support"
    }
  },
  "servers": [
    { "url": "https://tidemill.io" }
  ],
  "tags": [
    { "name": "tools", "description": "The Tidemill tool catalogue. Public, read-only, no authentication." },
    { "name": "license", "description": "Pro license key validity checks. Public, read-only, no authentication." }
  ],
  "components": {
    "schemas": {
      "Tool": {
        "type": "object",
        "properties": {
          "slug": { "type": "string" },
          "title": { "type": "string" },
          "subtitle": { "type": "string" },
          "category": { "type": "string" },
          "description": { "type": "string" },
          "features": { "type": "array", "items": { "type": "string" } },
          "icon": { "type": "string" },
          "isPro": { "type": "boolean", "description": "Always false: no tool requires a purchase to use." },
          "proEdge": { "type": "string", "description": "What the optional one-time Pro purchase adds for this tool, if anything." },
          "appUrl": { "type": "string", "format": "uri" },
          "toolUrl": { "type": "string", "format": "uri" }
        },
        "required": ["slug", "title", "category", "description", "isPro", "appUrl", "toolUrl"]
      },
      "Error": {
        "type": "object",
        "properties": { "error": { "type": "string" } },
        "required": ["error"]
      }
    },
    "responses": {
      "NotFound": {
        "description": "Unknown slug",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      },
      "RateLimited": {
        "description": "Too many requests from this address. Carries a `retry-after` header (seconds).",
        "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } }
      }
    }
  },
  "paths": {
    "/api/v1/tools": {
      "get": {
        "tags": ["tools"],
        "operationId": "listTools",
        "summary": "List every Tidemill tool",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": { "type": "integer" },
                    "tools": { "type": "array", "items": { "$ref": "#/components/schemas/Tool" } }
                  }
                }
              }
            }
          },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/api/v1/tools/{slug}": {
      "get": {
        "tags": ["tools"],
        "operationId": "getTool",
        "summary": "Get one tool's metadata",
        "security": [],
        "parameters": [
          { "name": "slug", "in": "path", "required": true, "schema": { "type": "string" }, "example": "strobe-tuner" }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": { "type": "object", "properties": { "tool": { "$ref": "#/components/schemas/Tool" } } }
              }
            }
          },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" }
        }
      }
    },
    "/api/v1/license/verify": {
      "post": {
        "tags": ["license"],
        "operationId": "verifyLicense",
        "summary": "Check whether a Tidemill Pro license key is valid",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": { "key": { "type": "string", "example": "tm_..." } },
                "required": ["key"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Valid key",
            "content": {
              "application/json": {
                "schema": { "type": "object", "properties": { "valid": { "type": "boolean" } } }
              }
            }
          },
          "400": {
            "description": "Invalid key or missing body",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": { "valid": { "type": "boolean" }, "error": { "type": "string" } }
                }
              }
            }
          },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "503": { "description": "Verification temporarily unavailable (deployment misconfiguration, never the caller's fault)" }
        }
      }
    }
  }
}
