{
  "openapi": "3.1.0",
  "info": {
    "title": "Analogous Colors Metrology & Palette API",
    "version": "1.0.0",
    "description": "Public edge-cached color science API for APCA-W3 (0.0.98G-4g) perceptual contrast, WCAG 2.1 ratios, W3C DTCG JSON & Tailwind CSS v4 @theme generation, and 25,000+ curated palettes.",
    "contact": {
      "name": "Analogous Colors Design Lab",
      "url": "https://analogouscolor.com/contact"
    }
  },
  "servers": [
    {
      "url": "https://analogouscolor.com"
    }
  ],
  "paths": {
    "/api/v1/contrast": {
      "get": {
        "operationId": "checkColorContrast",
        "summary": "Evaluate APCA-W3 Lc, WCAG 2.1 ratio, OKLCH, and halation risk",
        "parameters": [
          {
            "name": "fg",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "#18181B"
            }
          },
          {
            "name": "bg",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "#FFFFFF"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contrast metrology report JSON"
          }
        }
      }
    },
    "/api/v1/tokens": {
      "get": {
        "operationId": "generateDesignTokens",
        "summary": "Generate W3C DTCG JSON, Tailwind v4 @theme OKLCH, and 50-950 shade ramp",
        "parameters": [
          {
            "name": "colors",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "example": "#4F46E5,#0D9488,#F59E0B"
            }
          },
          {
            "name": "prefix",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "brand"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "dtcg",
                "tailwind-v4",
                "css"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Design token bundle JSON"
          }
        }
      }
    },
    "/api/palettes": {
      "get": {
        "operationId": "searchPalettes",
        "summary": "Query the 25,000+ color palette catalog backed by Cloudflare D1 FTS5",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "harmony",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "view",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "popular"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 24,
              "maximum": 96
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated palettes response"
          }
        }
      }
    }
  }
}