{
  "openapi": "3.0.3",
  "info": {
    "title": "FreeCsStyles Public API",
    "version": "1.0.0",
    "description": "Read-only catalog access. Auth: `Authorization: Bearer fcs_…` — keys are issued via the admin console (`/api/admin/api-keys`). Rate limit: 120 req/min per key."
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/api/v1/designs": {
      "get": {
        "summary": "List published designs",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Exact tag match (case-insensitive)"
          },
          {
            "name": "framework",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Keyset cursor from nextCursor"
          }
        ],
        "responses": {
          "200": {
            "description": "{ items: Design[], total: number, nextCursor?: string }"
          },
          "401": {
            "description": "Missing/invalid key"
          },
          "429": {
            "description": "Rate limit exceeded"
          }
        }
      }
    },
    "/api/v1/designs/{id}": {
      "get": {
        "summary": "Get one published design (full record incl. implementations)",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "{ item: Design }"
          },
          "404": {
            "description": "Not found (or unpublished — drafts 404 indistinguishably)"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Design": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "designStyle": {
            "type": "string"
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "frameworkSupport": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "published"
            ]
          },
          "thumbnail": {
            "type": "string",
            "nullable": true
          },
          "implementations": {
            "type": "object"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}