{
  "name": "CountertopSwap",
  "name_for_model": "countertop_swap",
  "description": "AI countertop visualizer that replaces the countertop, island, and backsplash in a real photo of a kitchen or bathroom with a photorealistic preview of a new material (quartz, granite, marble, quartzite, porcelain, soapstone, concrete, butcher block). Built for homeowners, contractors, countertop installers, fabricators, and interior designers.",
  "base_url": "https://www.countertopswap.com",
  "openapi_url": "https://www.countertopswap.com/openapi.json",
  "documentation_url": "https://www.countertopswap.com/for-ai-agents",
  "contact": "https://www.countertopswap.com/contact",
  "auth": {
    "type": "api_key",
    "header": "x-api-key",
    "where_to_get": "https://www.countertopswap.com/api-keys (sign in, then create a key)"
  },
  "billing": {
    "model": "credits",
    "cost_per_render": 1,
    "credit_balance_endpoint": null,
    "top_up_url": "https://www.countertopswap.com/billing",
    "notes": "1 credit per successful render. Failed renders are automatically refunded. New accounts receive 1 free trial credit."
  },
  "rate_limits": {
    "per_key": "30 requests per hour"
  },
  "health_endpoint": "https://urbdulnhxberioelwleo.supabase.co/functions/v1/health",
  "capabilities": [
    {
      "name": "health_check",
      "description": "Returns { status: 'ok', service: 'CountertopSwap Render API' }. No auth, no credits. Use this to verify the API is reachable before rendering.",
      "endpoint": "GET https://urbdulnhxberioelwleo.supabase.co/functions/v1/health",
      "headers": {},
      "input": {},
      "output": {
        "status": "string ('ok' when healthy)",
        "service": "string ('CountertopSwap Render API')",
        "version": "string",
        "timestamp": "string (ISO 8601)",
        "endpoints": "object (map of named endpoint URLs)"
      }
    },
    {
      "name": "render_countertop",
      "description": "Generate a photorealistic countertop preview from a kitchen or bathroom photo and a material description. Preserves cabinets, appliances, lighting, and perspective.",
      "endpoint": "POST https://urbdulnhxberioelwleo.supabase.co/functions/v1/render-api",
      "headers": {
        "x-api-key": "Required. Your CountertopSwap API key.",
        "content-type": "application/json OR multipart/form-data"
      },
      "input": {
        "json": {
          "image_url": "string (publicly reachable https URL of a kitchen or bathroom photo, JPEG or PNG, max 12MB) — OR —",
          "image_base64": "string (base64-encoded image, with or without data URI prefix)",
          "material": "string (e.g. 'calacatta quartz', 'absolute black granite', 'white marble with gold veining')"
        },
        "multipart": {
          "image": "file (JPEG or PNG, max 12MB)",
          "material": "string"
        }
      },
      "output": {
        "result_url": "string (https URL of the rendered PNG, hosted on CountertopSwap CDN)",
        "material": "string (echoed material label)",
        "credits_used": "integer (always 1 on success)",
        "render_id": "string (uuid)"
      },
      "errors": {
        "401 missing_api_key": "x-api-key header was not sent.",
        "401 invalid_api_key": "Key not recognized or has been revoked.",
        "402 insufficient_credits": "Account has 0 render credits. Top up at /billing.",
        "400 invalid_image": "image_url is missing, malformed, unreachable, not an image, or larger than 12MB.",
        "400 invalid_material": "material missing or not 2–300 characters.",
        "400 unsupported_material": "material does not reference a supported stone type.",
        "429 rate_limit_exceeded": "More than 30 requests in the last hour for this key.",
        "502 render_failed": "Upstream AI render failed. Credit is automatically refunded."
      },
      "use_cases": [
        "Contractor sales tools previewing options for a homeowner",
        "Interior design assistants comparing finishes in real client photos",
        "Renovation planning tools generating before/after images",
        "Fabricator quoting workflows that need a visual preview"
      ]
    }
  ],
  "materials_supported": [
    "quartz",
    "granite",
    "marble",
    "quartzite",
    "porcelain",
    "soapstone",
    "concrete",
    "butcher block",
    "wood",
    "limestone",
    "travertine",
    "onyx",
    "slate"
  ]
}
